Closed Bug 1369242 Opened 7 years ago Closed 7 years ago

Crates vendored for later package may override that from package before in |mach vendor rust|

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1336528

People

(Reporter: xidorn, Unassigned)

References

(Blocks 1 open bug)

Details

Now |mach vendor rust| runs on four independent packages (not sure whether package is the proper name here, but you know...):
- toolkit/library/rust
- toolkit/library/gtest/rust
- js/src
- testing/geckodriver

It is possible that there are some conflicts on dependency versions between these packages. e.g. some dependencies in toolkit/library/rust want bitflags 0.8.2, while some dependencies in testing/geckodriver want bitflags 0.7.0.

It seems if there are more than one versions mentioned in a single Cargo.lock file, we would get correct vendoring that we would have a bitflags directory containing 0.8.2, and a bitflags-0.7.0 directory containing 0.7.0. But if we do that in different cargo vendor commands, things would mess up.

It wasn't a big problem before, because there aren't much overlap between toolkit/library ones and js/src. However, geckodriver contains lots of overlap, which makes the situation much worse.

I guess we really want a global level Cargo.lock at the root directory to solve this problem. Alternatively, |mach vendor rust| should probably be able to warn for this kind of conflicts.
Well, a global Cargo.lock file is hard, because that implies a global Cargo.toml.  Workspaces would deal with this, but we can't use workspaces (yet).
What's the problem still blocking us from using workspace?
FWIW since cargo-vendor 0.1.9 you can pass it multiple toml/lock files and it'll vendor everything which doesn't require a workspace (and should work for this case I think?)

Is updating to cargo-vendor 0.1.9 feasible? (I think it'd solve this)
If you can distribute cargo-vendor 0.1.9 somehow via mach bootstrap... It seems that it is not published on crates.io?
BTW, it seems I cannot build cargo-vendor locally in my MozillaBuild shell. The build script of libssh2-sys fails to run.

Currently I myself use the precompiled binary from GitHub, but I'm not sure whether that is something we can do for other people...
Ah unfortunately it depends on the git version of Cargo, but with 1.18 being released next week I believe I can publish after that.
This was fixed in bug 1336528. I did not realize this bug existed, sorry!
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.