Closed Bug 1579471 Opened 3 months ago Closed 3 months ago

Can't run any cargo update anymore


(Firefox Build System :: General, defect)

Not set


(firefox71 fixed)

Tracking Status
firefox71 --- fixed


(Reporter: eijebong, Assigned: glandium)





(1 file)

Running cargo update -p goblin -p object after modifying a .toml yielded that

[eijebong@plutonium] ~/code/mozilla-central (stable) (branches/default/tip) >>> cargo update -p object -p goblin
error: failed to select a version for the requirement `goblin = "^0.0.24"`
  candidate versions found which didn't match: 0.0.17
  location searched: directory source `/home/eijebong/code/mozilla-central/third_party/rust` (which is replacing registry ``)
required by package `profiler_helper v0.1.0 (/home/eijebong/code/mozilla-central/tools/profiler/rust-helper)`
perhaps a crate was updated and forgotten to be re-vendored?

Any kind of cargo update yields that kind of error and even trying to do ./mach build doesn't update the lockfile.

Removing the .cargo/config file "fixed" the problem

Flags: needinfo?(mh+mozilla)
Regressed by: 1575760

Yes, that's a known caveat. ISTR the error message from cargo update was more explicit about the cargo config being the cause... Just remove .cargo/config before running cargo update. That's unfortunately how vendoring rust works... (yes, it worked before because reasons, but that was by luck more than by design)

Flags: needinfo?(mh+mozilla)

Another thing that broke with the .cargo/config change is cargo publish.

We develop a number of crates inside central that we’re unable to publish
without first removing .cargo/config:

% cd testing/webdriver/
% cargo publish
    Updating `/home/ato/src/gecko/third_party/rust` index
error: failed to update dir /home/ato/src/gecko/third_party/rust

Caused by:
  failed to fetch `file:///home/ato/src/gecko/third_party/rust`

Caused by:
  could not find repository from '/home/ato/src/gecko/third_party/rust'; class=Repository (6)
% rm ../../.cargo/config
% cargo publish
    Updating index
   Packaging webdriver v0.40.2 (/home/ato/src/gecko/testing/webdriver)
   Verifying webdriver v0.40.2 (/home/ato/src/gecko/testing/webdriver)
   Uploading webdriver v0.40.2 (/home/ato/src/gecko/testing/webdriver)
Assignee: nobody → mh+mozilla
Ever confirmed: true

It was added in bug 1575760 and turns out to be causing a lot more
problems than anticipated.

However, the previous status quo is also not ideal, so we do
auto-generate .cargo/ instead, with a little trick that allows
to just copy it to .cargo/config instead of how individual scripts would
previously manually preprocess it.

Duplicate of this bug: 1579962
Pushed by
Remove the in-tree .cargo/config. r=mshal
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Regressions: 1591029
You need to log in before you can comment on or make changes to this bug.