Closed Bug 1579471 Opened 3 months ago Closed 3 months ago

Can't run any cargo update anymore

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(firefox71 fixed)

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: eijebong, Assigned: glandium)

References

(Regression)

Details

Attachments

(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 `https://github.com/rust-lang/crates.io-index`)
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 crates.io 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
Status: UNCONFIRMED → ASSIGNED
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/config.in 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 mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/64cab9bb87f4
Remove the in-tree .cargo/config. r=mshal
Status: ASSIGNED → RESOLVED
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.