-
Notifications
You must be signed in to change notification settings - Fork 720
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
Switch to Cardano haskell package repository #4411
Conversation
-- Disable all tests by default | ||
|
||
tests: False | ||
tests: True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? The documentation seems to suggest it is not useful:
Force test suites to be enabled. For most users this should not be needed, as we always attempt to solve for test suite dependencies, even when this value is False; furthermore, test suites are automatically enabled if they are requested as a built target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think in the past it used to be necessary so cabal wouldn't re-solve for tests when you switched to running tests, perhaps they fixed that. But that's an orthogonal issue I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, before you had to do tests: False
and enabled them one by one for the local packages. This is now solved (which is why I left tests: True
which was the original intent). Now I wonder if one needs to enable them at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was talking about "do we need tests: True
at all". I don't know (we have it for plutus!).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using source-repository-package
the directive tests: True
turns on tests within all source-repository-package
dependencies, which (especially higher up the stack) just needless runs tests in dependencies for which it should be possible to avoid re-rumning tests.
In say db-sync
we have tests: False
to disable all tests and the specific stanzas to turn on tests for packages in the db-sync
repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using source-repository-package the directive tests: True turns on tests within all source-repository-package dependencies, which (especially higher up the stack) just needless runs tests in dependencies for which it should be possible to avoid re-rumning tests.
Is this still true in recent versions of cabal? We have tests: True
in plutus
and I've never observed it running or building tests for s-r-ps, and I tried again just now.
@kosyrevSerge there is some code in the workbench scripts that scrapes the
We think that can just be replaced by using |
From the sound of this "Internal Hackage repository" its internal and not accessible by people outside IOG. If that is the case, then how are people outside IOG supposed to build our software? |
Even if it is publicly available, we need to look at at how much more difficult (if at all) the new way of accessing packages is in comparison to the old method. |
It's not. It's publicly accessible. There should be no difference for anyone building our software, this is all understood perfectly well by cabal. The most you need to do is call Let's try and avoid the "internal" descriptor. I've been trying to call it just the "Cardano Haskell package repository", which is a bit of a mouthful but hopefully not misleading. |
In bf585f5 I have temporarily disabled parts of the workbench scripts. The script extracted the commit has of some cardano components from the |
We could call it |
Another option is to just drop the "repository": Cardano Haskell Packages. "Repository" is a confusing word here because it has two meaning (as in Hacakge and in git). |
Note to self, I made some cabal file revisions on the repository that end up breaking the build plan for cardano-node 😞 Do not bump the index-state until I fix the issue. 🙏 |
We run into a bit of a roadblock with haskell.nix not liking cabal file revisions. As an emergency measure we removed them from the repository, so we can unblock this PR. |
Good haskell.nix. Allowing released code to be revised was never a good idea also IMO. |
cabal file revisions don't change the code, only the metadata about it so we know what version works with what other version. We can do it in a completely declarative and reproducible way so this should not be a problem. |
See this repo for an example downstream consumer. It should work with just |
grep "^[ ]*location: .*/${dep}\$" "${project_file}" -A1 \ | ||
| tail -n-1 | sed 's/^.* tag: //' | ||
# FIXME | ||
echo 0123456789ABCDEF0123456789ABCDEF01234567 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Knowing exact gitrevs for key dependencies is useful, since it simplifies discussions around reproduction.
Can we make the cardanoHaskellPackages
(and I specifically mean the Nix flake) supply the gitrevs for all constituent packages it provides?
Then we could plug in this information here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I maybe missing some context but if you depend on versions, is not even better? The versions are not supposed to be mutable either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be more appropriate to use the package versions? That should be enough for reproducibility, right? I think @andreabedini had a way to do that with just ghc-pkg
, so that should be straightforward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, this is going to be at git revision granularity -- since we don't always work with released versions of packages.
Think feature branch development, for example.
So, having gitrevs uniformly available would be a consistent approach.
Having versions in addition -- would be nice as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to update this part but I couldn't really do it without understanding its intended use. I don't think there's a way to push the gitrevs through the index. I suggest we stick to versions. @deepfire, just to make ure I understand, what are gitrevs useful for? looking/finding the right source used? We are thinking of adding html pages for the index, they could include a link to the corresponding source (maybe).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never said versions are bad to have!
Only suggesting that losing the gitrevs is unfortunate, because gitrevs are precise and not subject to human errors and other deviations.
Having a cabal version, on the other hand, does not guarantee you a gitrev.
Why a gitrev is important? Automation.
For example, a valid gitrev means a github URL. You can also mindlessly punch in a gitrev into arbitrary git commands -- without having any second thoughts.
Yes, all good projects should have tags with names exactly matching versions at precisely the right revisions.
But the key point is -- should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deepfire while it is true that hackage.haskell.org packages do not have revisions, due to the design of hackage allowing arbitrary source management, and a such just release tarball uploads, cardano-haskell-packages
does have revisions. So at least for cardano-haskell-packages
you can go from version number to git revision e.g. measures-0.1.0.0;
@andreabedini maybe we should ensure that people don't put tags as revisions in the url, as those may change over time (or resolve them at the point of index constructions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@angerman At the moment we are pointing to arbitrary tarballs, when I implement a proprer github backend I can do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreabedini, in the interim it'd be nice to have cardanoHaskellPackages
provide at least the versions in some kind of a package-name -> version string
attrset.
..so we'd be able to wire this information to this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deepfire 👍 I am working toward this direction
Thank you @michaelpj @andreabedini ! |
location: https://github.com/input-output-hk/flat | ||
tag: ee59880f47ab835dbd73bea0847dab7869fc20d8 | ||
--sha256: 1lrzknw765pz2j97nvv9ip3l1mcpf2zr4n56hwlz0rk7wq7ls4cm | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
51c5e67
to
737e10d
Compare
I think this is ready to go. I added a note about using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally for this but I will take a closer look after the cli release
@michaelpj I suggest a stronger wording (and a clear policy)
What do you think? |
I'm not sure if that's realistic. Maybe if we just release a patched version of |
🤞 |
@Jimbo4350 if the release is going ahead off the branch, can we move forward with this on master? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments. @andreabedini can you squash/tidy up the commits?
- Remove all source-repository-package stanzas (package repository has been pre-populated with the exact same versions) - Remove cabal work-around disabling tests for packages erroneously considered local. Cabal now does the right thing - Remove cabalWrapped, as now unnecessary
9b78ec6
to
814b6d8
Compare
The GHA actions checks are segfaulting, but they're also segfaulting on master, so I don't think it's this PR's fault. |
This reflects the policy that we have to follow now that the node is [using CHaP](IntersectMBO/cardano-node#4411). It also lays out a draft of a policy for when it can be appropriate to release to Hackage, and when it is appropriate to use `source-repository-package`s.
This reflects the policy that we have to follow now that the node is [using CHaP](IntersectMBO/cardano-node#4411). It also lays out a draft of a policy for when it can be appropriate to release to Hackage, and when it is appropriate to use `source-repository-package`s. Fixes #13.
This reflects the policy that we have to follow now that the node is [using CHaP](IntersectMBO/cardano-node#4411). It also lays out a draft of a policy for when it can be appropriate to release to Hackage, and when it is appropriate to use `source-repository-package`s. Fixes #13.
This reflects the policy that packages have to follow now that the node is [using CHaP](IntersectMBO/cardano-node#4411). It also lays out a draft of a policy for when it can be appropriate to release to Hackage, and when it is appropriate to use `source-repository-package`s. Fixes #13.
This reflects the policy that packages have to follow now that the node is [using CHaP](IntersectMBO/cardano-node#4411). It also lays out a draft of a policy for when it can be appropriate to release to Hackage, and when it is appropriate to use `source-repository-package`s. Fixes #13.
@Jimbo4350 squashed and hydra passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
bors r+ |
Build succeeded: |
@michaelpj and I have been working to establish an
internalcustom haskell package repository. This simplifes cabal's configuration and improves DX.The "repository" is a static website that implements the same paths as hackage-server and it is hosted on GitHub. The repository is built from a static description of its content, with the idea that teams will be able to publish a package with a simple PR, see the repository's README for details.
This patch:
been pre-populated with the exact same versions)
considered local. Cabal now does the right thing