Skip to content

Commit b8a3563

Browse files
committed
docs: update README.md
Update readme to show that nightly is no longer needed (but recommended for build-std). Also added a tip about using --exclude-cpu-features to avoid compilation errors when std::arch:: macros are not caught up to rustc's supported features.
1 parent ca1800b commit b8a3563

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,16 @@ cargo install --locked cargo-multivers
5353
## Usage
5454

5555
```bash
56-
cargo +nightly multivers
56+
cargo multivers
5757
```
5858

59+
When using the nightly toolchain (e.g. `cargo +nightly multivers`) you might run into compilation errors complaining that a feature is unknown
60+
(e.g. `error: unknown x86 target feature: lahfsahf`).
61+
This is caused by nightly `rustc` supporting more features than `std::arch::is_{arch}_feature_detected!` macros do.
62+
63+
This can be solved by running `multivers` with `--exclude-cpu-features`, passing all the problematic features to the flag.
64+
_(the problematic features can't be hard-coded because, over time, `std::arch` macros catch up, and more features get added to `rustc`)_
65+
5966
## Supported Operating Systems
6067

6168
This project is tested on Windows and Linux (due to the use of `memfd_create`, only Linux >= v3.17 is supported).
@@ -99,8 +106,7 @@ lto = "thin"
99106

100107
If you want to publish an optimized portable binary built by `cargo-multivers` when releasing a new version of your project,
101108
you can use the `cargo-multivers` GitHub Action.
102-
To do that you need to have a Rust nightly toolchain
103-
and add a step to your job:
109+
To do that you need to add a step to your job:
104110

105111
```yaml
106112
- uses: ronnychevalier/cargo-multivers@main
@@ -116,10 +122,10 @@ jobs:
116122
steps:
117123
- name: Checkout repository
118124
uses: actions/checkout@v5
119-
- name: Install Rust nightly
125+
- name: Install Rust stable
120126
uses: dtolnay/rust-toolchain@master
121127
with:
122-
toolchain: nightly
128+
toolchain: stable
123129
- uses: ronnychevalier/cargo-multivers@main
124130
with:
125131
manifest_path: path/to-your/Cargo.toml

0 commit comments

Comments
 (0)