-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
fetchgit: remove only .git folder #15469
Conversation
Source of this change goes back to 2009 and original version of fetchgit at 205fb0c. The nondeterminism is really caused by changing .git so leave other files alone as they might be interesting. Note: this causes a hash mismatch with Hydra's version of Git Plugin which we should fix to comply.
By analyzing the blame information on this pull request, we identified @timbertson, @bjornfor and @nbp to be potential reviewers |
Doesn't this potentially change some hashes? |
Yes, but there is no way around really. On Mon, May 16, 2016, 16:06 Tuomas Tynkkynen notifications@github.com
|
Well, shouldn't they be changed via some scripts at the same time or builds will start failing left and right? |
There are 1200 invocations, we should probably change those that fail now indeed. |
Here's something hacky to try to detect them (I get only ~800 hits, though): https://gist.github.com/dezgeg/94b7895fb79bbe3c32cc9903956690cc Run like: |
@dezgeg nice! I'll give it a run. |
@dezgeg this doesn't build the derivations. Just evaluating won't be enough |
Yes, but you get the attr path for each thing you need to call |
It's not useful because
|
We could use that information to run |
Well, that's not very useful indeed... But |
I wouldn't use |
gnulib should fail right?
|
It does:
|
Ah! |
BTW, the nix file I posted doesn't locate packages that aren't included in the channel. I suppose temporarily sprinkling |
and also whitespace. This is probably due to #15469.
@@ -286,7 +286,7 @@ _clone_user_rev() { | |||
eval "$NIX_PREFETCH_GIT_CHECKOUT_HOOK" | |||
if test -z "$leaveDotGit"; then | |||
echo "removing \`.git'..." >&2 | |||
find "$dir" -name .git\* -print0 | xargs -0 rm -rf |
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.
maybe add -type d
too ?
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.
-type d -delete
would be more beneficial than piping to xargs and rm -rf
, yes?
find "$dir" -name .git -type d -delete
Building upon @dezgeg s expression I produced a list of the hashes I added to and altered find-fetchgits.nix to check for this variable and output a nix-prefetch-git command based upon them: https://gist.github.com/groxxda/c205a41f5e70edac3c1bd731ab943d36 then some shell hacking to fetch everything and generate the output. If it's of use, I'll post the shell snippets so someone else can run everything and we can compare the hashes. A simple sed s/old/new/ on the nixpkgs repo should then be enough to update the hashes. |
@groxxda let's do it :) |
https://gist.github.com/groxxda/669e350b5494a94e093d0262221bf3e3 ugh that's some ugly code We still miss a good amount of invocations as dezgeg pointed out.. Also no vim plugins picked up 😞 I opened an issue for the packages that have a src that can't be fetched: #15558 |
@groxxda that's a nice script. Also seems like it could be nice to figure out which |
👍 replacing fetchgit with fetchFromGitHub - now would be the perfect time |
@groxxda: there's this new command |
Thanks @vcunat Edit: just noticed #15559 addresses this issue 👏 |
There might be another change needed to fetchgit (remove the current naming of produce .drv so it matches new builtins.fetchgit). Should we revert this and do both changes at the same time together with hash updates? |
Is the builtin meant to replace |
No, |
Could we not use the builtin to fetch without checking into |
vimplugins hashes fixed |
I pushed https://git.io/voeqV which is a superset of https://gist.githubusercontent.com/groxxda/0f5ff6e5f905534acd9690c42a0d9b17/raw/0e289d419c133542ceca9ca0ed97300b0dbb77fa/broken-git-hashes.json. I don't think that still catched them all, though. |
See commit for explanation
cc @rbvermaa