Bootstrap the native engine from live sources.

Review Request #4345 — Created Nov. 1, 2016 and submitted — Latest diff uploaded

jsirois
pants
jsirois/issues/3999
3999, 4014
2b6e063...
pants-reviews
nhoward_tw, stuhood
This change to the `pants` script requires that the engine is
bootstrapped from live local sources and as a result requires pants
devs to have a rust distribution installed.

 build-support/bootstrap_native | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++
 pants                          |  2 ++
 src/rust/engine/.gitignore     |  1 +
 src/rust/engine/Cargo.lock     |  4 +++
 src/rust/engine/Cargo.toml     |  7 ++++++
 src/rust/engine/src/lib.rs     |  2 ++
 6 files changed, 82 insertions(+)

Manually tested caching as follows:

$ rm -rf ~/.cache/pants/bin/native-engine ~/.cargo ~/.multirust && git clean -fdx src/rust

$ time ./pants --version
A rust installation could not be found, installing via the instructions at https://www.rustup.rs ...
info: downloading installer
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: downloading component 'rustc'
 45.4 MiB /  45.4 MiB (100 %)   2.2 MiB/s ETA:   0 s                
info: downloading component 'rust-std'
 58.3 MiB /  58.3 MiB (100 %)   2.4 MiB/s ETA:   0 s                
info: downloading component 'rust-docs'
  7.4 MiB /   7.4 MiB (100 %)   2.2 MiB/s ETA:   0 s                
info: downloading component 'cargo'
  4.2 MiB /   4.2 MiB (100 %)   1.5 MiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'rust-docs'
info: installing component 'cargo'
info: default toolchain set to 'stable'

  stable installed - rustc 1.12.1 (d4f39402a 2016-10-19)

info: using existing install for 'stable-x86_64-unknown-linux-gnu'
info: override toolchain for '/home/jsirois/dev/pantsbuild/jsirois-pants' set to 'stable-x86_64-unknown-linux-gnu'

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.12.1 (d4f39402a 2016-10-19)

   Compiling engine v0.0.1 (file:///home/jsirois/dev/pantsbuild/jsirois-pants/src/rust/engine)
    Finished debug [unoptimized + debuginfo] target(s) in 0.25 secs
1.3.0dev0

real    1m21.751s
user    0m4.877s
sys 0m2.087s

$ time ./pants --version
1.3.0dev0

real    0m0.604s
user    0m0.403s
sys 0m0.053s

CI went green here:
https://travis-ci.org/pantsbuild/pants/builds/173325950

Loading...