Closed Bug 1838354 Opened 2 years ago Closed 2 years ago

Rework and refresh the rust workspace hack

Categories

(Firefox Build System :: General, task)

task

Tracking

(firefox116 fixed)

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(2 files)

No description provided.

First, instead of using a path, use a version, which is more convenient
(via a patch in the top-level Cargo.toml).

Second, we make the build system itself enforce its presence for any
crate that is hooked to the build system as a program or library.

Finally, for each crate depending on the workspace hack, we add a
feature named after it, and make the build system enforce that the
feature is set. For now, this remains unused, but the end goal is to
have each of those features enable the dependencies each of these
crates need, so that if crate A and B need dependency D, but crate C
doesn't, building crate C doesn't build D.

It had been neglected for a long time, and the enabled features were
outdated, and plenty of now common crates were missing.

This refresh required ad-hoc, flawed scripts to reach that updated
Cargo.toml. Eventually we'll want this refresh to be automated, but
the existing tools don't quite work for our use case just yet. Rather
than waiting that such a state is reached, go ahead with this manual
update which improves a lot compared to the status quo.

Depends on: 1839293
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/d56073d9252c Change how the rust workspace hack is added. r=firefox-build-system-reviewers,webdriver-reviewers,ahochheiden,whimboo https://hg.mozilla.org/integration/autoland/rev/ad89174d6840 Refresh the rust workspace hack. r=firefox-build-system-reviewers,supply-chain-reviewers,ahochheiden
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch

If I try to vendor some rust crates after this patch landed cargo vet complains. This is the output of cargo vendor rust:

 0:24.22 Vet error: There are some issues with your policy.audit-as-crates-io entries
 0:24.44  related error: Some non-crates.io-fetched packages match published crates.io versions
  mozilla-central-workspace-hack:0.1.0

And this is what cargo-vet has to say:

Error:
  × Some non-crates.io-fetched packages match published crates.io versions
  │   mozilla-central-workspace-hack:0.1.0
  help: Add a `policy.*.audit-as-crates-io` entry for them

Oh right, I published the crate after the fact... and cargo vet doesn't like that.

Weirdly enough... I can't reproduce.

Indeed this doesn't happen on Linux, only on Windows ¯_(ツ)_/¯

Sorry for the noise

Hm, I see the same problem on Linux, though.
clobber didn't help (not sure if it would do anything relevant, but it was the first thing that came to mind).

Blocks: 1841150

I see the the same problem on macOS

Regressions: 1842331
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: