Closed andreasabel closed 1 month ago
Dynamic linking in Windows is simply not supported by GHC. This is not a Cabal bug unless you wanted to imply that executable-dynamic: True
should crash before even attempting compilation on Windows.
I'm closing this issue, please re-open of you disagree
I do disagree.
This is not a Cabal bug unless you wanted to imply that
executable-dynamic: True
should crash before even attempting compilation on Windows.
I do think it should exit with an error explaining the problem.
Aren't we Haskell programmers? Aren't we proposing strong typing? GHC does not compile ill-typed programs. Cabal should not process ill-formed configurations either.
Perfectly understandable!
Could you change the title or description so that just with a glance it is clear that is what you would like to see implemented?
I think the idea is very useful and might be worth adding a specific mechanism for it so that other configurations that are known unusable are also included (such as using rpath on Windows which I think also fails)
Note this already exists with relocatable builds:
➜ cabal build --enable-relocatable
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
- aa-0.1.0.0 (lib) (configuration changed)
Configuring library for aa-0.1.0.0...
Error: [Cabal-3339]
Operating system: windows, does not support relocatable builds
Error: [Cabal-7125]
Failed to build aa-0.1.0.0. The failure occurred during the configure step.
It should just be a matter of doing a very similar check for shared executables if we are on Windows.
Sounds like a low-hanging fruit then. I'll put the "newcomer" label on it.
Ah actually I did it while waiting for some tests, it was barely a 10 lines change in total
This issue is singled out from:
9784
Adding
executable-dynamic: True
to the cabal configuration on Windows will fail executables to build. This include situations where you just want to build a library, but it hasbuild-tool-depends: alex
or similar causing the linking of build-toolalex
to fail.Reproduced on a fresh Haskell installation: https://github.com/agda/agda/actions/runs/8213506540/job/22465003537#step:10:233