Skip to content

Commit 037e8bd

Browse files
bors[bot]Disasm
andcommitted
Merge #22
22: Update CI, add MSRV policy r=dvc94ch a=Disasm Co-authored-by: Vadim Kaushan <[email protected]>
2 parents 2450868 + 7d4919a commit 037e8bd

File tree

4 files changed

+48
-50
lines changed

4 files changed

+48
-50
lines changed

.travis.yml

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
language: rust
22

3-
matrix:
4-
include:
5-
#- env: TARGET=x86_64-unknown-linux-gnu
6-
# if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
3+
env:
4+
- TARGET=x86_64-unknown-linux-gnu
5+
- TARGET=riscv32imac-unknown-none-elf
76

8-
#- env: TARGET=riscv32imac-unknown-none-elf
9-
# if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
7+
rust:
8+
- nightly
9+
- stable
10+
- 1.30.0 # MSRV
1011

11-
#- env: TARGET=x86_64-unknown-linux-gnu
12-
# rust: beta
13-
# if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
14-
15-
#- env: TARGET=riscv32imac-unknown-none-elf
16-
# rust: beta
17-
# if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
18-
19-
- env: TARGET=x86_64-unknown-linux-gnu
20-
rust: nightly
21-
if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
22-
23-
- env: TARGET=riscv32imac-unknown-none-elf
24-
rust: nightly
25-
if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
12+
if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
2613

14+
matrix:
15+
include:
2716
- env: TARGET=riscv64imac-unknown-none-elf
2817
rust: nightly
2918
if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
@@ -32,26 +21,23 @@ matrix:
3221
rust: nightly
3322
if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
3423

35-
- env: TARGET=x86_64-unknown-linux-gnu
36-
rust: stable
37-
if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
38-
39-
- env: TARGET=riscv32imac-unknown-none-elf
40-
rust: stable
24+
- env: CHECK_BLOBS=1
25+
rust:
26+
language: bash
4127
if: (branch = staging OR branch = trying OR branch = master) OR (type = pull_request AND branch = master)
4228

43-
before_install: set -e
4429

4530
install:
46-
- bash ci/install.sh
47-
- export PATH="$PATH:$PWD/gcc/bin"
31+
- ci/install.sh
4832

4933
script:
50-
- bash ci/script.sh
34+
- ci/script.sh
5135

52-
after_script: set +e
5336

54-
cache: cargo
37+
cache:
38+
cargo: true
39+
directories:
40+
- gcc
5541
before_cache:
5642
# Travis can't cache files that are not readable by "others"
5743
- chmod -R a+r $HOME/.cargo

ci/install.sh

100644100755
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
set -euxo pipefail
1+
#!/usr/bin/env bash
22

3-
main() {
4-
if [ $TARGET != x86_64-unknown-linux-gnu ]; then
5-
rustup target add $TARGET
6-
fi
3+
set -euxo pipefail
74

8-
mkdir gcc
9-
curl -L https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.1.0-2018.12.0-x86_64-linux-ubuntu14.tar.gz | tar --strip-components=1 -C gcc -xz
10-
}
5+
if [ -n "${TARGET:-}" ]; then
6+
rustup target add $TARGET
7+
fi
118

12-
main
9+
if [ -n "${CHECK_BLOBS:-}" ]; then
10+
if [ ! -d gcc/bin ]; then
11+
mkdir -p gcc
12+
curl -L https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.1.0-2018.12.0-x86_64-linux-ubuntu14.tar.gz | tar --strip-components=1 -C gcc -xz
13+
fi
14+
fi

ci/script.sh

100644100755
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
#!/usr/bin/env bash
2+
13
set -euxo pipefail
24

3-
main() {
5+
if [ -n "${TARGET:-}" ]; then
46
cargo check --target $TARGET
57

68
if [ $TRAVIS_RUST_VERSION = nightly ]; then
79
cargo check --target $TARGET --features inline-asm
810
fi
11+
fi
912

10-
if [ $TARGET = x86_64-unknown-linux-gnu ]; then
11-
./check-blobs.sh
12-
fi
13-
}
14-
15-
main
13+
if [ -n "${CHECK_BLOBS:-}" ]; then
14+
PATH="$PATH:$PWD/gcc/bin"
15+
./check-blobs.sh
16+
fi

src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
//! Low level access to RISC-V processors
22
//!
3+
//! # Minimum Supported Rust Version (MSRV)
4+
//!
5+
//! This crate is guaranteed to compile on stable Rust 1.30 and up. It *might*
6+
//! compile with older versions but that may change in any new patch release.
7+
//! Note that `riscv64imac-unknown-none-elf` and `riscv64gc-unknown-none-elf` targets
8+
//! are not supported on stable yet.
9+
//!
10+
//! # Features
11+
//!
312
//! This crate provides:
413
//!
5-
//! - Access to core registers like mstatus or mcause.
14+
//! - Access to core registers like `mstatus` or `mcause`.
615
//! - Interrupt manipulation mechanisms.
716
//! - Wrappers around assembly instructions like `WFI`.
817

0 commit comments

Comments
 (0)