Skip to content

Commit 98934cb

Browse files
josephlrnewpavlov
authored andcommitted
Add rustc-dep-of-std feature (#78)
1 parent b69f832 commit 98934cb

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

.travis.yml

+17-17
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ matrix:
4646
- cargo test --examples
4747
# remove cached documentation, otherwise files from previous PRs can get included
4848
- rm -rf target/doc
49-
- cargo doc --no-deps --all --all-features
49+
- cargo doc --no-deps --all --features=std,log
5050
- cargo deadlinks --dir target/doc
5151
# also test minimum dependency versions are usable
5252
- cargo generate-lockfile -Z minimal-versions
@@ -64,7 +64,7 @@ matrix:
6464
- cargo test --examples
6565
# remove cached documentation, otherwise files from previous PRs can get included
6666
- rm -rf target/doc
67-
- cargo doc --no-deps --all --all-features
67+
- cargo doc --no-deps --all --features=std,log
6868
- cargo deadlinks --dir target/doc
6969
# also test minimum dependency versions are usable
7070
- cargo generate-lockfile -Z minimal-versions
@@ -102,7 +102,7 @@ matrix:
102102

103103
- rust: nightly
104104
env: DESCRIPTION="cross-platform build only"
105-
# Redox: wait for https://github.com/rust-lang/rust/issues/60139
105+
# libc on Redox is broken: see https://github.com/rust-lang/libc/pull/1450
106106
install:
107107
- rustup target add x86_64-sun-solaris
108108
- rustup target add x86_64-unknown-cloudabi
@@ -115,25 +115,25 @@ matrix:
115115
- rustup component add rust-src
116116
- cargo install cargo-xbuild || true
117117
script:
118-
- cargo build --target=x86_64-sun-solaris --all-features
119-
- cargo build --target=x86_64-unknown-cloudabi --all-features
120-
- cargo build --target=x86_64-unknown-freebsd --all-features
121-
- cargo build --target=x86_64-fuchsia --all-features
122-
- cargo build --target=x86_64-unknown-netbsd --all-features
123-
# - cargo build --target=x86_64-unknown-redox --all-features
124-
- cargo build --target=x86_64-fortanix-unknown-sgx --all-features
118+
- cargo build --target=x86_64-sun-solaris
119+
- cargo build --target=x86_64-unknown-cloudabi
120+
- cargo build --target=x86_64-unknown-freebsd
121+
- cargo build --target=x86_64-fuchsia
122+
- cargo build --target=x86_64-unknown-netbsd
123+
# - cargo build --target=x86_64-unknown-redox
124+
- cargo build --target=x86_64-fortanix-unknown-sgx
125125
- cargo xbuild --target=x86_64-unknown-uefi
126126
- cargo xbuild --target=x86_64-unknown-hermit
127127
- cargo xbuild --target=x86_64-unknown-l4re-uclibc
128128
# also test minimum dependency versions are usable
129129
- cargo generate-lockfile -Z minimal-versions
130-
- cargo build --target=x86_64-sun-solaris --all-features
131-
- cargo build --target=x86_64-unknown-cloudabi --all-features
132-
- cargo build --target=x86_64-unknown-freebsd --all-features
133-
- cargo build --target=x86_64-fuchsia --all-features
134-
- cargo build --target=x86_64-unknown-netbsd --all-features
135-
# - cargo build --target=x86_64-unknown-redox --all-features
136-
- cargo build --target=x86_64-fortanix-unknown-sgx --all-features
130+
- cargo build --target=x86_64-sun-solaris
131+
- cargo build --target=x86_64-unknown-cloudabi
132+
- cargo build --target=x86_64-unknown-freebsd
133+
- cargo build --target=x86_64-fuchsia
134+
- cargo build --target=x86_64-unknown-netbsd
135+
# - cargo build --target=x86_64-unknown-redox
136+
- cargo build --target=x86_64-fortanix-unknown-sgx
137137
- cargo xbuild --target=x86_64-unknown-uefi
138138
- cargo xbuild --target=x86_64-unknown-hermit
139139
- cargo xbuild --target=x86_64-unknown-l4re-uclibc

Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ members = ["tests/wasm_bindgen"]
2121
log = { version = "0.4", optional = true }
2222
cfg-if = "0.1"
2323

24+
# When built as part of libstd
25+
compiler_builtins = { version = "0.1", optional = true }
26+
core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" }
27+
2428
[target.'cfg(any(unix, target_os = "redox", target_os = "wasi"))'.dependencies]
2529
libc = { version = "0.2.60", default-features = false }
2630

@@ -30,3 +34,5 @@ stdweb = { version = "0.4.18", optional = true }
3034

3135
[features]
3236
std = []
37+
# Unstable feature to support being a libstd dependancy
38+
rustc-dep-of-std = ["compiler_builtins", "core"]

0 commit comments

Comments
 (0)