From 867727144e8ebe66dd5fdbac86a783e2f2ec5ed9 Mon Sep 17 00:00:00 2001 From: Slava Gorbunov Date: Tue, 9 Apr 2024 20:21:41 +0300 Subject: [PATCH] pkgsCross.ghcjs.ghc: make EM_CACHE absolute emscripten-3.1.51 fails to compile code (with cache locking problems) if EM_CACHE is relative. --- pkgs/development/compilers/ghc/common-hadrian.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index 465db3a25296..b201379668b1 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -350,10 +350,10 @@ stdenv.mkDerivation ({ '*-android*|*-gnueabi*|*-musleabi*)' done '' - # Need to make writable EM_CACHE for emscripten + # Need to make writable EM_CACHE for emscripten. The path in EM_CACHE must be absolute. # https://gitlab.haskell.org/ghc/ghc/-/wikis/javascript-backend#configure-fails-with-sub-word-sized-atomic-operations-not-available + lib.optionalString targetPlatform.isGhcjs '' - export EM_CACHE="$(mktemp -d emcache.XXXXXXXXXX)" + export EM_CACHE="$(realpath $(mktemp -d emcache.XXXXXXXXXX))" cp -Lr ${targetCC /* == emscripten */}/share/emscripten/cache/* "$EM_CACHE/" chmod u+rwX -R "$EM_CACHE" ''