You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed to build clock-0.8.4.
Build log (
/home/*****/.cabal/logs/ghc-9.10.0.20240413/clock-0.8.4-af09122070b54a220a89abd377b3272fa8d08c9df858d129e2c223a1460da6bd.log
):
Configuring library for clock-0.8.4...
Preprocessing library for clock-0.8.4...
Error: [Cabal-1008]
The program 'hsc2hs' is required but the version of /home/*****/.ghcup/ghc/javascript-unknown-ghcjs-9.10.0.20240413/bin/hsc2hs-ghc-9.10.0.20240413 could no
t be determined.
Error: [Cabal-7125]
Failed to build clock-0.8.4 (which is required by exe:***** from *****). See the build log above for details.
Way to reproduce
Install ghcup and follow User Guide to install GHC JS cross 9.10.0.20240413
Create a cabal project that requires clock.
run cabal build --with-ghc=javascript-unknown-ghcjs-ghc-9.10.0.20240413 --with-ghc-pkg=javascript-unknown-ghcjs-ghc-pkg-9.10.0.20240413
The shell script file ~/.ghcup/ghc/javascript-unknown-ghcjs-9.10.0.20240413/bin/hsc2hs-ghc-9.10.0.20240413 has the wrong executable path.
quick solution for the problem
Adding javascript-unknown-ghcjs prefix to $executablename in ~/.ghcup/ghc/javascript-unknown-ghcjs-9.10.0.20240413/bin/hsc2hs-ghc-9.10.0.20240413 fixes the build issue.
Replace ~/.ghcup/ghc/javascript-unknown-ghcjs-9.10.0.20240413/bin/hsc2hs-ghc-9.10.0.20240413 with the following script.
Note: instead of replacing the script, simply appending --with-hsc2hs=javascript-unknown-ghcjs-hsc2hs-9.10.0.20240413 to cabal build (along with --with-ghc=javascript-unknown-ghcjs-ghc-9.10.0.20240413 --with-ghc-pkg=javascript-unknown-ghcjs-ghc-pkg-9.10.0.20240413) also fixes build.
This is expected. You have to tell cabal exactly what toolchain to use.
That's a bit cumbersome and could be documented.
It would be good if you could tell cabal a prefix it will then prepend to all tools. I thought there is a ticket for it, but I can't find it. Feel free to create one.
What went wrong
Cabal fails clock-0.8.4 build.
Way to reproduce
clock
.cabal build --with-ghc=javascript-unknown-ghcjs-ghc-9.10.0.20240413 --with-ghc-pkg=javascript-unknown-ghcjs-ghc-pkg-9.10.0.20240413
Software versions
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-cross-0.0.8.yaml
)cause of the problem
The shell script file
~/.ghcup/ghc/javascript-unknown-ghcjs-9.10.0.20240413/bin/hsc2hs-ghc-9.10.0.20240413
has the wrong executable path.quick solution for the problem
Adding
javascript-unknown-ghcjs
prefix to$executablename
in~/.ghcup/ghc/javascript-unknown-ghcjs-9.10.0.20240413/bin/hsc2hs-ghc-9.10.0.20240413
fixes the build issue.Replace
~/.ghcup/ghc/javascript-unknown-ghcjs-9.10.0.20240413/bin/hsc2hs-ghc-9.10.0.20240413
with the following script.The text was updated successfully, but these errors were encountered: