Skip to content
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
merged 26 commits into from
May 29, 2022

Conversation

adisbladis
Copy link
Member

@adisbladis adisbladis commented May 28, 2022

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

@adisbladis adisbladis force-pushed the go-mod-download-fetcher branch 6 times, most recently from f8a33a0 to 6c38085 Compare May 29, 2022 08:00
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 adisbladis merged commit cabedd2 into nix-community:master May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant