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

buildRustPackage: add update script #96366

Closed
wants to merge 1 commit into from

Conversation

danieldk
Copy link
Contributor

Motivation for this change

The update script looks up the derivation's pname on crates.io finds
the latest version of that crate.

Tested for me and a few other maintainers. Seems to reliably find
newer versions.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/275

Copy link
Member

@Ma27 Ma27 left a comment

Choose a reason for hiding this comment

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

I'm not sure if I like this for the following reasons:

  • The package name is not necessarily equivalent to the crate name (e.g. wasm-bindgen vs wasm-bindgen-cli)
  • I don't see how cargoSha256 gets updated
  • Several packages need a re-created lockfile first.

If we use an update script like this, we'll probably end up with invalid version updates (e.g. due to r-ryantm's logic that can't catch all cases of rust-related packaging hacks IIRC).

maintainers/scripts/update-rust-crates Outdated Show resolved Hide resolved
The update script looks up the derivation's pname on crates.io finds
the latest version of that crate.

Tested for me and a few other maintainers. Seems to reliably find
newer versions.
@danieldk
Copy link
Contributor Author

danieldk commented Aug 28, 2020

  • The package name is not necessarily equivalent to the crate name (e.g. wasm-bindgen vs wasm-bindgen-cli)
  • Several packages need a re-created lockfile first.
  • I don't see how cargoSha256 gets updated

If we use an update script like this, we'll probably end up with invalid version updates (e.g. due to r-ryantm's logic that can't catch all cases of rust-related packaging hacks IIRC).

I was considering interactive use by a maintainer, where it can be handy to get a quick overview of derivations that you might need to update. I didn't know/realize that r-ryantm was using the same maintainer scripts. Then this would indeed misfire too often to be useful.

Thanks for the review!

@danieldk danieldk closed this Aug 28, 2020
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

3 participants