diff options
| author | Marc Khouri <mnck@google.com> | 2024-04-26 00:58:13 +0200 |
|---|---|---|
| committer | Erick Tryzelaar <etryzelaar@google.com> | 2024-05-07 17:29:38 +0000 |
| commit | f44d611d85e4f580733e82f8f3bff1d9c7616510 (patch) | |
| tree | 7a4fd3ae19c69d484f445c32f8f56e2fbb21d519 /src/doc/rustc | |
| parent | cc8d9b692720c7d15445024485c4bbfce35dbce6 (diff) | |
| download | rust-f44d611d85e4f580733e82f8f3bff1d9c7616510.tar.gz rust-f44d611d85e4f580733e82f8f3bff1d9c7616510.zip | |
Fuchsia test runner: fixup script
This commit fixes several issues in the fuchsia-test-runner.py script: 1. Migrate from `pm` to `ffx` for package management, as `pm` is now deprecated. Furthermore, the `pm` calls used in this script no longer work at Fuchsia's HEAD. This is the largest change in this commit, and impacts all steps around repository management (creation and registration of the repo, as well as package publishing). 2. Allow for `libtest` to be either statically or dynamically linked. The script assumed it was dynamically linked, but the current Rust behavior at HEAD is to statically link it. 3. Minor cleanup to use `ffx --machine json` rather than string parsing. 4. Minor cleanup to the docs around the script.
Diffstat (limited to 'src/doc/rustc')
| -rw-r--r-- | src/doc/rustc/src/platform-support/fuchsia.md | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/doc/rustc/src/platform-support/fuchsia.md b/src/doc/rustc/src/platform-support/fuchsia.md index 34ab3cdaf25..9c2e05b57f5 100644 --- a/src/doc/rustc/src/platform-support/fuchsia.md +++ b/src/doc/rustc/src/platform-support/fuchsia.md @@ -683,25 +683,37 @@ cd ${RUST_SRC_PATH} To run the Rust test suite on an emulated Fuchsia device, you'll also need to download a copy of the Fuchsia SDK. The current minimum supported SDK version is -[10.20221207.2.89][minimum_supported_sdk_version]. +[20.20240412.3.1][minimum_supported_sdk_version]. -[minimum_supported_sdk_version]: https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/core/linux-amd64/+/version:10.20221207.2.89 +[minimum_supported_sdk_version]: https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/core/linux-amd64/+/version:20.20240412.3.1 Fuchsia's test runner interacts with the Fuchsia emulator and is located at -`src/ci/docker/scripts/fuchsia-test-runner.py`. We can use it to start our -test environment with: +`src/ci/docker/scripts/fuchsia-test-runner.py`. First, add the following +variables to your existing `config-env.sh`: + +```sh +# TEST_TOOLCHAIN_TMP_DIR can point anywhere, but it: +# - must be less than 108 characters, otherwise qemu can't handle the path +# - must be consistent across calls to this file (don't use `mktemp -d` here) +export TEST_TOOLCHAIN_TMP_DIR="/tmp/rust-tmp" + +# Keep existing contents of `config-env.sh` from earlier, including SDK_PATH +``` + +We can then use the script to start our test environment with: ```sh ( \ + source config-env.sh && \ src/ci/docker/scripts/fuchsia-test-runner.py start \ --rust-build ${RUST_SRC_PATH}/build \ --sdk ${SDK_PATH} \ --target {x86_64-unknown-fuchsia|aarch64-unknown-fuchsia} \ + --verbose \ ) ``` -Where `${RUST_SRC_PATH}/build` is the `build-dir` set in `config.toml` and -`${SDK_PATH}` is the path to the downloaded and unzipped SDK. +Where `${RUST_SRC_PATH}/build` is the `build-dir` set in `config.toml`. Once our environment is started, we can run our tests using `x.py` as usual. The test runner script will run the compiled tests on an emulated Fuchsia device. To |
