Skip to content

Commit 9a48bfa

Browse files
authored
Merge pull request rust-random#198 from rust-random/hermit
Add fixes for Caching and rustc-dep-of-std feature
2 parents 347a300 + 3661e9d commit 9a48bfa

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
profile: minimal
2424
toolchain: nightly # Needed for -Z minimal-versions
2525
override: true
26+
- uses: Swatinem/rust-cache@v1
2627
- name: Install precompiled cargo-deadlinks
2728
run: |
2829
export URL=$(curl -s https://api.github.com/repos/deadlinks/cargo-deadlinks/releases/latest | jq -r '.assets[] | select(.name | contains("cargo-deadlinks-linux")) | .browser_download_url')
@@ -52,6 +53,7 @@ jobs:
5253
profile: minimal
5354
toolchain: ${{ matrix.toolchain }}
5455
override: true
56+
- uses: Swatinem/rust-cache@v1
5557
- run: cargo test
5658
- run: cargo test --features=std
5759
- run: cargo test --features=custom # custom should do nothing here
@@ -75,6 +77,7 @@ jobs:
7577
profile: minimal
7678
target: ${{ matrix.target }}
7779
toolchain: stable
80+
- uses: Swatinem/rust-cache@v1
7881
- name: Install multilib
7982
# update is needed to fix the 404 error on install, see:
8083
# https://github.com/actions/virtual-environments/issues/675
@@ -102,6 +105,7 @@ jobs:
102105
profile: minimal
103106
target: ${{ matrix.target }}
104107
toolchain: stable
108+
- uses: Swatinem/rust-cache@v1
105109
- name: Build Tests
106110
run: cargo test --no-run --target=${{ matrix.target }} --features=std
107111

@@ -123,6 +127,7 @@ jobs:
123127
profile: minimal
124128
toolchain: ${{ matrix.toolchain }}
125129
override: true
130+
- uses: Swatinem/rust-cache@v1
126131
- run: cargo test --features=std
127132

128133
cross-tests:
@@ -142,6 +147,7 @@ jobs:
142147
profile: minimal
143148
target: ${{ matrix.target }}
144149
toolchain: stable
150+
- uses: Swatinem/rust-cache@v1
145151
- name: Install precompiled cross
146152
run: |
147153
export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
@@ -167,6 +173,7 @@ jobs:
167173
profile: minimal
168174
target: ${{ matrix.target }}
169175
toolchain: stable
176+
- uses: Swatinem/rust-cache@v1
170177
- name: Install precompiled cross
171178
run: |
172179
export URL=$(curl -s https://api.github.com/repos/rust-embedded/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
@@ -186,6 +193,7 @@ jobs:
186193
profile: minimal
187194
target: wasm32-unknown-unknown
188195
toolchain: stable
196+
- uses: Swatinem/rust-cache@v1
189197
- name: Install precompiled wasm-bindgen-test-runner
190198
run: |
191199
export VERSION=$(cargo metadata --format-version=1 | jq -r '.packages[] | select ( .name == "wasm-bindgen" ) | .version')
@@ -215,6 +223,7 @@ jobs:
215223
profile: minimal
216224
target: wasm32-wasi
217225
toolchain: stable
226+
- uses: Swatinem/rust-cache@v1
218227
- name: Install precompiled wasmtime
219228
run: |
220229
export URL=$(curl -s https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-linux.tar.xz")) | .browser_download_url')
@@ -236,6 +245,7 @@ jobs:
236245
toolchain: stable
237246
- run: rustup target add wasm32-unknown-emscripten
238247
- run: rustup target add asmjs-unknown-emscripten
248+
- uses: Swatinem/rust-cache@v1
239249
- name: Cache emsdk
240250
id: cache-emsdk
241251
uses: actions/cache@v2
@@ -276,6 +286,7 @@ jobs:
276286
target: ${{ matrix.target }}
277287
toolchain: nightly # Required to build libc for Redox
278288
override: true
289+
- uses: Swatinem/rust-cache@v1
279290
- name: Build
280291
run: cargo build --target=${{ matrix.target }} --features=std
281292

@@ -291,6 +302,7 @@ jobs:
291302
toolchain: nightly # Required to build libcore
292303
components: rust-src
293304
override: true
305+
- uses: Swatinem/rust-cache@v1
294306
- name: UEFI (RDRAND)
295307
run: cargo build -Z build-std=core --features=rdrand --target=x86_64-unknown-uefi
296308
- name: Hermit (RDRAND)
@@ -313,6 +325,7 @@ jobs:
313325
toolchain: nightly
314326
components: rustfmt, clippy
315327
override: true
328+
- uses: Swatinem/rust-cache@v1
316329
- name: clippy
317330
run: cargo clippy --all --features=custom,std
318331
- name: fmt

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ js = ["wasm-bindgen", "js-sys"]
3939
# Feature to enable custom RNG implementations
4040
custom = []
4141
# Unstable feature to support being a libstd dependency
42-
rustc-dep-of-std = ["compiler_builtins", "core"]
42+
rustc-dep-of-std = [
43+
"compiler_builtins",
44+
"core",
45+
"libc/rustc-dep-of-std",
46+
"wasi/rustc-dep-of-std",
47+
]
4348
# Unstable/test-only feature to run wasm-bindgen tests in a browser
4449
test-in-browser = []
4550

0 commit comments

Comments
 (0)