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

buildGoModule: accept fixed-point function argument #321791

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ehmry
Copy link
Contributor

@ehmry ehmry commented Jun 22, 2024

Make it possible to use buildGoModule (finalAttrs: { instead of buildGoModule rec {.

I'm hoping this is a zero-rebuild change.

Related: #225051 #234651 #317559


Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 6.topic: golang labels Jun 22, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jun 22, 2024
@ehmry ehmry marked this pull request as ready for review June 22, 2024 18:41
@Aleksanaa
Copy link
Member

Aleksanaa commented Jun 22, 2024

Support for finalAttrs is good, but replacing all occurrence of rec, especially those only using rev = version, doesn't bring any immediate benefit. See #310373

@ehmry
Copy link
Contributor Author

ehmry commented Jun 23, 2024

The immediate benefit is that there is consistency, and consistency perpetuates more consistency because people look at other packages for examples.

@ehmry
Copy link
Contributor Author

ehmry commented Jun 23, 2024

I did this because its good to have the option of using finalAttrs and because it makes buildGoModule consistent with what we are recommending elsewhere.

Changing packages that are using rec shows that it can be done without effecting outputs, but it isn't necessary so the second commit doesn't need to be merged.

zowoq
zowoq previously requested changes Jun 23, 2024
Copy link
Contributor

@zowoq zowoq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split formatting to another commit.

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 23, 2024
@ehmry
Copy link
Contributor Author

ehmry commented Jun 23, 2024

There are actually quite a few places where overriding version and src later isn't going to be correct, see git grep -n -- '-X=g' pkgs.

@ehmry ehmry requested a review from zowoq June 23, 2024 14:32
@Mic92
Copy link
Member

Mic92 commented Jun 23, 2024

The immediate benefit is that there is consistency, and consistency perpetuates more consistency because people look at other packages for examples.

A different problem is that it has a negative impact on eval performance because of fixed-output computation - So I don't think we should use this everywhere in nixpkgs, but only if we need it.

@github-actions github-actions bot removed the 8.has: documentation This PR adds or changes documentation label Jun 26, 2024
@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Jun 26, 2024
@ehmry ehmry dismissed zowoq’s stale review June 26, 2024 06:30

Reformatting removed.

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 26, 2024
@philiptaron
Copy link
Contributor

philiptaron commented Aug 20, 2024

@ehmry mind if I force-push this to fix the merge conflict?

@ehmry
Copy link
Contributor Author

ehmry commented Aug 20, 2024

@philiptaron yes, fine by me

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 10, 2024
@ShamrockLee
Copy link
Contributor

This commit needs rebasing, as #225051 is merged.

@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: golang 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants