2

I want to install a package and all its dependencies as they were at a specific date and time in the past.

I need to use a slightly older version of rustc-nightly, and therefore I need to make sure that all dependencies pulled by cargo install compile against that old version of the compiler.

Currently, when I specify the version of the top-level package to install, it still seems to pull the latest version of some dependencies, which don't build with the old compiler.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
ktorn
  • 1,032
  • 8
  • 14

1 Answers1

2

No, this is not possible.

Your best options are:

  1. Upgrade the compiler. If you "can't" do this, evaluate why you can't and decide how much benefit you are getting from that.

  2. Add the dependencies to your own Cargo.toml pinned to an older version that does work.

  3. You can try forking the crate index and rolling it back, but there's no guarantee that will work either.

seems to pull the latest version of some dependencies

Yes, most libraries specify dependencies with a semver-compatible range, such as my-library = "1.0". This will allow any version from 1.0.0 to 1.x.y.

Unfortunately, there's no consensus on whether requiring a new version of Rust constitutes a semver-breaking change yet.

See also:

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366