Closed andreabedini closed 2 years ago
-- this is the new bit
import: https://www.stackage.org/lts-19.10/cabal.config
This doesn't need to affect this PR, but I have a couple of questions on the import feature:
Great questions.
Are the imports cached locally?
Yes, they are. cabal as a general caching strategy built into the http transport, which uses the if-modified-since header and etags (refrence). The file is stored on disk in the dist-newstyle
directory.
❯ cabal build --dry-run -v
Project settings changed, reconfiguring...
creating /home/andrea/tmp/dist-newstyle/cache
Running: /usr/bin/curl 'https://www.stackage.org/lts-19.10/cabal.config' --output '/home/andrea/tmp/dist-newstyle/src/https:__www.stackage.org_lts-19.10_cabal24187-0.config' --location --write-out '%{http_code}' --user-agent 'cabal-install/3.8.0.20220526 (linux; x86_64)' --silent --show-error --dump-header /home/andrea/tmp/dist-newstyle/src/curl-headers24187-1.txt
Downloaded to
/home/andrea/tmp/dist-newstyle/src/https:__www.stackage.org_lts-19.10_cabal.config
creating /home/andrea/tmp/dist-newstyle
creating /home/andrea/tmp/dist-newstyle/cache
this build was affected by the following (project) config files:
- /home/andrea/tmp/cabal.project
- https://www.stackage.org/lts-19.10/cabal.config
Up to date
Since these configs are mutable, can I specify a checksum?
Not at the moment but this sounds like a feature worth opening an issue about. I'll do that some time today.
On a slight tangent the message Please append these contents to the end of your global cabal config file. To only use tested packages, uncomment the following line and comment out other remote-repo lines
might need some love because cabal doesn't seem to accept that remote-repo
option anymore. I'd be happy to sort it out but I am not sure of the intention behind the message.
This is now deployed live.
@snoyberg thank you for the quick turnaround! @bergmark https://github.com/haskell/cabal/issues/8204
This patch adds the specification of what compiler to use for a snapshot using cabal's "with-compiler" option.
Context
cabal-install 3.8 has gained the ability of using remote imports in cabal project files (https://cabal.readthedocs.io/en/latest/cabal-project.html#conditionals-and-imports). This was done as a first attempt to support using stackage snapshots directly with cabal (see https://github.com/haskell/cabal/issues/7556 for a discussion of the problem).
In short, one can create a
cabal.project
file as followsand cabal use the package versions specified by lts-19.10. To reproduce the stackage snapshot (modulo revisions, see note below), one has to use the same compiler as the snapshot, therefore I believe it's important to add the
with-compiler
flag above.This PR adds the
with-compiler
line to thecabal.config
files as generated by stackage-server. Shortening the boilerplate down to:Notes
cabal.config
and feed it to cabal ascabal.project.freeze
for a long time. What's next is just the convenience of pointing directly to stackage.cabal.config
fixes the package versions but not the package cabal file revisions. I am aware of the difference and this PR does not improve on that regard.cabal.config
file. I haven't implemented this yet.