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: correct spelling in documentation and simplify the go-modules structure #234032

Merged
merged 2 commits into from May 27, 2023

Conversation

ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented May 25, 2023

Description of changes

Change "platform dependant checksums" to "platform-dependent checksums", as "dependant" is only used as a noun.

Simplify the attribute structure in pkgs/build-support/go/modules.nix. This causes no rebuild and ease the review process of #225051.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@zowoq
Copy link
Contributor

zowoq commented May 26, 2023

Switching to draft as we'll merge #225371 first.

@zowoq zowoq marked this pull request as draft May 26, 2023 04:37
@zowoq zowoq self-assigned this May 26, 2023
@zowoq
Copy link
Contributor

zowoq commented May 26, 2023

@ShamrockLee Please rebase this PR.

Change "platform dependant" to "platform-dependent"

The word "dependant" (with suffix -ant) is used as a noun
in British English, while the adjetive is "dependent" (-ent).
Both are "dependent" in American English.

Reference:
https://www.merriam-webster.com/words-at-play/spelling-variants-dependent-vs-dependant
https://dictionary.cambridge.org/dictionary/english/dependant

assert goPackagePath != "" -> throw "`goPackagePath` is not needed with `buildGoModule`";
assert (args' ? vendorHash && args' ? vendorSha256) -> throw "both `vendorHash` and `vendorSha256` set. only one can be set.";

let
args = removeAttrs args' [ "overrideModAttrs" "vendorSha256" "vendorHash" ];

go-modules = if (vendorHash != null) then stdenv.mkDerivation (let modArgs = {
go-modules = if (isNull vendorHash) then "" else
Copy link
Contributor

Choose a reason for hiding this comment

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

https://nixos.org/manual/nix/stable/language/builtins.html#builtins-isNull
This function is deprecated; just write e == null instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed.

@zowoq
Copy link
Contributor

zowoq commented May 27, 2023

Please revert the last indentation change.

Comment on lines 58 to 59
go-modules =
if (isNull vendorHash) then "" else
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, in my previous comment I meant revert this:

Suggested change
go-modules =
if (isNull vendorHash) then "" else
go-modules = if (isNull vendorHash) then "" else

@zowoq
Copy link
Contributor

zowoq commented May 27, 2023

@ShamrockLee Please drop the formatting changes from this PR, rather than us going back and forth over formatting it'll be easier if I do it myself.

@ShamrockLee ShamrockLee changed the title buildGoModule: correct spelling in documentation and format the expression buildGoModule: correct spelling in documentation and simplify the go-modules structure May 27, 2023
@ShamrockLee
Copy link
Contributor Author

Finished rebasing and addressed the suggestions.

@zowoq zowoq marked this pull request as ready for review May 27, 2023 21:47
@zowoq zowoq merged commit 1a89cfa into NixOS:master May 27, 2023
19 checks passed
@zowoq zowoq removed their assignment May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants