-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
C-bugCategory: bugCategory: bug
Description
Problem
With LTO set to thin
or fat
, doing a cargo build --target riscv32imac-unknown-none-elf
followed by cargo run
followed by cargo build --target riscv32imac-unknown-none-elf
causes Cargo to rebuild some packages even when nothing has changed.
Setting lto="off"
prevents this behavior.
Steps
- Ensure you have the
riscv32imac-unknown-none-elf
toolchain - Clone the
xous-core
repository - Build an example such as
shell
- Run a program
- Rebuild
shell
This series of steps should demonstrate the problem:
rustup target add riscv32imac-unknown-none-elf
git clone https://github.com/betrusted-io/xous-core.git
cd xous-core
git checkout 6cb1aad93ca908bb394b9e7c13274b9f55d5aa8b
cargo build --release --target riscv32imac-unknown-none-elf -p shell
cargo run --release -p tools --bin copy-object
cargo build --release --target riscv32imac-unknown-none-elf -p shell # This will cause a partial rebuild
cargo run --release -p tools --bin copy-object # This will also cause a partial rebuild
Notes
If you modify Cargo.toml
to remove lto="thin"
, or change it to lto="off
", then the issue goes away.
Output of cargo version
: cargo 1.46.0 (149022b 2020-07-17)
This may be due to the fact that cargo run
and cargo build
are targeting different architectures.
Metadata
Metadata
Assignees
Labels
C-bugCategory: bugCategory: bug