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
{{ message }}
Repository navigation
v2-cabal: Don't rebuild dependencies when -O0 or -fno-code is supplied as --ghc-options #7368
can-workaroundThere is a (maybe partial) workaround for the issue or missing featurere: -fno-codeConcerning type-checking-only buildsre: ghc-optionsConcerning passing options to GHC
It seems that cabal v2-build wants to rebuild all dependencies when I add --ghc-options=-O0 or ...=-fno-code to e.g. just check compilability after a change.
I don't understand the rationale behind this behavior.
Is there a workaround? I'd like to alternate compilation between -fno-code (for just type-checking), -O0 (for running a first few test), and -O1 (for thorough testing with a large testsuite).
edit: actually this should be possible already by specifying the option for every local package, like in #3579 (comment), just a bit tedious. @andreasabel does that work for you?
...
[404 of 404] Compiling Agda.Main ( src/full/Agda/Main.hs, nothing, dist-tc/build/x86_64-osx/ghc-9.2.1/Agda-2.6.3/build/Agda/Main.dyn_o )
ar: dist-tc/build/x86_64-osx/ghc-9.2.1/Agda-2.6.3/build/Agda/Auto/Auto.o: No such file or directory
...
There are 404 errors about missing .o files, but this was already the case in v1-cabal.
can-workaroundThere is a (maybe partial) workaround for the issue or missing featurere: -fno-codeConcerning type-checking-only buildsre: ghc-optionsConcerning passing options to GHC
Activity
phadej commentedon Apr 22, 2021
What's wrong with
cabal build -O0?andreasabel commentedon Apr 29, 2021
Ah, great, this works!
So this means something like
cabal build --no-codewould remain as feature request (#1176).fgaz commentedon Aug 28, 2021
Subsumed by #3579?
edit: actually this should be possible already by specifying the option for every local package, like in #3579 (comment), just a bit tedious. @andreasabel does that work for you?
andreasabel commentedon Sep 14, 2021
Not sure, I how would that look like?
I want something convenient and accessible, ideally as simple as passing the option
-O0tocabal.For comparison, with v1-cabal it is:
Mikolaj commentedon Jan 29, 2022
@andreasabel: any news here?
fgaz commentedon Jan 29, 2022
Like the comment I mentioned ( #3579 (comment) ), so
Not that convenient but it works. If you put that configuration in another
cabal.projectfile you could switch between the two from the command line.Should we close this in favour of #1176 and #3579?
andreasabel commentedon Jan 30, 2022
This does not work, or maybe something is missing. Can you give full instructions?
E.g. I am trying with
cabal.project.tcThis reports, before starting the build:
Further, the
builddir:dist-tcseems to be silently dropped, at least no subfolder nameddist-tcwas created.fgaz commentedon Jan 30, 2022
assuming
my_packageis the name of the package referred as.:fgaz commentedon Jan 30, 2022
This is documented: https://cabal.readthedocs.io/en/3.4/cabal-project.html#cmdoption-builddir
Though I don't know why it can't be specified in
cabal.project. Probably caching reasons. I think there is a ticket somewhere discussing itMaking it give a warning or error would be nice
andreasabel commentedon Jan 30, 2022
Thanks.
(Yet I'd expect a warning that this is not understood, rather silently dropping it.)
But to the original issue: With
and
It does indeed work. Fantastic!
There are 404 errors about missing
.ofiles, but this was already the case inv1-cabal.jneira commentedon May 1, 2022
After #7973
ghc-optionsonly applies to local packages, so change it does not trigger the rebuild of dependencies (remote packages),thanks all!