-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
fetchFromGitHub: add goPackagePath similar to meta.homepage #49595
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
fetchFromGitHub: add goPackagePath similar to meta.homepage #49595
Conversation
P. S. There are only a few packages that wouldn't be able to use this:
|
ffcf52e
to
c353f28
Compare
Success on x86_64-linux (full log) Attempted: circleci-cli Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: circleci-cli, wuzz Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: circleci-cli, wuzz Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: circleci-cli Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: circleci-cli, gh-ost, saml2aws, wuzz Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: circleci-cli, gh-ost, saml2aws, wuzz Partial log (click to expand)
|
1a5bd81
to
28daa43
Compare
Failure on aarch64-linux (full log) Attempted: circleci-cli, gh-ost, saml2aws, wuzz Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: circleci-cli, gh-ost, saml2aws, wuzz Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: circleci-cli, gh-ost, saml2aws, wuzz Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: circleci-cli, gh-ost, saml2aws, wuzz Partial log (click to expand)
|
This seems like a good idea but it seems a little weird putting something so go-specific in fetchFromGitHub. Could we instead call it something like "shortUrl" (or better yet just "url" if go supports the https:// prefix). |
I think "url" is a bit too general, considering that something fetched by fetchFromGitHub could end up in pretty much any context. If I have a thing with |
I kinda agree? Maybe do both, so that you can still do |
This seems to me like an inappropriate addition to Could we instead update |
@yurrriq Actually, I really like that. I'm implementing it |
Whoops, wrong base branch. However, this should be good now |
👍 from me once the Borg are happy. |
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.
nakedUrl
is generic enough and might be useful later. I prefer this approach to the previous one.
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.
On second thought... this PR should probably include an update to the documentation, describing the default goPackagePath
.
@@ -290,7 +291,7 @@ in | |||
then { inherit rev fetchSubmodules; url = "${baseUrl}.git"; } | |||
else ({ url = "${baseUrl}/archive/${rev}.tar.gz"; } // privateAttrs) | |||
) // passthruAttrs // { inherit name; }; | |||
in fetcher fetcherArgs // { meta.homepage = baseUrl; inherit rev; }; | |||
in fetcher fetcherArgs // { meta.homepage = baseUrl; inherit nakedUrl rev; }; |
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 disagree with adding nakedUrl
. It's a composition of some input values, which just happens to be useful for Go packages. Instead, make the individual values available and do the composition elsewhere (pkgs/development/go-modules/generic/default.nix
).
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.
Agreed. go get
has some heuristic to translate goPackagePath to URLs, I don't know how uniform that is. It would be better to detect the src.url in buildGoPackage.
Maybe we should have every fetcher have an URI attribute set that contains the separate components according to https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax. That way, anyone create whatever composition they like. |
The principle of removing duplication is good, but the go-specific heuristic should be moved inside of buildGoPackage so that it doesn't complicate all of nixpkgs. Is that something you would agree to pursue @Synthetica9 ? Otherwise this PR should be closed. |
Closing due to lack of response and conflicts. |
Motivation for this change
Also updating circleci-cli as an example of how to use this. This would potentially be useful in 284 files:
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)