-
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
Using cabal install in a project or install/repl without a project, duplicates global config and rebuilds libs twice in the store #6906
Comments
|
Table summarizing the situation:
"run" "outside" means, e.g.,
|
I have a hunch why this happens, I have yet no idea how hard this is to fix. It might be related to how we build Relatedly, with |
Citing from #7745: "This seems like a very juicy and (let's hope) relatively low hanging fruit. Even just time saved diagnosing offshoots of this problems again and again is significant and could be used elsewhere." |
@phadej suggestion was
Fixing #6977 (remove the need for fake-package) seems to be a deep change: what about fix duplicate entries just in the input info used to compute the package hash and avoid rebuilds without waiting for the proper fix? I mean, a quick and dirty In the meanwhile a possible workaround (i have to check it) to avoid rebuilds could be:
|
i checked out that config in cabal.project does not trigger a rebuild
i am afraid that woud not work in the general case due to #2997 (cli options are only applied to local packages and no to dependencies) @mouse07410 that workaround would be too cumbersome for your workflow? |
Why those fields: cabal/cabal-install/src/Distribution/Client/ProjectConfig/Types.hs Lines 260 to 263 in c66a126
are not Added in 92f018c by @dcoutts 5 years sgo 😅 I guess is hard to discern filepath equality without knowing for sure they are not fully normalized in a os independent way, but that did not hold for |
Well i guess it was known at that moment that But even remove duplicate entries on pure String equality seems to be an improvement, no? |
If you mean - move the BTW, is this problem of rebuilding twice and installing the same package twice with two hashes (#6906) in any way related with the failure of |
Well, to every package needing them for real, in my case I dont have many projects using c libraries f.e.
hmm I would say it is not related at all but I did not investigate that bug |
One reason for those extra dirs is Macports-installed OpenSSL, because MacOS comes with LibReSSL that one cannot link applications against. I may have an idea which of my projects may need OpenSSL (much less so wrt. dependencies pulled from Hackage) - but it's pain in the neck to track. Majority of what I'm doing involves some form of crypto, and crypto software. So, likely to be hit here. Another reason - |
well I have a theory, the order of include ( It seems gcc scans the option from left to right so removing from the end of the list should not change the behaviour. If all possible c compilers follow that convention maybe we could do that, but are we sure about that? https://stackoverflow.com/questions/41437648/specifying-order-in-gcc-and-g-include-and-lib-paths |
That's a sick theory, but sadly it's possible. Which C compilers are possible for us? GCC for sure. Anything else? What's used with LLVM? We use GCC only for linking or also for something else? |
MacOS must use Clang (and that's what comes with Xcode - Apple-provided compiler and IDE), which is LLVM-based (aka, used with LLVM). |
The correct thing to do is to not load cabal.config multiple times. I'm sure there's going to be a straightforward way to do so, with some care. |
…#7759) * Debug package hash inputs * Add test skeleton for #6906 * Improve output of hash inputs * Add tests over pks hash inputs * Correct typos and formatting * Add missing do * Add missing cabal result arg * Make consistent log about hash.txt * Update log msg creating file * Change var name to hashFileName
To Reproduce
Make sure the global Cabal config has something that can be duplicated, for example
ghc-options
orextra-include-dirs
. Then:The
mmorph
package is built twice and the store now contains twommorph
directories.cabal-hash.txt
of the first one:cabal-hash.txt
of the second one:Same thing happens with
cabal v2-repl --build-depends tardis
.Expected behavior
The
mmorph
package should be built just once and itscabal-hash.txt
should contain just:System information
The text was updated successfully, but these errors were encountered: