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 run & install broken #7325
Comments
Cannot reproduce. Could you attach / link to a minimal project that reproduces this?
What is the build-type? That's a limitation of the Custom build-type iirc |
will attach a MWE asap |
Hi I created a MWE project: https://github.com/adityagupta1089/cabal-test
Also I get this weird warning while running/building, etc.
|
The warning is #5119 |
@fgaz any idea about the other bugs? any workarounds? |
Still cannot reproduce. I see the ghc options in the output of all three commands when running with -v3. I see you're on arch, perhaps something in your ~/.cabal/config is interfering? |
Ah wait, maybe you're referring to the "Build profile: -w ghc-8.8.4 -O1" output? The meaning of that is that optimizations are set at 1 at the project level, but you're still overriding to 2 at the component (executable) level. It agree it's a bit confusing (#6221) |
@fgaz Thanks. Seems like then the problem with flags is spurious. Only difficulty I am facing are then:
So I'm currently using a makefile to glob the executable source files (Problem{1,2,3} in the MWE) and build using Can you give some advice how to structure or which build-tools to use for my project? |
weird, I thought that was fixed. I'll have to check.
Common stanzas should make this less verbose, but you still have to at least enumerate the executables. Obtaining a list of exes from the file system will not be possible (cabal files are required to be self-contained in that sense). So generating the file looks like the best solution.
There are some ways to do that with cabal too. Either:
|
@fgaz Thanks for the suggestions, I ran into cabal hell so using stack exec ghc for now with a makefile to build binaries. Also |
Describe the bug
I have a project with 1 library + multiple executables. I have defined ghc-options in .cabal file such as -O2 and -fllvm. These are not being picked up by
cabal run --enable-profiling
orcabal install
, but those are being picked up when I do justcabal run
orcabal build
. I checked this using-v3
flag. Also it is building all the executables even though I specififed usingcabal install exe:<executable1>
To Reproduce
Steps to reproduce the behavior: mentioned above
Please use version-prefixed commands (e.g.
v2-build
orv1-build
) to avoid ambiguity.Expected behavior
mentioned above
System information
cabal
,ghc
versions: 3.4, 8.10.4Additional context
NA
The text was updated successfully, but these errors were encountered: