From 230e4f92c3e1d4a05a1974dc215d86c52b7d3877 Mon Sep 17 00:00:00 2001 From: Mo Luo <55039286+moluopro@users.noreply.github.com> Date: Fri, 28 Feb 2025 05:17:43 -0800 Subject: [PATCH] Revised Building.md and improved Building-Dart-SDK-for-ARM-or-RISC-V.md Closes https://github.com/dart-lang/sdk/pull/60225 GitOrigin-RevId: bdd56f7b6587d2d3706bf79daade1507e2fe460c Change-Id: Ib28c88264519f45f821ac3571386520ba5b24000 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412900 Commit-Queue: Slava Egorov Reviewed-by: Slava Egorov --- docs/Building-Dart-SDK-for-ARM-or-RISC-V.md | 14 ++++++++++---- docs/Building.md | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/Building-Dart-SDK-for-ARM-or-RISC-V.md b/docs/Building-Dart-SDK-for-ARM-or-RISC-V.md index 7e33f7bcdbf..6c812584665 100644 --- a/docs/Building-Dart-SDK-for-ARM-or-RISC-V.md +++ b/docs/Building-Dart-SDK-for-ARM-or-RISC-V.md @@ -66,10 +66,10 @@ $ ./tools/linux_dist_support/create_debian_packages.py -a {ia32, x64, arm, arm64 # Testing -In addition to cross-compiling the Dart SDK, test items can also be cross-compiled. Even without the corresponding hardware, you can quickly verify if the source code modifications you made are correct. Below is a simple method for development on the riscv64 platform for your reference. +In addition to cross-compiling the Dart SDK, test items can also be cross-compiled. Even without the corresponding hardware, you can quickly verify if the source code modifications you made are correct. Below is a simple method for development on the RISCV64 platform for your reference. -Cross-compile the test items on x86_64 Linux to riscv64 and perform correctness check: -1. Follow the steps above to cross-compile the riscv64 sdk. +Cross-compile the test items on X64 Linux to RISCV64 and perform correctness check: +1. Follow the steps above to cross-compile the RISCV64 sdk. 2. Cross-compile the test items by running: `./tools/build.py --mode release --arch riscv64 most run_ffi_unit_tests`. 3. Install the necessary QEMU dependencies: `sudo apt install qemu-user qemu-user-static qemu-system`. 4. Run the test items, e.g., `tests/lib`: @@ -85,4 +85,10 @@ export QEMU_LD_PREFIX=/usr/riscv64-linux-gnu --time \ --tasks 8 \ lib -``` \ No newline at end of file +``` + +If you have configured QEMU for RISCV64, you can merge steps 3 and 4 into a single command (omitting some print parameters): + +```bash +./tools/test.py -r vm -m release -a riscv64 --use-qemu lib +``` diff --git a/docs/Building.md b/docs/Building.md index c7c6c8ddb1b..71fd09ff687 100644 --- a/docs/Building.md +++ b/docs/Building.md @@ -219,7 +219,7 @@ Dart2JS example: language ``` -In the above examples: `--progress` is used to style the progress bar in terminal; `--time` is used to print time information; `--tasks` is used to set the number of parallel tasks; you can use `. /tools/test.py --help` for more details. +In the above examples: `--progress` is used to style the progress bar in terminal; `--time` is used to print time information; `--tasks` is used to set the number of parallel tasks; you can use `./tools/test.py --help` for more details. ## Troubleshooting and tips for browser tests To debug a browser test failure, you must start a local http server to serve the test. This is made easy with a helper script in dart/tools/testing. The error report from test.py gives the command line to start the server in a message that reads: