Closed Bug 1326393 Opened 7 years ago Closed 5 years ago

Make |mach bootstrap| for Android (non-artifact) run `rustup target add {armv7-linux-androideabi,i686-linux-android}

Categories

(Firefox Build System :: Bootstrap Configuration, defect)

defect
Not set
normal

Tracking

(firefox53 affected)

RESOLVED FIXED
Tracking Status
firefox53 --- affected

People

(Reporter: Sylvestre, Unassigned)

References

(Blocks 1 open bug)

Details

After a mach bootstrap for android and using rustc & cargo from my distro:

 0:02.96 checking for rustc... /usr/bin/rustc
 0:02.96 checking for cargo... /usr/bin/cargo
 0:02.98 checking rustc version... 1.13.0
 0:03.00 checking cargo support for --frozen... yes
 0:03.03 DEBUG: Executing: `/usr/bin/rustc --crate-type staticlib --target=armv7-linux-androideabi -o /tmp/conftest0oTIya.rlib /tmp/conftestOT3kKY.rs`
 0:03.03 DEBUG: The command returned non-zero exit status 101.
 0:03.03 DEBUG: Its error output was:
 0:03.03 DEBUG: | error[E0463]: can't find crate for `std`
 0:03.03 DEBUG: |
 0:03.03 DEBUG: | error: aborting due to previous error
 0:03.03 DEBUG: |
 0:03.03 ERROR: Cannot compile for arm-unknown-linux-androideabi with /usr/bin/rustc
 0:03.03 The target may be unsupported, or you may not have
 0:03.03 a rust std library for that target installed. Try:
 0:03.03 
 0:03.03   rustup target add armv7-linux-androideabi
 0:03.03 
 0:03.05 *** Fix above errors and then restart with\
 0:03.05                "/usr/bin/make -f client.mk build"
 0:03.05 client.mk:379 : la recette pour la cible « configure » a échouée
 0:03.05 make: *** [configure] Erreur 1

I think rustup should be installed and the command executed.
Blocks: 1286799
What would you like to have happen here? I would expect if you ran bootstrap with debian rustc 1.13 and cargo installed that it would accept those. Then at configure time it would ask you to run `rustup target add ...` to add the cross libstd. But you can't, because bootstrap didn't install rustup.

As far as I can tell, Debian doesn't have an arm-android cross-libstd package. There's not even a libstd-rust-1.14:armhf package. Until those are available, I think you have to use rustup to install upstream builds.

So...we could force rustup if you've selected an android target in `./mach bootstrap`? We could encourage debian to complete packaging of rustup so the command works?
Flags: needinfo?(sledru)
Maybe bootstrap should duplicate the configure check that you have libstd for the target system, at least for the Android case? Then if it's missing we could prompt to install rustup.
We can have a discussion in Debian to generate these packages but this is not the place.

Here, maybe we could have something like:
* mach boostrap detects that the system has packages for rustc & cargo
* detects that it is possible to build to arm with it
* download, install and run rustup just for this support (if possible)

I know this means two rust compilers installed on the system.
Flags: needinfo?(sledru)
Product: Core → Firefox Build System
Component: General → Bootstrap Configuration
(In reply to Ralph Giles (:rillian) | needinfo me from comment #1)
> What would you like to have happen here?

For Android builds, I would like to "target add" the appropriate Rust configuration.  This will entail |mach bootstrap| interrogating the user to determine whether they want to build for ARMv7, aarch64, x86, or x86_64.

I propose to default to ARMv7 and x86: Rust targets run about 20-50Mb, IIRC, so it isn't a big deal to install an extra one.
Summary: bootstrap for android does not install rustup and configure it for arm → Make |mach bootstrap| for Android (non-artifact) run `rustup target add {armv7-linux-androideabi,i686-linux-android}

This was addressed by my mach bootstrap Android rehabilitation in Bug 1477487.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.