Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force /p:PortableBuild=true, for cases where we overrode the RID. #15163

Merged
merged 3 commits into from
Jan 12, 2023

Conversation

directhex
Copy link

@directhex directhex commented Dec 20, 2022

As-is, the build will fail on portable RID platforms because without /p:PortableBuild=true, the CrossGen2 nupkg gets imported twice, which causes a build failure due to an SDK bug.

Closes: dotnet/source-build#3150

As-is, the build will fail on portable RID platforms because without
`/p:PortableBuild=true`, the CrossGen2 nupkg gets imported twice, which
causes a buiold failure due to an SDK bug.

Closes: dotnet/source-build#3150
@directhex directhex requested a review from a team as a code owner December 20, 2022 18:08
@MichaelSimons
Copy link
Member

@crummel can you please review this and merge if you approve. TIA.

@MichaelSimons
Copy link
Member

Friendly ping @crummel.

@crummel crummel merged commit bd4f868 into dotnet:main Jan 12, 2023
@corngood
Copy link

corngood commented Jan 1, 2024

I'm having this same problem on https://github.com/dotnet/dotnet/releases/tag/v8.0.0 when building linux-x64.

I'm using nixos. If I build normally on my machine, the rid it uses is nixos-24.05-x64. If I build in a nix sandbox, /etc/os-release is unavailable, so it uses linux-x64 and this error occurs. This also happens if I build with TargetRid=linux-x64 or PortableBuild=true.

This is enough to make it build with PortableBuild=true, which works both inside and outside the sandbox:

diff --git a/repo-projects/aspnetcore.proj b/repo-projects/aspnetcore.proj
index e3f4b1664a..947532add9 100644
--- a/repo-projects/aspnetcore.proj
+++ b/repo-projects/aspnetcore.proj
@@ -8,6 +8,7 @@
     <OverrideTargetRid Condition="'$(TargetOS)' == 'Windows_NT'">win-$(Platform)</OverrideTargetRid>
     <_portableRidOverridden Condition="'$(TargetRid)' != '$(OverrideTargetRid)'">true</_portableRidOverridden>
     <_portableRidOverridden Condition="'$(TargetRid)' == '$(OverrideTargetRid)'">false</_portableRidOverridden>
+    <_portableRidOverridden Condition="'$(PortableBuild)' != ''">$(PortableBuild)</_portableRidOverridden>
 
     <!-- StandardSourceBuildArgs include -publish which is not supported by the aspnetcore build script. -->
     <BuildCommandArgs>$(StandardSourceBuildArgs.Replace('--publish', ''))</BuildCommandArgs>

However, I feel like I don't fully understand what's going on here. Anyone have any advice?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants