Skip to content

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

Description

@ayakael

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" <build@apk-groulx.praxis>
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions