Skip to content

buildGoModule: accept fixed-point function argument#321791

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

buildGoModule: accept fixed-point function argument#321791
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost 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 Go is a high-level general purpose programming language that is statically typed and compiled. 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
@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

@ghost
Copy link
Author

ghost 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.

@ghost
Copy link
Author

ghost 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
@ghost
Copy link
Author

ghost 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.

@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 added 8.has: documentation This PR adds or changes documentation and removed 8.has: documentation This PR adds or changes documentation labels Jun 26, 2024
@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?

@ghost
Copy link
Author

ghost 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
@winterqt winterqt closed this May 12, 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 Go is a high-level general purpose programming language that is statically typed and compiled. 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