Rework and refresh the rust workspace hack
Categories
(Firefox Build System :: General, task)
Tracking
(firefox116 fixed)
| Tracking | Status | |
|---|---|---|
| firefox116 | --- | fixed |
People
(Reporter: glandium, Assigned: glandium)
References
Details
Attachments
(2 files)
| Assignee | ||
Comment 1•2 years ago
|
||
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.
| Assignee | ||
Comment 2•2 years ago
|
||
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.
Comment 4•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d56073d9252c
https://hg.mozilla.org/mozilla-central/rev/ad89174d6840
Comment 5•2 years ago
|
||
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
| Assignee | ||
Comment 6•2 years ago
|
||
Oh right, I published the crate after the fact... and cargo vet doesn't like that.
| Assignee | ||
Comment 7•2 years ago
|
||
Weirdly enough... I can't reproduce.
Comment 8•2 years ago
|
||
Indeed this doesn't happen on Linux, only on Windows ¯_(ツ)_/¯
Sorry for the noise
Comment 9•2 years ago
|
||
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).
Comment 10•2 years ago
|
||
I see the the same problem on macOS
Description
•