Closed Bug 1540533 Opened 6 months ago Closed 3 months ago

Add an option to make cbindgen updates automatic

Categories

(Firefox Build System :: Bootstrap Configuration, enhancement)

enhancement
Not set

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1553230

People

(Reporter: mats, Assigned: emilio)

References

(Blocks 1 open bug)

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.

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.
See Also: → 1540540

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?

Flags: needinfo?(nfroyd)

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.

Flags: needinfo?(nfroyd)

Got tired of waiting... Apologies in advance for my noob Python skills... :-)

Attachment #9056359 - Attachment is obsolete: true

I can take a look at this while looking at bug 1542878 too.

Depends on: 1542878
See Also: → 1553230

Ah, I said I'd look at this. I'm not full-time this week but I'll try to get something here.

Assignee: nobody → emilio
Blocks: 1553230
Flags: needinfo?(emilio)

Don't. I'm looking at making this generic and work for all the toolchains we install.

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1553230

Wfm, thanks!

Flags: needinfo?(emilio)
You need to log in before you can comment on or make changes to this bug.