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

ObjWriterRid always defaults to linux-$(Platform) on Alpine Linux on non-portable build #75636

Closed
ayakael opened this issue Sep 14, 2022 · 4 comments
Labels
area-NativeAOT-coreclr source-build Issues relating to dotnet/source-build
Milestone

Comments

@ayakael
Copy link
Contributor

ayakael commented Sep 14, 2022

Description

ObjWriterRid should equal linux-musl-$(Platform) when building non-portable build. It always defaults to linux-$(Platform) despite setting /p:ObjWriterRid=linux-musl-$(Platform)

Reproduction Steps

Build with /p:TargetRid=alpine.3.16-x64

Expected behavior

Should pick-up runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter on building non-portable runtime.

Actual behavior

Picks up runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter

Regression?

No response

Known Workarounds

While setting /p:ObjWriterRid=linux-musl-$(Platform) on build should work due to

<ObjWriterRid Condition="'$(ObjWriterRid)' == ''">$(ObjWriterRidWithoutPlatform)-$(ObjWriterRidPlatform)</ObjWriterRid>

...it is not picked up for some reason.

The following patch forces it:

From b2f5f8bdab0b921c224aa3611f311c6317897c3a Mon Sep 17 00:00:00 2001
From: "build@apk-groulx" <[email protected]>
Date: Wed, 14 Sep 2022 19:59:07 +0000
Subject: [PATCH 1/1] fix-musl

---
 src/coreclr/tools/aot/ILCompiler/ILCompiler.props | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props
index 8c4fce52390..722eddc1adc 100644
--- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props
+++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props
@@ -29,7 +29,7 @@
     <ObjWriterRidPlatform>$(RuntimeIdentifier.Substring($(_objWriterRidPlatformIndex)).TrimStart('-'))</ObjWriterRidPlatform>
 
     <!-- If it's not win/osx/linux-musl, it's a non-portable Linux. Treat as Linux. -->
-    <ObjWriterRidWithoutPlatform Condition="'$(ObjWriterRidWithoutPlatform)' != 'win' and '$(ObjWriterRidWithoutPlatform)' != 'osx' and '$(ObjWriterRidWithoutPlatform)' != 'linux-musl'">linux</ObjWriterRidWithoutPlatform>
+    <ObjWriterRidWithoutPlatform Condition="'$(ObjWriterRidWithoutPlatform)' != 'win' and '$(ObjWriterRidWithoutPlatform)' != 'osx' and '$(ObjWriterRidWithoutPlatform)' != 'linux-musl'">linux-musl</ObjWriterRidWithoutPlatform>
 
     <!-- OSX builds have a version -->
     <ObjWriterRidWithoutPlatform Condition="'$(ObjWriterRidWithoutPlatform)' == 'osx' and '$(ObjWriterRidPlatform)' == 'x64'">osx.10.12</ObjWriterRidWithoutPlatform>
-- 
2.37.1

Configuration

Build with commit hash 6d10e4c, as pulled by commit 8a0eb58a5a825e10ea2bf06a892dd441355818c8 of dotnet/installer's tarball.

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Sep 14, 2022
@steveisok
Copy link
Member

@MichalStrehovsky are you the right person to look into this?

@jkotas jkotas added the source-build Issues relating to dotnet/source-build label Sep 28, 2022
@jkotas
Copy link
Member

jkotas commented Sep 28, 2022

For .NET 7, we do not plan to build native aot compiler as part of the source build. This should be addressed by #76206.

For .NET 8, there is a larger workitem to make native aot compiler source buildable that this is closely related to.

In the meantime, @ayakael Would you be interested in submitting a PR with a change that solves the problem for you without breaking the non-portable build for other people who care about it? I am not sure what that fix should be.

@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Sep 28, 2022
@steveisok steveisok added this to the 8.0.0 milestone Sep 28, 2022
@tmds
Copy link
Member

tmds commented Oct 11, 2022

I think that in line with making runtime build using non-portable artifacts, we should produce a non-portable rid package for ObjWriter and consume that package in runtime.

@TIHan
Copy link
Contributor

TIHan commented Mar 14, 2024

Resolved by #99733

@TIHan TIHan closed this as completed Mar 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr source-build Issues relating to dotnet/source-build
Projects
Archived in project
Development

No branches or pull requests

6 participants