Skip to content

Aspnetcore doesn't look for linux-musl nupkgs when building on linux-musl platform #39822

@ayakael

Description

@ayakael

Aspnetcore looks for linux-x64 version of nupkgs that, under Alpine, should be linux-musl-x64.

Provisional patch follows:

From 9f21622ae208f49adddf9e8465295229661579ec Mon Sep 17 00:00:00 2001
From: "build@apk-groulx" <[email protected]>
Date: Thu, 20 Jan 2022 01:12:07 +0000
Subject: [PATCH 1/1] build_fix-musl-build

---
 repos/aspnetcore.proj | 1 +
 repos/installer.proj  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/repos/aspnetcore.proj b/repos/aspnetcore.proj
index ad9d77885..0cefccee1 100644
--- a/repos/aspnetcore.proj
+++ b/repos/aspnetcore.proj
@@ -5,6 +5,7 @@
     <!-- StandardSourceBuildArgs include -publish which is not supported by the aspnetcore build script. -->
     <BuildCommandArgs>$(StandardSourceBuildArgs.Replace('--publish', ''))</BuildCommandArgs>
     <!-- The arch flag (defaults to x64) overrides any value of TargetArchitecture that we might set -->
+    <BuildCommandArgs>$(BuildCommandArgs) --os-name linux-musl</BuildCommandArgs>
     <BuildCommandArgs>$(BuildCommandArgs) --arch $(Platform)</BuildCommandArgs>
     <BuildCommandArgs>$(BuildCommandArgs) --no-build-repo-tasks</BuildCommandArgs>
     <BuildCommandArgs>$(BuildCommandArgs) /p:BuildNodeJs=false</BuildCommandArgs>
diff --git a/repos/installer.proj b/repos/installer.proj
index 712d7cd14..cca5295f9 100644
--- a/repos/installer.proj
+++ b/repos/installer.proj
@@ -25,7 +25,7 @@
     <BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:Rid=$(TargetRid)</BuildCommandArgs>
     <BuildCommandArgs>$(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir)</BuildCommandArgs>
 
-    <BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:AspNetCoreSharedFxInstallerRid=linux-$(Platform)</BuildCommandArgs>
+    <BuildCommandArgs Condition="'$(TargetOS)' == 'Linux'">$(BuildCommandArgs) /p:AspNetCoreSharedFxInstallerRid=linux-musl-$(Platform)</BuildCommandArgs>
     <!-- core-sdk always wants to build portable on OSX and FreeBSD -->
     <BuildCommandArgs Condition="'$(TargetOS)' == 'FreeBSD'">$(BuildCommandArgs) /p:CoreSetupRid=freebsd-x64 /p:PortableBuild=true</BuildCommandArgs>
     <BuildCommandArgs Condition="'$(TargetOS)' == 'OSX'">$(BuildCommandArgs) /p:CoreSetupRid=osx-x64</BuildCommandArgs>
-- 

Better implementation would involve, either Aspnetcore automatically setting os-name to linux-musl when building, or repos/aspnetcore.proj automaticallty adds the above BuildCommandArg. Ditto on repos/installer.proj for setting AspNetCoreSharedFxInstallerRid,

Made as part of Alpine Linux dotnet6 packaging project, see dotnet/source-build#2782

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions