-
Notifications
You must be signed in to change notification settings - Fork 710
Inplace build profiles, to avoid clobbering old build products when you change some settings #3343
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
Comments
Hmm, and how do we limit bloat of built artefacts? |
GC, I suppose. #3333. Alternately, we can do your plan which you detailed on IRC, which is for there to be a limited set of profiles which get separate build trees. (An added benefit is that their paths would be predictable.) |
Sorry, all you folks who have finger-macroed dist-newstyle/build/pkg-1.0; the format will now be dist-newstyle/build/pkg-1.0-inplace (or perhaps even further mangled.) Although "inplace" is seemingly redundant, it won't be when we build components individually (build/pkg-1.0-inplace-exename) where each component needs a separate dist-directory. If we change our inplace identifiers to be more detailed (see haskell#3343) then it permits inplace builds to handle all situations where package identifiers do not sufficiently disambiguate. Signed-off-by: Edward Z. Yang <[email protected]>
Here are all the things we want to distinguish inplace builds by:
I don't think profiling is necessary as Cabal's build system builds both the non-profiled and profiled versions of code. The trouble with profiles is it's not altogether obvious how the naming should work. Compiler and platform is easy enough: |
Sorry, all you folks who have finger-macroed dist-newstyle/build/pkg-1.0; the format will now be dist-newstyle/build/pkg-1.0-inplace (or perhaps even further mangled.) Although "inplace" is seemingly redundant, it won't be when we build components individually (build/pkg-1.0-inplace-exename) where each component needs a separate dist-directory. If we change our inplace identifiers to be more detailed (see haskell#3343) then it permits inplace builds to handle all situations where package identifiers do not sufficiently disambiguate. Signed-off-by: Edward Z. Yang <[email protected]>
Sorry, all you folks who have finger-macroed dist-newstyle/build/pkg-1.0; the format will now be dist-newstyle/build/pkg-1.0-inplace (or perhaps even further mangled.) Although "inplace" is seemingly redundant, it won't be when we build components individually (build/pkg-1.0-inplace-exename) where each component needs a separate dist-directory. If we change our inplace identifiers to be more detailed (see haskell#3343) then it permits inplace builds to handle all situations where package identifiers do not sufficiently disambiguate. Signed-off-by: Edward Z. Yang <[email protected]>
Sorry, all you folks who have finger-macroed dist-newstyle/build/pkg-1.0; the format will now be dist-newstyle/build/pkg-1.0-inplace (or perhaps even further mangled.) Although "inplace" is seemingly redundant, it won't be when we build components individually (build/pkg-1.0-inplace-exename) where each component needs a separate dist-directory. If we change our inplace identifiers to be more detailed (see haskell#3343) then it permits inplace builds to handle all situations where package identifiers do not sufficiently disambiguate. Signed-off-by: Edward Z. Yang <[email protected]>
Compiler and platform is in HEAD, optimization is PRed. Maybe won't bother with the rest until we get general build profiles. |
Here are a number of situations, all with something in common:
cabal new-build
, and thencabal new-repl --ghc-option=-fobject-code
, the REPL dumping out object code will clobber the originally built code fromnew-build
cabal new-build --disable-optimization
, and then decide you do want to build with optimization, changing the flag is insufficient; you have to blow away the old build products. (And there is no way to maintain the unoptimized and optimized build trees simultaneously)In all of these situations, there is some parameter which Cabal knows about, but then when it comes to the actual build products Cabal stuffs them all in the same directory; thus, when one of these flags changes, Cabal blows away the old build products (without considering the possibility they might be useful for later.)
Here's how I think we should solve this: instead of always assigning inplace packages an inplace package ID, we should compute a Nix-style hash for it. We can symlink the inplace directory to the most recently computed hash for a package. The Nix hash should not be complete (e.g. it shouldn't include any sort of hash of the source code); it should just track parameters which (1) the user is likely to want to build their project with under both permutations, and (2) would require most of the package to be rebuilt.
The text was updated successfully, but these errors were encountered: