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

Automate rustRegistry updates #14469

Closed
jgillich opened this issue Apr 5, 2016 · 6 comments
Closed

Automate rustRegistry updates #14469

jgillich opened this issue Apr 5, 2016 · 6 comments
Labels
0.kind: enhancement 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: rust

Comments

@jgillich
Copy link
Member

jgillich commented Apr 5, 2016

Having to update rustRegistry manually is super annoying when you're developing in Rust.

I propose adding a script to nixpkgs that can generate the latest version, and then put a .travis.yml in a repo that calls the script and submits a PR, invoked daily by Nightli.es. Alternatively, it could be a cronjob running on nixos.org infrastructure. This would also be reusable for other packages.

cc @abbradar @trishume @jagajaga What do you think?

@abbradar
Copy link
Member

abbradar commented Apr 5, 2016

Given that snapshot update can't break anything in theory (we require Cargo.lock files to ensure dependencies' determinism in our Rust packages, and upstream keeps all old package versions there) I'm all for automated updating. I don't think spamming nixpkgs with automated PRs is a good thing, however. Maybe, given that I can't think of a situation when a snapshot update is harmful, we want to just push updates directly to master. Before doing that, however, we must carefully ensure that upstream is committed to keep all old package versions there and doesn't have an npm-style "unpublish" procedure (i.e. what's got into repository stays there and can only be "hidden" from search maybe).

@jgillich
Copy link
Member Author

jgillich commented Apr 5, 2016

Crates.io never had an unpublish feature, they only remove things for legal reasons: https://www.reddit.com/r/rust/comments/4bm3rk/how_would_cratesio_react_in_a_case_similar_to_the/d1bqxc0

You're right about directly pushing to master; after a while, nobody's going to check generated commits anyway and will just hit merge. In the unlikely case something breaks, we can always revert it.

@trishume
Copy link
Contributor

trishume commented Apr 5, 2016

This sounds good to me.

I really like the way the rust infrastructure works in Nix relative to the other languages where you have to use Nix file generators, depsSha256 and then making Cargo deterministic is clever.

Specifically for how the script updates the crates index, perhaps this new Nix feature might be of some use: NixOS/nix@06f29fa
I think that should let it prefetch directly based on the fetchFromGitHub call in rust-packages.nix.
But otherwise we can just figure out the correct URL and use nix-prefetch-url, then update the URL and SHA256 in rust-packages.nix

Here's some other things it could update (not necessarily in first implementation, but eventually):

@kevincox
Copy link
Contributor

kevincox commented Aug 4, 2017

I think that this can be fixed with https://github.com/alexcrichton/cargo-local-registry

This would allow creating a local registry with only the package specified in a Cargo.toml file. This should be constant over time (and is verfiied by hashes) and would eliminate the need to have the registry package at all.

I might try to get it working but I'm not faimilar with the rust packaging and the tool itself has a number of dependencies which I would probably need to build manually to avoid a circular dependency.

@stale
Copy link

stale bot commented Jun 5, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 5, 2020
@Artturin
Copy link
Member

Artturin commented Mar 1, 2023

we don't have a rustRegistry anymore

@Artturin Artturin closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: rust
Projects
None yet
Development

No branches or pull requests

5 participants