-
Notifications
You must be signed in to change notification settings - Fork 697
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 git invocation changes the behaviour of source-repository-package #10605
Comments
Indeed, this was unfortunately not caught by the testsuite. @9999years is fixing this in #10586 |
Excellent! |
@Kleidukos Thank you, this is a useful test case! |
@Kleidukos, I'm seeing this with https://github.com/Kleidukos/print-api too, and #10259, the API checking, relies on having that tool installed. @geekosaur I was looking to maybe have the makefile also install |
My bisect points at #10254 introducing the problem. Output comparisonBefore #10254, Cabal ran:
After, Cabal ran:
I think what's happening here is:
According to
Abbreviated refs are not allowed. I have a couple thoughts on this:
|
I'll note that my PR #10586 doesn't fix this because it doesn't change the underlying |
I too am partial to forbidding abbreviated commit hashes, but I'd like this to undergo a proper deprecation cycle. If abbreviated hashes are too coupled to shallow clones, then let's revert the shallow cloning bits, and broadcast that in 3 major releases, we'll deprecate the use of abbreviated commit hashes in order to pull more efficiently from git sources. |
I was surprised we actually allowed abbreviated hashes in the first place, because as mentioned previously they aren't necessarily unique. Our own repo is up to requiring 9 digits to be unique, per |
I am once again wishing for something like Rust's crater to let us attempt to build/test everything on Hackage with |
I haven't checked, but it might be non-trivial to revert #10254 because of the work I've been doing to improve the Git support since then. We could attempt a roll-forward fix (reimplementing the non-shallow logic without reverting the specific commit), which is a little riskier but lets us keep the other improvements. What do you think? |
I think #10254 fixed an important performance bug, it took a very long time to clone big git repos before this change, so please at least leave the option of good performance if there is some kind of revert. 3 releases seems like a very slow timeline to migrate, I think if there is a deprecation period it should be at most one release cycle. I do appreciate that things randomly breaking is annoying.
@9999years You can use head.hackage infrastructure to test building packages with cabal-head. That is what we did here when migrating packages to use the |
During yesterday's meeting we agreed to proceed forward with a fix that lets us keep the parallel cloning, and avoid the headache of reverting. |
Your input is heard, but three releases is the perfect amount of time to let projects who are not actively following the development of cabal to migrate without trouble. A huge criticism of the Haskell ecosystem is that it's hard to come to a project a year later with an updated toolchain, because so many things have to be changed. We have a draft process for deprecation (https://github.com/haskell/cabal/wiki/Deprecation-Process). That being said, nothing prevents us to release experimental features behind options in the config file. This would allow us to release new features that provoke breaking changes in a way that is opt-in. @ffaf1 is studying how other ecosystems to do such a thing and will submit a draft proposal. |
I'm with @mpickering on this. I sufferred long waits cloning https://github.com/brendanhay/amazonka. As for abbreviated hashes, why would you do that? Copying the whole hash is easier anyway, isn't it? Tip The navigation on GitHub at least makes it very easy to copy the last segment of the URL with the hash. They also provide a button to copy the whole hash when looking at the history.
|
@philderbeast As said above, the consensus is not to revert the parallel cloning but to fix the handling of hashes instead #10605 (comment) To answer your question:
Because we allow it. |
To put numbers on the wait time for cloning amazonka, 78s versus 15s. This is a great improvement ❤️. $ git diff
diff --git a/cabal.project b/cabal.project
index e368c280c..0973733ce 100644
--- a/cabal.project
+++ b/cabal.project
@@ -4,3 +4,11 @@ import: project-cabal/pkgs.config
import: project-cabal/constraints.config
tests: True
+
+source-repository-package
+ type: git
+ location: [email protected]:brendanhay/amazonka.git
+ tag: 30b200d487bccd2568de1257a812a464270d0096
+ subdir:
+ lib/amazonka-core
+ lib/services/amazonka-s3
|
@philderbeast fully agree with you, this is a very good thing. |
I thought the issue here was with shallow clones, not parallelism. Did I misunderstand? |
The same PR addresses both issues, which is part of why reverting it isn't a good idea. In retrospect, it should probably have been split. |
Yes sorry, without context it's of course confusing. Hence why proceeding forward with a fix without having to revert the whole thing looks preferable. |
You can use https://github.com/haskell/clc-stackage |
I'll note also that "everything on Hackage" includes a lot of ancient stuff which won't build with modern (or even recentish) ghc. |
Two important differences between crater and the proposed approaches:
Here's a recent report from crater: https://crater-reports.s3.amazonaws.com/beta-1.74-1/index.html Note a few things about the output:
|
Fixes haskell#10605 Includes a regression test.
Fixes haskell#10605 Includes a regression test.
Fixes haskell#10605 Includes a regression test.
FWIW, the two changes are done cleanly in two separate commits, even if they were merged in the same PR. I don't think we should give up on shallow clones altogether. Why not simply:
This allows us to fix the regression without pessimising cloning for the majority using full hashes? |
When the `tag` of a `source-repository-stanza` is not a full hash, we cannot do a shallow clone and fetch it separately. Therefore, in those cases, we fall back to doing a full clone. Fixes haskell#10605 Includes a regression test by @9999years. Co-authored-by: Rebecca Turner <[email protected]>
When the `tag` of a `source-repository-stanza` is not a full hash, we cannot do a shallow clone and fetch it separately. Therefore, in those cases, we fall back to doing a full clone. Fixes haskell#10605 Includes a regression test by @9999years. Co-authored-by: Rebecca Turner <[email protected]>
When the `tag` of a `source-repository-stanza` is not a full hash, we cannot do a shallow clone and fetch it separately. Therefore, in those cases, we fall back to doing a full clone. Fixes haskell#10605 Includes a regression test by @9999years. Co-authored-by: Rebecca Turner <[email protected]>
Not everyone upgrades to every release. A single release with a deprecation does not give any warning for those users who might jump a few versions. This kind of things suddenly don't work is worse than annoying for some users, it drives them out of the ecosystem entirely. |
I'm a full hash guy myself and would be very happy to have the 5x speed improvement. |
And the advertised speed improvements will certainly motivate people to migrate to full hashes! :) |
Building https://github.com/Kleidukos/get-tested/ used to work perfectly, with a
source-repository-package
that reads:b704130.
However, with the latest
cabal-head
, I get this result:And with the long hash:
@alt-romes I believe you're the last person to touch how
cabal-install
calls git. Could you please investigate this?The text was updated successfully, but these errors were encountered: