Skip to content

Commit 55e46dd

Browse files
authored
Fix platform string used for musl (#2195)
1 parent fca24cd commit 55e46dd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/call-cabal-project-to-nix.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ let
290290

291291
ghcSrc = ghc.raw-src or ghc.buildGHC.raw-src;
292292

293-
fixPlatformString = x: builtins.replaceStrings ["-linux-gnu"] ["-linux"] x;
293+
platformString = p: with p.parsed; "${cpu.name}-${vendor.name}-${kernel.name}";
294294

295295
# Dummy `ghc` that uses the captured output
296296
dummy-ghc = evalPackages.writeTextFile {
@@ -341,10 +341,10 @@ let
341341
then "ArchJavaScript"
342342
else throw "Unknown target arch ${pkgs.stdenv.targetPlatform.config}"
343343
}")'
344-
echo ',("target platform string","${fixPlatformString pkgs.stdenv.targetPlatform.config}")'
345-
echo ',("Build platform","${fixPlatformString pkgs.stdenv.buildPlatform.config}")'
346-
echo ',("Host platform","${fixPlatformString pkgs.stdenv.hostPlatform.config}")'
347-
echo ',("Target platform","${fixPlatformString pkgs.stdenv.targetPlatform.config}")'
344+
echo ',("target platform string","${platformString pkgs.stdenv.targetPlatform}")'
345+
echo ',("Build platform","${platformString pkgs.stdenv.buildPlatform}")'
346+
echo ',("Host platform","${platformString pkgs.stdenv.hostPlatform}")'
347+
echo ',("Target platform","${platformString pkgs.stdenv.targetPlatform}")'
348348
echo ']'
349349
;;
350350
--print-libdir*)

0 commit comments

Comments
 (0)