Skip to content

Automate rustRegistry updates #14469

Closed
Closed

Description

@jgillich

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?

Activity

  1. abbradar commented on Apr 5, 2016

    @abbradar
    Member

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

  2. jgillich commented on Apr 5, 2016

    @jgillich
    MemberAuthor

    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.

  3. added
    0.kind: enhancement
    6.topic: rust
    on Apr 5, 2016
  4. trishume commented on Apr 5, 2016

    @trishume
    Contributor

    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):

  5. kevincox commented on Aug 4, 2017

    @kevincox
    Contributor

    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.

  6. stale commented on Jun 5, 2020

    @stale

    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.
  7. added
    2.status: stale
    on Jun 5, 2020
  8. Artturin commented on Mar 1, 2023

    @Artturin
    Member

    we don't have a rustRegistry anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancement2.status: stale6.topic: rust

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions