Add an option to make cbindgen updates automatic
Categories
(Firefox Build System :: Bootstrap Configuration, enhancement)
Tracking
(Not tracked)
People
(Reporter: MatsPalmgren_bugz, Assigned: emilio)
References
Details
Attachments
(1 obsolete file)
I'm rather bored with starting a build, go doing something else, and then come back to this:
0:06.80 ERROR: cbindgen version 0.8.2 is too old. At least version 0.8.3 is required.
0:06.80 Please update using 'cargo install cbindgen --force' or running
0:06.80 './mach bootstrap', after removing the existing executable located at ...
rather than a finished build.
Please add an UPDATE_CBINDGEN_AS_NEEDED environment variable or something that runs the above command automatically when needed.
No, I do not want to run it every time I start a build b/c that command is rather slow and it takes time even when I already have the latest version.
Assignee | ||
Comment 1•6 years ago
|
||
FWIW, the only thing that mach bootstrap does regarding cbindgen on Linux is something like:
GECKO_DIR=`pwd`;
pushd ~/.mozbuild;
$GECKO_DIR/mach artifact toolchain --from-build linux64-cbindgen;
popd
We could do different things:
- Teach
./mach bootstrap
to not re-download everything if there's already an acceptable version. - Allow to install only some toolchain artifacts rather than all of them.
- Vendor cbindgen in tree, and build it if needed. But we don't have the capability to use rust crates as host programs, hopefully someone from the build team can comment on what that would entail.
Assignee | ||
Comment 2•6 years ago
|
||
Ah, I recall now the problem. So we have HOST_RUST_PROGRAMS, which theoretically allows to just build cbindgen and use it during the Firefox build.
However, this has some problems, since we need to run cbindgen during the export
phase, and we probably:
- Don't want cbindgen to block all the exports.
- I'm not sure if it's even feasible to build a rust crate before the export phase.
Nathan, mind confirming?
It does feel a bit gross to run ./mach artifact toolchain
from configure, but maybe it's ok? wdyt?
![]() |
||
Comment 3•6 years ago
|
||
I think we could probably arrange to have HOST_RUST_PROGRAMS
somehow run in parallel with export
, but I would not want to get into the situation where a host Rust program somehow depends on the results of export
, non-obviously. We certainly wouldn't want HOST_RUST_PROGRAMS
to entirely block export
. So that whole idea is out.
Running mach artifact toolchain
from configure is a little gross, but reasonable for solving problems like this, I think. We'd want to make it opt-in (so that you know configure is going to be modifying stuff outside the build directory), so error messages about things not being found should inform people about how they can add the appropriate environment variable or whatever.
Reporter | ||
Comment 4•6 years ago
|
||
Reporter | ||
Comment 5•6 years ago
|
||
Got tired of waiting... Apologies in advance for my noob Python skills... :-)
Updated•6 years ago
|
Assignee | ||
Comment 6•6 years ago
|
||
I can take a look at this while looking at bug 1542878 too.
Assignee | ||
Comment 7•6 years ago
|
||
Ah, I said I'd look at this. I'm not full-time this week but I'll try to get something here.
Comment 8•6 years ago
|
||
Don't. I'm looking at making this generic and work for all the toolchains we install.
Updated•6 years ago
|
Description
•