Comments (11)
Can you elaborate on your use case? It works fine for Cabal.
from cardano-haskell-packages.
Many downstream packagers (including FreeBSD) are prefetching all required sources before the build to allow caching and to be able to disable network access during build. I implemented all the necessary machinery for multi-repository Cabal projects, but it turned out that URL patterns are different. I just wanted to make it easy for me, if it is cheap to implement on your side.
from cardano-haskell-packages.
The only robust way to do that is to get cabal to do it for you, I think. I don't think we want to promise that we will always match the layout of Hackage if that's not a requirement on Cabal package repositories.
from cardano-haskell-packages.
from cardano-haskell-packages.
Interestingly, Stackage URLs also do not have that extra /foo-1.2.3/
part. I wonder if it is because both CHaP and Stackage do not support package revisions, only Hackage does. In this case, I think, nothing should be done on the CHaP side.
from cardano-haskell-packages.
Interesting, thanks for bringing this up @arrowd. I originally based my code on what hackage-repo-tool
does and never really dug into the details once I saw the code working. Looking at the code It turns out both schemes are kind of correct: the long one is a legacy one, the short one is the new. I don't know if there's a fallback between the two.
-- | Generate the URI of the tarball for a given package.
--
packageURI :: RemoteRepo -> PackageId -> URI
packageURI repo pkgid | isOldHackageURI (remoteRepoURI repo) =
(remoteRepoURI repo) {
uriPath = FilePath.Posix.joinPath
[uriPath (remoteRepoURI repo)
,prettyShow (packageName pkgid)
,prettyShow (packageVersion pkgid)
,prettyShow pkgid <.> "tar.gz"]
}
packageURI repo pkgid =
(remoteRepoURI repo) {
uriPath = FilePath.Posix.joinPath
[uriPath (remoteRepoURI repo)
,"package"
,prettyShow pkgid <.> "tar.gz"]
}
from cardano-haskell-packages.
I wonder how revision URLs look like in the new scheme.
from cardano-haskell-packages.
My understanding is that revisions are not fetched by url but are read off the index file (which contains all the cabal files of all the packages).
from cardano-haskell-packages.
Fetching by URL works for Hackage. I suppose the index file contains only the last revision?
from cardano-haskell-packages.
I think I didn't explain myself well.
Hackage exposes a large api hackage.haskell.org/api but to build a project cabal only uses two bits:
- the index file https://hackage.haskell.org/01-index.tar.gz
- the package tarballs https://hackage.haskell.org/package/package-id.tar.gz (as above)
The index file is append-only and contains all the cabal files of all packages and their revisions (plus some other metadata like preferred versions and the hashes of the package tarballs).
The index file alone is enough for cabal to orchestrate a build, but it needs to download the package tarball to actually execute them. In particular cabal never downloads the revisions from the url since they are all already included in the index file (even older revisions).
from cardano-haskell-packages.
I'm closing this with "working as reasonably intended".
from cardano-haskell-packages.
Related Issues (20)
- Patched: ekg-0.4.0.15.0.0.0.0.1 HOT 4
- Patched: libsystemd-journal-1.4.5.0.0.0.0.1 HOT 2
- Add check that latest index state is not in the future
- Steal ideas from the PureScript Registry
- Patched foundation 0.0.29.0.0.0.0.1
- CHaP : Improve error reporing of add-revision script
- Tips on debugging/ inspection when I can't find the right version. HOT 4
- Use crypton from hackage in CI
- protolude-0.3.3.0.0.0.0.1's `repo` field contains a trailing slash HOT 2
- Building haddocks fails in CI for some ledger packages in 8.10 HOT 2
- Reorder checks so that we build packages before doing the index checks
- Patched hjsonpointer-1.5.0.0.0.0.0.1
- Patched hjsonschema-1.10.0.0.0.0.0.1
- Patched dependent-sum-template-0.1.1.1.0.0.0.1
- Test
- 404 for Win32-network-0.1.1.1.tar.gz when building cardano-node HOT 1
- `bech32` 1.1.4.1 has incorrect version bounds HOT 1
- Cabal fetches an old plutus-core version to compile HOT 2
- Can't test a locally built CHaP with a small test project consisting of just a cabal.project file HOT 1
- Static executables for other OS & architectures HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cardano-haskell-packages.