-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Use go mod download
as a fetcher
#41
Merged
adisbladis
merged 26 commits into
nix-community:master
from
adisbladis:go-mod-download-fetcher
May 29, 2022
Merged
Use go mod download
as a fetcher
#41
adisbladis
merged 26 commits into
nix-community:master
from
adisbladis:go-mod-download-fetcher
May 29, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This calculates the output hashes in pure Go and removes Nix from being a run time dependency of gomod2nix. Additionally it should be faster, but that's untested.
Now that we're not spawning subprocesses like crazy it's far less relevant to limit concurrency.
And make it run in parallell
adisbladis
force-pushed
the
go-mod-download-fetcher
branch
6 times, most recently
from
May 29, 2022 08:00
f8a33a0
to
6c38085
Compare
Constructs such as ``` replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 ``` Are perfectly valid and we previously discarded every one but the last of them.
Tests take 1+ hour right now for very little purpose.
We will use this to generate the Github Actions matrix
adisbladis
force-pushed
the
go-mod-download-fetcher
branch
from
May 29, 2022 08:26
6c38085
to
9692570
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is quite a large change and I wasn't sure of the best title, but here goes:
I've felt for some time that the logic around using
fetchGit
was hacky and error prone.While we don't want to abuse fixed output derivations for fetching large bundles we can use a fixed-output derivation that uses
go mod download
per derivation.This ensures that we are always doing the right thing in regards to subdirectories as we rely on Go to have the correct behaviour.
Another thing this PR implements a format change for
gomod2nix.toml
, and thanks to the above change that is a great simplification of what we had before.We also no longer rely on any other prefetch utilities or even Nix itself to calculate the fixed output hashes, that's now done purely in Go.
Closes #13
Closes #26
Closes #27
Closes #34
Partially resolves: #20
cc @yihuang