-
Notifications
You must be signed in to change notification settings - Fork 685
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
new-build doesn't honor v1.6 cabal-spec build-dep semantics #4121
Comments
I'm guessing the problem is per-component build. If so, the problem should go away if you either (a) make it a Custom build type, or (2) configure and build the package by hand (using cabal configure/build or Setup configure/build) without per-component configuration. |
@ezyang I can confirm that (a) in fact workarounds this. As this does in fact appear to be a bug in the per-component codepaths, does this mean you know how to fix this? :-) |
My inclination is to disable per-component build if cabal-version is 1.6 or earlier. |
List of packages known to be affected: |
jfyi, I'm testing the following patch locally: --- a/cabal-install/Distribution/Client/ProjectPlanning.hs
+++ b/cabal-install/Distribution/Client/ProjectPlanning.hs
@@ -1140,6 +1140,11 @@ elaborateInstallPlan verbosity platform compiler compilerprogdb pkgConfigDB
-- type, and teach all of the code paths how to handle it.
-- Once you've implemented this, swap it for the code below.
= fromMaybe PD.Custom (PD.buildType (elabPkgDescription elab0)) /= PD.Custom
+ -- cabal-format versions prior to 1.8 have different build-depends semantics
+ -- for now it's easier to just fallback to legacy-mode when specVersion < 1.8
+ -- see, https://github.com/haskell/cabal/issues/4121
+ && PD.specVersion pd >= mkVersion [1,8]
+
{-
-- Only non-Custom or sufficiently recent Custom
-- scripts can be build per-component. note that this changes the hashing since now even single-component cabal packages get demoted to legacy mode (if their spec version is older than 1.8); and there's quite a few VIP packages, such as |
cabal-version semantics prior to 1.8 joined all `build-depends`; as suggested by @ezyang it's easier for now to just fallback to legacy mode, than to add proper support for per-components builds for ancient cabal-spec versions Fixes haskell#4121
In
Distribution.Backpack.ConfiguredComponent
there'sHowever,
operational-0.2.3.4
relies on this semantics and is currently broken undernew-build
:/cc @ezyang
The text was updated successfully, but these errors were encountered: