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
Describe the bug
I was trying to build a fully static executable to test a few hypothesis, however, I just ran into this bug. Weirdly, I couldn't reproduce it in an actual project. After building with cabal build --enable-executable-static:
(tmp.jzlXN3vozO) ⚑ cabal build --enable-executable-static
Warning: this is a debug build of cabal-install with assertions enabled.
Warning: Parsing the index cache failed (Data.Binary.Get.runGet at position
16: Non-matching structured hashes: f46da61e7afa58a5e8fd1d2b6fb79899;
expected: d81bdd513f41b5d7ee4cd28455adadbe). Trying to regenerate the index
cache...
Resolving dependencies...
Build profile: -w ghc-9.8.1 -O1
In order, the following will be built (use -v for more details):
- tmp-jzlXN3vozO-0.1.0.0 (exe:tmp-jzlXN3vozO) (first run)
Warning: this is a debug build of cabal-install with assertions enabled.
Configuring executable 'tmp-jzlXN3vozO' for tmp-jzlXN3vozO-0.1.0.0...
Warning: this is a debug build of cabal-install with assertions enabled.
Preprocessing executable 'tmp-jzlXN3vozO' for tmp-jzlXN3vozO-0.1.0.0...
Building executable 'tmp-jzlXN3vozO' for tmp-jzlXN3vozO-0.1.0.0...
[1 of 1] Compiling Main ( app/Main.hs, /private/var/folders/tv/35hlch6s3y15hfvndc71l6d40000gn/T/tmp.jzlXN3vozO/dist-newstyle/build/aarch64-osx/ghc-9.8.1/tmp-jzlXN3vozO-0.1.0.0/x/tmp-jzlXN3vozO/build/tmp-jzlXN3vozO/tmp-jzlXN3vozO-tmp/Main.o )
[2 of 2] Linking /private/var/folders/tv/35hlch6s3y15hfvndc71l6d40000gn/T/tmp.jzlXN3vozO/dist-newstyle/build/aarch64-osx/ghc-9.8.1/tmp-jzlXN3vozO-0.1.0.0/x/tmp-jzlXN3vozO/build/tmp-jzlXN3vozO/tmp-jzlXN3vozO
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ghc-9.8.1: `gcc' failed in phase `Linker'. (Exit code: 1)
Error: [Cabal-7125]
Failed to build exe:tmp-jzlXN3vozO from tmp-jzlXN3vozO-0.1.0.0.
To Reproduce
Steps to reproduce the behavior:
cd $(mktemp -d)
cabal init --exe --simple
cabal build --enable-executable-static
Expected behavior
The executable should compile and be fully static (no dynamic libraries).
System information
Operating system: macOS
cabal: HEAD and 3.10, ghc: 9.8
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
I assume "Parsing the index cache failed" is unrelated? I wonder if it fails the same on Linux and I wonder if there are already tests for something similar and if they work (if not, we should add the tests regardless of how this ticket resolves).
-lcrt0.o will never work: the C RTS is an object file, but -l will append .a for a static archive or .dylib (.so on Linux) for a shared object. Where is this coming from?
-lcrt0.o will never work: the C RTS is an object file, but -l will append .a for a static archive or .dylib (.so on Linux) for a shared object. Where is this coming from?
Indeed. I haven't investigated this yet. But it doesn't come from any kind of user-custom option. As I've said in the reproducer section, it is just a clean executable project in a tmp directory.
Describe the bug
I was trying to build a fully static executable to test a few hypothesis, however, I just ran into this bug. Weirdly, I couldn't reproduce it in an actual project. After building with
cabal build --enable-executable-static
:To Reproduce
Steps to reproduce the behavior:
Expected behavior
The executable should compile and be fully static (no dynamic libraries).
System information
cabal
: HEAD and 3.10,ghc
: 9.8Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: