Skip to content

Commit ece43e9

Browse files
authored
Updated CONTRIBUTING.MD for new package name and environment variables (#930)
1 parent 3573dd1 commit ece43e9

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ probably want to check out the repository and make sure that tests pass for you:
66
```
77
$ git clone https://github.com/rust-lang/stdarch
88
$ cd stdarch
9-
$ cargo +nightly test
9+
$ TARGET="<your-target-arch>" ci/run.sh
1010
```
1111

12-
To run codegen tests, run in release mode:
12+
Where `<your-target-arch>` is the target triple as used by `rustup`, e.g. `x86_x64-unknown-linux-gnu` (without any preceding `nightly-` or similar).
13+
Also remember that this repository requires the nightly channel of Rust!
14+
The above tests do in fact require nightly rust to be the default on your system, to set that use `rustup default nightly` (and `rustup default stable` to revert).
1315

14-
```
15-
$ cargo +nightly test --release -p coresimd
16-
```
17-
18-
Remember that this repository requires the nightly channel of Rust! If any of
19-
the above steps don't work, [please let us know][new]!
16+
If any of the above steps don't work, [please let us know][new]!
2017

2118
Next up you can [find an issue][issues] to help out on, we've selected a few
2219
with the [`help wanted`][help] and [`impl-period`][impl] tags which could
@@ -71,10 +68,26 @@ of the [Rust Book] describes the `rustdoc` syntax quite well. As always, feel fr
7168
to [join us on gitter][gitter] and ask us if you hit any snags, and thank you for helping
7269
to improve the documentation of `stdarch`!
7370

71+
# Alternative Testing Instructions
72+
73+
It is generally recommended that you use `ci/run.sh` to run the tests.
74+
However this might not work for you, e.g. if you are on Windows.
75+
76+
In that case you can fall back to running `cargo +nightly test` and `cargo +nightly test --release -p core_arch` for testing the code generation.
77+
Note that these require the nightly toolchain to be installed and for `rustc` to know about your target triple and its CPU.
78+
In particular you need to set the `TARGET` environment variable as you would for `ci/run.sh`.
79+
In addition you need to set `RUSTCFLAGS` (need the `C`) to indicate target features, e.g. `RUSTCFLAGS="-C -target-features=+avx2"`.
80+
You can also set `-C -target-cpu=native` if you're "just" developing against your current CPU.
81+
82+
Be warned that when you use these alternative instructions, [things may go less smoothly than they would with `ci/run.sh`][ci-run-good], e.g. instruction generation tests may fail because the disassembler named them differently, e.g. it may generate `vaesenc` instead of `aesenc` instructions despite them behaving the same.
83+
Also these instructions execute less tests than would normally be done, so don't be surprised that when you eventually pull-request some errors may show up for tests not covered here.
84+
85+
7486
[new]: https://github.com/rust-lang/stdarch/issues/new
7587
[issues]: https://github.com/rust-lang/stdarch/issues
7688
[help]: https://github.com/rust-lang/stdarch/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22
7789
[impl]: https://github.com/rust-lang/stdarch/issues?q=is%3Aissue+is%3Aopen+label%3Aimpl-period
7890
[vendor]: https://github.com/rust-lang/stdarch/issues/40
7991
[Documentation as tests]: https://doc.rust-lang.org/book/first-edition/documentation.html#documentation-as-tests
8092
[Rust Book]: https://doc.rust-lang.org/book/first-edition
93+
[ci-run-good]: https://github.com/rust-lang/stdarch/issues/931#issuecomment-711412126

0 commit comments

Comments
 (0)