Skip to content

Commit f39e8ea

Browse files
authored
Remove linux_rustix opt-in backend (#573)
As suggested [here](#572 (review)) it may be worth to remove `linux_rustix` from the v0.3.0 release. We probably will either return it in v0.3.1, or will introduce a different `linux_raw` opt-in backend (see #572).
1 parent d337f1a commit f39e8ea

File tree

9 files changed

+2
-62
lines changed

9 files changed

+2
-62
lines changed

.github/workflows/build.yml

-3
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,6 @@ jobs:
121121
- env:
122122
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_getrandom"
123123
run: cargo build --target=${{ matrix.target }} --features=std
124-
- env:
125-
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_rustix"
126-
run: cargo build --target=${{ matrix.target }} --features=std
127124
- env:
128125
RUSTFLAGS: -Dwarnings --cfg getrandom_test_linux_fallback
129126
run: cargo build --features=std

.github/workflows/nopanic.yaml

-7
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ jobs:
4949
- name: Check (linux_android.rs)
5050
run: (exit $( grep -c panic target/release/libgetrandom_wrapper.so ))
5151

52-
- name: Build (linux_rustix.rs)
53-
env:
54-
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_rustix"
55-
run: cargo build --release
56-
- name: Check (linux_rustix.rs)
57-
run: (exit $( grep -c panic target/release/libgetrandom_wrapper.so ))
58-
5952
- name: Build (rdrand.rs)
6053
env:
6154
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="rdrand"

.github/workflows/tests.yml

-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ jobs:
5656
- env:
5757
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_getrandom"
5858
run: cargo test --target=${{ matrix.target }} --features=std
59-
- env:
60-
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_rustix"
61-
run: cargo test --target=${{ matrix.target }} --features=std
6259
- env:
6360
RUSTFLAGS: -Dwarnings --cfg getrandom_test_linux_fallback
6461
run: cargo test --features=std

.github/workflows/workspace.yml

-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ jobs:
5757
env:
5858
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_getrandom"
5959
run: cargo clippy --target x86_64-unknown-linux-gnu
60-
- name: Linux (linux_rustix.rs)
61-
env:
62-
RUSTFLAGS: -Dwarnings --cfg getrandom_backend="linux_rustix"
63-
run: cargo clippy --target x86_64-unknown-linux-gnu
6460
- name: Linux (linux_android_with_fallback.rs)
6561
run: cargo clippy --target x86_64-unknown-linux-gnu
6662
- name: NetBSD (netbsd.rs)

CHANGELOG.md

-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3636
- `getrandom_backend` configuration flag for selection of opt-in backends [#504]
3737
- `Error::new_custom` method [#507]
3838
- `rndr` opt-in backend [#512]
39-
- `linux_rustix` opt-in backend [#520]
4039
- Automatic MemorySanitizer support [#521] [#571]
4140
- `u32` and `u64` functions for generating random values of the respective type [#544]
4241

@@ -52,7 +51,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5251
[#504]: https://github.com/rust-random/getrandom/pull/504
5352
[#507]: https://github.com/rust-random/getrandom/pull/507
5453
[#512]: https://github.com/rust-random/getrandom/pull/512
55-
[#520]: https://github.com/rust-random/getrandom/pull/520
5654
[#521]: https://github.com/rust-random/getrandom/pull/521
5755
[#522]: https://github.com/rust-random/getrandom/pull/522
5856
[#532]: https://github.com/rust-random/getrandom/pull/532

Cargo.toml

+2-6
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,9 @@ compiler_builtins = { version = "0.1", optional = true }
1919
core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
2020

2121
# linux_android / linux_android_with_fallback
22-
[target.'cfg(all(any(target_os = "linux", target_os = "android"), not(any(target_env = "", getrandom_backend = "linux_rustix", getrandom_backend = "custom"))))'.dependencies]
22+
[target.'cfg(all(any(target_os = "linux", target_os = "android"), not(any(target_env = "", getrandom_backend = "custom"))))'.dependencies]
2323
libc = { version = "0.2.154", default-features = false }
2424

25-
# linux_rustix
26-
[target.'cfg(all(any(target_os = "linux", target_os = "android"), any(target_env = "", getrandom_backend = "linux_rustix")))'.dependencies]
27-
rustix = { version = "0.38.38", default-features = false, features = ["rand"] }
28-
2925
# apple-other
3026
[target.'cfg(any(target_os = "ios", target_os = "visionos", target_os = "watchos", target_os = "tvos"))'.dependencies]
3127
libc = { version = "0.2.154", default-features = false }
@@ -80,7 +76,7 @@ rustc-dep-of-std = ["dep:compiler_builtins", "dep:core"]
8076
[lints.rust.unexpected_cfgs]
8177
level = "warn"
8278
check-cfg = [
83-
'cfg(getrandom_backend, values("custom", "rdrand", "rndr", "linux_getrandom", "linux_rustix", "wasm_js", "esp_idf"))',
79+
'cfg(getrandom_backend, values("custom", "rdrand", "rndr", "linux_getrandom", "wasm_js", "esp_idf"))',
8480
'cfg(getrandom_msan)',
8581
'cfg(getrandom_test_linux_fallback)',
8682
'cfg(getrandom_test_netbsd_fallback)',

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ of randomness based on their specific needs:
7979
| Backend name | Target | Target Triple | Implementation
8080
| ----------------- | -------------------- | ------------------------ | --------------
8181
| `linux_getrandom` | Linux, Android | `*‑linux‑*` | [`getrandom`][1] system call (without `/dev/urandom` fallback). Bumps minimum supported Linux kernel version to 3.17 and Android API level to 23 (Marshmallow).
82-
| `linux_rustix` | Linux, Android | `*‑linux‑*` | Same as `linux_getrandom`, but uses [`rustix`] instead of `libc`.
8382
| `rdrand` | x86, x86-64 | `x86_64-*`, `i686-*` | [`RDRAND`] instruction
8483
| `rndr` | AArch64 | `aarch64-*` | [`RNDR`] register
8584
| `esp_idf` | ESP-IDF | `*‑espidf` | [`esp_fill_random`]. WARNING: can return low-quality entropy without proper hardware configuration!
@@ -346,7 +345,6 @@ dual licensed as above, without any additional terms or conditions.
346345
[platform-support]: https://doc.rust-lang.org/stable/rustc/platform-support.html
347346
[WASI]: https://github.com/CraneStation/wasi
348347
[Emscripten]: https://www.hellorust.com/setup/emscripten/
349-
[`rustix`]: https://docs.rs/rustix
350348

351349
[//]: # (licenses)
352350

src/backends.rs

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ cfg_if! {
1313
} else if #[cfg(getrandom_backend = "linux_getrandom")] {
1414
mod linux_android;
1515
pub use linux_android::*;
16-
} else if #[cfg(getrandom_backend = "linux_rustix")] {
17-
mod linux_rustix;
18-
pub use linux_rustix::*;
1916
} else if #[cfg(getrandom_backend = "rdrand")] {
2017
mod rdrand;
2118
pub use rdrand::*;

src/backends/linux_rustix.rs

-32
This file was deleted.

0 commit comments

Comments
 (0)