Open 9999years opened 1 week ago
Some notes from my investigation:
The error happens before Cabal resolves cli arguments etc. into actual build targets; it's just trying to resolve all the local packages, regardless of if they're involved in your build or not.
Implementation strategy:
Propagate provenance (ProjectConfigPath
/ConstraintSource
) into project config types (Distribution.Client.ProjectConfig
, D.C.ProjectConfig.Legacy
)
Extract and attach that information in D.C.ProjectConfig.findProjectPackages
Attach that information to ProjectPackageLocation
(returned from findProjectPackages
). Note: Might be worth unifying that with PackageLocation
, would make the new type PackageLocationProvenance
.
Use that information to write better ConstraintSource
s into the solver; this is mostly implemented.
Overall it seems like all the information exists, but it takes a lot of work to propagate it into the right parts of the system. Expect a ~hundreds of lines diff.
I can reproduce this on ubuntu linux. The error message is not very helpful but the title of this issue "source-repository-package versions show up as user target" is.
I can get warp-quic
built by adding allow-older
to the project but this may not be a good build because of the version constraint exceptions.
$ cabal build warp-quic --dry-run
Resolving dependencies...
Build profile: -w ghc-9.10.1 -O1
In order, the following would be built (use -v for more details):
- auto-update-0.2.2 (lib) (first run)
- basement-0.0.14 (lib) (requires build)
- cereal-0.5.8.3 (lib) (requires build)
- half-0.3.1 (lib) (requires build)
- http-types-0.12.4 (lib) (requires build)
- iproute-1.7.15 (lib) (requires download & build)
- psqueues-0.2.8.0 (lib) (requires build)
- recv-0.1.0 (lib) (first run)
- simple-sendfile-0.2.32 (lib) (requires build)
- sockaddr-0.0.1 (lib) (requires download & build)
- streaming-commons-0.2.2.6 (lib) (requires build)
- unix-compat-0.7.3 (lib) (requires download & build)
- unix-time-0.4.16 (lib:unix-time) (requires download & build)
- unliftio-0.2.25.0 (lib) (requires build)
- vault-0.3.1.5 (lib) (requires build)
- memory-0.17.0 (lib) (requires build)
- cborg-0.2.10.0 (lib) (requires build)
- network-control-0.1.3 (lib) (requires build)
- fast-logger-3.2.5 (lib) (requires download & build)
- time-manager-0.1.0 (lib) (first run)
- wai-3.2.4 (lib) (first run)
- pem-0.2.4 (lib) (requires build)
- crypton-1.0.1 (lib) (requires download & build)
- asn1-types-0.3.4 (lib:asn1-types) (requires build)
- serialise-0.2.6.1 (lib) (requires build)
- http-semantics-0.2.1 (lib) (requires build)
- crypto-token-0.1.2 (lib) (requires download & build)
- asn1-encoding-0.9.6 (lib) (requires build)
- http2-5.3.4 (lib) (requires build)
- asn1-parse-0.9.5 (lib:asn1-parse) (requires build)
- crypton-x509-1.7.7 (lib) (requires build)
- warp-3.4.3 (lib) (first run)
- crypton-x509-store-1.6.9 (lib) (requires build)
- crypton-x509-validation-1.6.12 (lib) (requires build)
- crypton-x509-system-1.6.7 (lib) (requires build)
- tls-2.1.3 (lib) (requires download & build)
- quic-0.2.3 (lib) (requires download & build)
- http3-0.0.18 (lib) (requires download & build)
- warp-quic-0.0.1 (lib) (first run)
$ git diff
diff --git a/cabal.project b/cabal.project
index d04fec5a..c3069acf 100644
--- a/cabal.project
+++ b/cabal.project
@@ -48,6 +48,10 @@ allow-newer:
, hsc2hs:base
, cabal-doctest:base
+allow-older:
+ , *:memory
+ , *:basement
+
-- https://github.com/haskell-foundation/foundation/pull/564
source-repository-package
type: git
Describe the bug
When I do
cabal build
, a dependency solver error message says:But when I look in the project, no constraint for
memory
mentions==0.17.0
.To Reproduce
In https://github.com/yesodweb/wai/commit/b6bc2b6c5ab93a1fb629aaa70477ebf7f4959f1b:
Expected behavior
Cabal should say something like:
System information
Operating system: macOS 15.1 (24B83)
Additional context
Related: #9562