Skip to content

buildRustPackage: remove git from nativeBuildInputs#205809

Closed
Atemu wants to merge 5 commits intoNixOS:stagingfrom
Atemu:build-rust-package-remove-git
Closed

buildRustPackage: remove git from nativeBuildInputs#205809
Atemu wants to merge 5 commits intoNixOS:stagingfrom
Atemu:build-rust-package-remove-git

Conversation

@Atemu
Copy link
Member

@Atemu Atemu commented Dec 12, 2022

Having git in nativeBuildInputs causes thousands of rebuilds when git is touched because every derivation that somehow transiently depends on a rust package will change. See #205682 for instance.

AFAICT git is unused. Only the fetcher needs git which it has already.

Fixes #205804

Description of changes
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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. label Dec 12, 2022
@Atemu Atemu requested review from madjar and wizeman December 12, 2022 17:13
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Dec 12, 2022
@raphaelr
Copy link
Contributor

The git in the function parameters can be removed as well.

@Atemu
Copy link
Member Author

Atemu commented Dec 13, 2022

Indeed. The previous version I was looking at still passed git through to the fetcher.

@Atemu Atemu force-pushed the build-rust-package-remove-git branch from b14f0db to e1b8e42 Compare December 13, 2022 18:27
@raphaelr
Copy link
Contributor

error: anonymous function at /home/raphi/nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix:1:1 called with unexpected
argument 'git'

       at /home/raphi/nixpkgs/lib/customisation.nix:72:16:

           71|     let
           72|       result = f origArgs;
             |                ^
           73|
       Did you mean lib?

Need to remove this line form make-rust-platform.nix

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 13, 2022
dotlambda and others added 5 commits December 14, 2022 20:48
The logging test of `wandb` failed, because another package
(`PythonGit`) clutters the logs about not being able to confirm
whether we are running in a Cygwin environment. So, simply
disable the test.
Having git in nativeBuildInputs causes thousands of rebuilds when git is touched
because every derivation that somehow transiently depends on a rust package will
change. See NixOS#205682 for instance.

AFAICT git is unused. Only the fetcher needs git which it has already.

Fixes NixOS#205804
Cacert doesn't have any binary parts; it does not make sense to have it in
nativeBuildInputs. Its home sould be buildInputs.

It probably shouldn't be in there either as I can't imagine it being a general
requirement for rust packages and any package that depends on cacert should do
so explicitly. I don't have the experience with the rust packages set to know
whether that's the case, so let's err on the side of caution.
@Atemu Atemu force-pushed the build-rust-package-remove-git branch from e1b8e42 to f3277bc Compare December 14, 2022 19:49
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Dec 14, 2022
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 14, 2022
@ofborg ofborg bot requested review from dotlambda, fabaff and samuela December 14, 2022 20:49
@samuela
Copy link
Member

samuela commented Dec 14, 2022

looks like there's an unrelated change to wandb in this PR as well. i'd recommend rebasing now that #205898 has landed

@Atemu
Copy link
Member Author

Atemu commented Dec 15, 2022

I think what happened is that I rebased on top of master thinking that would resolve the merge conflict but the conflicting change was actually on staging, so I rebased on top of that. However, staging didn't have all of master's commits merged in yet, so those other commits from master were also rebased on top of staging. Urgh.

Continued in #206195

@Atemu Atemu closed this Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants