-
Notifications
You must be signed in to change notification settings - Fork 259
Open
Labels
Description
Describe the bug
When cross-compiling to JS a hackage dependency which involves actual template haskell splicing and not just declaration of template haskell functions you get an error:
JS interpreter: couldn't find "ghci" package
Obvious solution does not fix it:
if arch(javascript)
extra-packages: ghci
- Build system:
x86_64-linux - GHC version: 9.12.2
- Haskell.nix version (or commit) used: e567ebc (tag: 2025.08.03)
Steps To Reproduce
- Add
th-orphanstobuild-dependsof https://github.com/input-output-hk/haskell.nix/blob/master/test/js-template-haskell/js-template-haskell.cabal - Run the build:
nix-build -A allJobs.x86_64-linux.unstable.ghc9122.ghcjs.tests.js-template-haskell.build
Expected behavior
Successful compilation.
Additional context
- This is a regression, as last I tried using
extra-packages: ghcion ghc910 it solved the problem. Now it doesn't. I assume this PR might be related to this Fix cabal install in the presence of extra-packages (backport #9719) haskell/cabal#9875. - My second assumption was that it maybe somehow related to this Fix
-inplaceissue with ghc 9.8.1 boot packages #2161. I.e. whenghctries to pickghci, while it should have pickedghci-inplace. Honestly doubt that's the case, but still leaving it here for the full picture.
Hotfix:
modules = [
({ config, ... }: {
configureFlags = [ "--package-db ${config.ghc.package.outPath}/${config.ghc.package.libDir}/package.conf.d" ];
})
];
This places all installed ghc libraries, ghci in particular, in scope of all packages. Might be an overkill, but at least it works.
cumber