Cabal doesn't seem to call the correct hsc2hs when cross-compiling
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
When trying to build `cabal-install` with the following:
```
cabal new-build --with-ghc arm-linux-gnueabihf-ghc --with-ghc-pkg arm-linux-gnueabihf-ghc-pkg --with-hsc2hs=hsc2hs
```
I end up with
```
Build profile: -w ghc-8.6.2 -O1
In order, the following will be built (use -v for more details):
- hackage-security-0.5.3.0 (lib) (requires build)
- zip-archive-0.3.3 (lib:zip-archive) (requires build)
- cabal-install-2.4.1.0 (exe:cabal) (first run)
Starting zip-archive-0.3.3 (all, legacy fallback)
Starting hackage-security-0.5.3.0 (lib)
Failed to build hackage-security-0.5.3.0. The failure occurred during the
configure step.
Build log (
/home/vanessa/.cabal/logs/ghc-8.6.2/hackage-security-0.5.3.0-49090b92e0c750f4f930f2057bed30927690037cb7d641f2fc7635fb9e5d0d07.log
):
Configuring library for hackage-security-0.5.3.0..
cabal: The program 'hsc2hs' version >=0.67 && <0.69 is required but the
version of
/home/vanessa/.cabal/store/ghc-8.6.2/hsc2hs-0.68.4-23e7a5612c9d790260d1fbf5570d20d2b91321b3d84ff9e3ff4190c9bc8332b0/bin/hsc2hs
could not be determined.
cabal: Failed to build hackage-security-0.5.3.0 (which is required by
cabal-install-2.4.1.0). See the build log above for details.
Failed to build zip-archive-0.3.3 (which is required by
cabal-install-2.4.1.0). The failure occurred during the configure step. The
build process terminated with exit code 2
```
I believe this may be due to the fact that `hackage-security` actually specifies a dependency on `hsc2hs`. `zlib`, `digest`, and `network` all build fine and their `.cabal` files don't seem to mention any `build-tool-depends` anywhere.
Here is the call stack:
```
CallStack (from HasCallStack):
die', called at ./Distribution/Simple/Program/Db.hs:484:18 in Cabal-2.4.1.0-2mL6d3JeEJ7DKvehaV04FE:Distribution.Simple.Program.Db
requireProgramVersion, called at ./Distribution/Simple/Configure.hs:1493:30 in Cabal-2.4.1.0-2mL6d3JeEJ7DKvehaV04FE:Distribution.Simple.Configure
configureRequiredProgram, called at ./Distribution/Simple/Configure.hs:1434:10 in Cabal-2.4.1.0-2mL6d3JeEJ7DKvehaV04FE:Distribution.Simple.Configure
configureRequiredPrograms, called at ./Distribution/Simple/Configure.hs:578:11 in Cabal-2.4.1.0-2mL6d3JeEJ7DKvehaV04FE:Distribution.Simple.Configure
configure, called at ./Distribution/Simple.hs:596:20 in Cabal-2.4.1.0-2mL6d3JeEJ7DKvehaV04FE:Distribution.Simple
confHook, called at ./Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.1.0-2mL6d3JeEJ7DKvehaV04FE:Distribution.Simple.UserHooks
configureAction, called at ./Distribution/Simple.hs:178:19 in Cabal-2.4.1.0-2mL6d3JeEJ7DKvehaV04FE:Distribution.Simple
defaultMainHelper, called at ./Distribution/Simple.hs:120:19 in Cabal-2.4.1.0-2mL6d3JeEJ7DKvehaV04FE:Distribution.Simple
defaultMainArgs, called at main/Main.hs:1238:18 in main:Main
```
Contributor guide
Assessment
This issue has not been assessed yet.