Open chreekat opened 1 year ago
While using the GHC javascript backend, I tried to use Cabal HEAD to build my application. It eventually fails. It says the command that failed is
/home/b/Projects/usort/usort-web/ghc/_build/stage1/bin/javascript-unknown-ghcjs-ghc \ --make -fbuilding-cabal-package -O -static \ -outputdir /home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/usort-web-tmp \ -odir /home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/usort-web-tmp \ -hidir /home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/usort-web-tmp \ -stubdir /home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/usort-web-tmp \ -i -ihs-app \ -i/home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/usort-web-tmp \ -i/home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/autogen \ -i/home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/global-autogen \ -I/home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/autogen \ -I/home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/global-autogen \ -I/home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/usort-web-tmp \ -optP-include \ -optP/home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/autogen/cabal_macros.h \ -this-unit-id usort-web-0.1.0.0-inplace-usort-web \ -hide-all-packages -Wmissing-home-modules -no-user-package-db \ -package-db /home/b/.cabal/store/ghc-9.7.20230421/package.db \ -package-db /home/b/Projects/usort/dist-newstyle/packagedb/ghc-9.7.20230421 \ -package-db /home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/package.conf.inplace \ -package-id base-4.18.0.0-inplace \ -package-id usort-web-0.1.0.0-inplace \ -XHaskell2010 hs-app/Main.hs \ -o /home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/usort-web \ -hide-all-packages
and the failure from that command is
[2 of 2] Linking /home/b/Projects/usort/dist-newstyle/build/javascript-ghcjs/ghc-9.7.20230421/usort-web-0.1.0.0/x/usort-web/build/usort-web/usort-web.jsexe [Objects changed] javascript-unknown-ghcjs-ghc: unknown unit: usort-web-0.1.0.0-inplace-usort-web
I bisected the failure and it started with 94615d6ac6ef585329eab192ed70486e722eeca1 (sorry @mpickering).
This failure can be reproduced with a basic empty Cabal package.
GHC=path/to/stage1/bin/javascript-unknown-ghcjs-ghc
CABAL=path/to/dist-newstyle/build/x86_64-linux/ghc-9.2.7/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal
cabal init -n repro
cd repro
$CABAL -w $GHC --hc-pkg ${GHC}-pkg build
Versions of GHC tried:
It's probably linked to https://gitlab.haskell.org/ghc/ghc/-/issues/23013: the JS linker has its own code paths compared to the native one. It may not work with multiple components yet.
Bug Symptom
While using the GHC javascript backend, I tried to use Cabal HEAD to build my application. It eventually fails. It says the command that failed is
and the failure from that command is
I bisected the failure and it started with 94615d6ac6ef585329eab192ed70486e722eeca1 (sorry @mpickering).
To Reproduce
This failure can be reproduced with a basic empty Cabal package.
GHC=path/to/stage1/bin/javascript-unknown-ghcjs-ghc
CABAL=path/to/dist-newstyle/build/x86_64-linux/ghc-9.2.7/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal
cabal init -n repro
cd repro
$CABAL -w $GHC --hc-pkg ${GHC}-pkg build
Additional context
Versions of GHC tried: