Skip to content

Commit

Permalink
Engine is a workspace (pantsbuild#5555)
Browse files Browse the repository at this point in the history
Now that we're using a cdylib, this can be enabled.

This allows rust-standard ways of operating across a whole project, like
running `cargo test --all`.

It also improves compile time. Using a workspace means that a single
`Cargo.lock` file is used for the project, and a single `target`
directory is used for outputs. This in turn means that if building
multiple components (e.g. `engine` and `fs_util`), the intermediate
artifacts are actually shared across components, rather than
re-compiled.
  • Loading branch information
illicitonion authored Mar 7, 2018
1 parent c9d56a2 commit ee2c5e0
Show file tree
Hide file tree
Showing 7 changed files with 249 additions and 1,103 deletions.
5 changes: 4 additions & 1 deletion build-support/bin/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ fi
if [[ "${skip_rust_tests:-false}" == "false" ]]; then
start_travis_section "RustTests" "Running Pants rust tests"
(
"${REPO_ROOT}/src/rust/engine/run-all-tests.sh"
source "${REPO_ROOT}/build-support/pants_venv"
source "${REPO_ROOT}/build-support/bin/native/bootstrap.sh"
activate_pants_venv
RUST_BACKTRACE=1 PANTS_SRCPATH="${REPO_ROOT}/src/python" ensure_cffi_sources=1 run_cargo test "${MODE_FLAG}" --all --manifest-path="${REPO_ROOT}/src/rust/engine/Cargo.toml"
) || die "Pants rust test failure"
end_travis_section
fi
Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function build_pants_packages() {
RUST_BACKTRACE=1 PANTS_SRCPATH="${ROOT}/src/python" run_cargo build --release --manifest-path="${ROOT}/src/rust/engine/fs/fs_util/Cargo.toml"
dst_dir="${DEPLOY_DIR}/bin/fs_util/$("${ROOT}/build-support/bin/get_os.sh")/${version}"
mkdir -p "${dst_dir}"
cp "${ROOT}/src/rust/engine/fs/fs_util/target/release/fs_util" "${dst_dir}/"
cp "${ROOT}/src/rust/engine/target/release/fs_util" "${dst_dir}/"
) || die "Failed to build fs_util"
end_travis_section

Expand Down
Loading

0 comments on commit ee2c5e0

Please sign in to comment.