From b8fbeeabc2be4cc3c05f4f53a119384961bc8ced Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Mon, 5 Aug 2019 03:21:42 -0700 Subject: [PATCH 1/4] Add rustc-dep-of-std feature This is how `libc` and `hashbrown` support being dependancies of `libstd`. This allows `getrandom` to use `core` normally, and use the sysroot `core` when building `libstd`. --- Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 5e1f1380..b2c4ff28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,10 @@ members = ["tests/wasm_bindgen"] log = { version = "0.4", optional = true } cfg-if = "0.1" +# When built as part of libstd +compiler_builtins = { version = "0.1", optional = true } +core = { version = "1.0", optional = true, package = "rustc-std-workspace-core" } + [target.'cfg(any(unix, target_os = "redox", target_os = "wasi"))'.dependencies] libc = "0.2.60" @@ -30,3 +34,5 @@ stdweb = { version = "0.4.18", optional = true } [features] std = [] +# Unstable feature to support being a libstd dependancy +rustc-dep-of-std = ["compiler_builtins", "core"] From 490b0704ccca5a5d3a7a8753af0167a9992ef0af Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Mon, 5 Aug 2019 11:29:01 -0700 Subject: [PATCH 2/4] Update .travis.yml --- .travis.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8200f2b4..3e5dac2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ matrix: - cargo test --examples # remove cached documentation, otherwise files from previous PRs can get included - rm -rf target/doc - - cargo doc --no-deps --all --all-features + - cargo doc --no-deps --all --features=std - cargo deadlinks --dir target/doc # also test minimum dependency versions are usable - cargo generate-lockfile -Z minimal-versions @@ -64,7 +64,7 @@ matrix: - cargo test --examples # remove cached documentation, otherwise files from previous PRs can get included - rm -rf target/doc - - cargo doc --no-deps --all --all-features + - cargo doc --no-deps --all --features=std - cargo deadlinks --dir target/doc # also test minimum dependency versions are usable - cargo generate-lockfile -Z minimal-versions @@ -115,25 +115,25 @@ matrix: - rustup component add rust-src - cargo install cargo-xbuild || true script: - - cargo build --target=x86_64-sun-solaris --all-features - - cargo build --target=x86_64-unknown-cloudabi --all-features - - cargo build --target=x86_64-unknown-freebsd --all-features - - cargo build --target=x86_64-fuchsia --all-features - - cargo build --target=x86_64-unknown-netbsd --all-features - # - cargo build --target=x86_64-unknown-redox --all-features - - cargo build --target=x86_64-fortanix-unknown-sgx --all-features + - cargo build --target=x86_64-sun-solaris + - cargo build --target=x86_64-unknown-cloudabi + - cargo build --target=x86_64-unknown-freebsd + - cargo build --target=x86_64-fuchsia + - cargo build --target=x86_64-unknown-netbsd + # - cargo build --target=x86_64-unknown-redox + - cargo build --target=x86_64-fortanix-unknown-sgx - cargo xbuild --target=x86_64-unknown-uefi - cargo xbuild --target=x86_64-unknown-hermit - cargo xbuild --target=x86_64-unknown-l4re-uclibc # also test minimum dependency versions are usable - cargo generate-lockfile -Z minimal-versions - - cargo build --target=x86_64-sun-solaris --all-features - - cargo build --target=x86_64-unknown-cloudabi --all-features - - cargo build --target=x86_64-unknown-freebsd --all-features - - cargo build --target=x86_64-fuchsia --all-features - - cargo build --target=x86_64-unknown-netbsd --all-features - # - cargo build --target=x86_64-unknown-redox --all-features - - cargo build --target=x86_64-fortanix-unknown-sgx --all-features + - cargo build --target=x86_64-sun-solaris + - cargo build --target=x86_64-unknown-cloudabi + - cargo build --target=x86_64-unknown-freebsd + - cargo build --target=x86_64-fuchsia + - cargo build --target=x86_64-unknown-netbsd + # - cargo build --target=x86_64-unknown-redox + - cargo build --target=x86_64-fortanix-unknown-sgx - cargo xbuild --target=x86_64-unknown-uefi - cargo xbuild --target=x86_64-unknown-hermit - cargo xbuild --target=x86_64-unknown-l4re-uclibc From 3f0d224b4ac34790867da14cc366d379b7926d04 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Mon, 5 Aug 2019 14:23:54 -0700 Subject: [PATCH 3/4] Build with std and log --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e5dac2f..e3a9f155 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ matrix: - cargo test --examples # remove cached documentation, otherwise files from previous PRs can get included - rm -rf target/doc - - cargo doc --no-deps --all --features=std + - cargo doc --no-deps --all --features=std,log - cargo deadlinks --dir target/doc # also test minimum dependency versions are usable - cargo generate-lockfile -Z minimal-versions @@ -64,7 +64,7 @@ matrix: - cargo test --examples # remove cached documentation, otherwise files from previous PRs can get included - rm -rf target/doc - - cargo doc --no-deps --all --features=std + - cargo doc --no-deps --all --features=std,log - cargo deadlinks --dir target/doc # also test minimum dependency versions are usable - cargo generate-lockfile -Z minimal-versions From 2cb8f618807061542d366f595b22b533fc5a69bd Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Tue, 6 Aug 2019 01:45:04 -0700 Subject: [PATCH 4/4] Update Redox comment --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e3a9f155..c47d3f74 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,7 +102,7 @@ matrix: - rust: nightly env: DESCRIPTION="cross-platform build only" - # Redox: wait for https://github.com/rust-lang/rust/issues/60139 + # libc on Redox is broken: see https://github.com/rust-lang/libc/pull/1450 install: - rustup target add x86_64-sun-solaris - rustup target add x86_64-unknown-cloudabi