-
Notifications
You must be signed in to change notification settings - Fork 701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cabal v2-build
fails to override global config with --enable-static --disable-shared
#6688
Comments
I noted the same behaviour with various libraries using a
Note that Versions: GHC 8.10.1 and Blocking agda/agda#4796. |
Related to #7236. |
cabal v2-build
fails to overwrite global config with --enable-static
@mouse07410 do we know if global config is overridden by cabal |
in fact I am tempted to close this in favour the more general #7236, do you agree @mouse07410 ? |
cabal v2-build
fails to overwrite global config with --enable-static
cabal v2-build
fails to overridee global config with --enable-static --disable-shared
cabal v2-build
fails to overridee global config with --enable-static --disable-shared
cabal v2-build
fails to override global config with --enable-static --disable-shared
I've no idea, and don't fully understand the question. It appears that the global config settings take precedence over the CLI switches passed to Cabal invocation - which is the problem this issue points at.
Decision is yours - but I don't think #7236 is more general, on the contrary: #7236 is about failure to strip the built executable when the build is static. This issue is about failing to build static regardless of the CLI flags, when the global config says otherwise. |
I wanted to mean if you add to your cabal project:
or
do they override the global cabal config?
yeah i misunderstood the linked issue, sorry |
Honestly, I haven't tried that (yet? ;) ). But the goal was to make something like Also, it is unclear whether this problem extends to |
well so a workaround could be to have dynamic in the global config and set static for the few exceptions in their cabal.project(.local), you exchange write or update a config file for avoid the flag in each invocation but a workaround, the cli flag should override any previous config for sure |
Alas, no. Same result - it still links dynamically after putting
BTW, this is with Cabal-3.6.2.0, and GHC-9.0.2. |
ugh, not sure if i will have time but i would like to reproduce in linux with |
Explain please. First, I might be able to reproduce it in Linux, as I have a couple of Linux VMs. Second - what do you mean by |
sorry didn't want to bother you with more testing so I was thinking in reproduce the error setting the |
Here's the output of Then I started experimenting with adding stuff to
As you see, the above executable is static "enough" - as static as you can expect on MacOS, because system libraries are dynamic only. Finally, I tried adding
Not even sure what this all means. It appears that to statically link an executable, the only CLI flag I need is
Size difference (for this extremely trivial app):
P.S. Did not even need to get to Linux. ;-) |
Describe the bug
Cabal ignores
--enable-static --disable-shared
given in the command line, and follows the settings in~/.cabal/config
.To Reproduce
Steps to reproduce the behavior:
Set the values in the
~/.cabal/config
for shared libraries and dynamic executablesHere's the
~/.cabal/config
I use: cabal-config.txtExpected behavior
Executable linked with static Haskell libraries.
System information
cabal-3.2.0.0
,ghc
8.8.3, 8.6.5.Additional context
Here's my small test-project https://github.com/mouse07410/Str2Split.git
Attempts to build anything (demonstrating on this fairly simple reproducer project) with
--enable-executable-static
fails with:With
--enable-executable-static --disable-executable-dynamic
fail because of the OS constraints.The text was updated successfully, but these errors were encountered: