Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use getrandom crate #62082

Closed
wants to merge 22 commits into from
Closed

Use getrandom crate #62082

wants to merge 22 commits into from

Conversation

newpavlov
Copy link
Contributor

@newpavlov newpavlov commented Jun 23, 2019

Closes: #62079

@rust-highfive
Copy link
Collaborator

r? @kennytm

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 23, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:07e084c1:start=1561307337608009318,finish=1561307338481649161,duration=873639843
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
####################################################################      95.8%
######################################################################## 100.0%
[00:02:06] extracting /checkout/obj/build/cache/2019-05-23/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:02:06]     Updating crates.io index
[00:02:27] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:27] Build completed unsuccessfully in 0:00:46
[00:02:27] make: *** [prepare] Error 1
[00:02:27] Makefile:69: recipe for target 'prepare' failed
[00:02:28] Command failed. Attempt 2/5:
[00:02:28] Command failed. Attempt 2/5:
[00:02:28]     Updating crates.io index
[00:02:29] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:29] Build completed unsuccessfully in 0:00:00
[00:02:29] Makefile:69: recipe for target 'prepare' failed
[00:02:29] make: *** [prepare] Error 1
[00:02:31] Command failed. Attempt 3/5:
[00:02:31] Command failed. Attempt 3/5:
[00:02:31]     Updating crates.io index
[00:02:31] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:31] Build completed unsuccessfully in 0:00:00
[00:02:31] Makefile:69: recipe for target 'prepare' failed
[00:02:31] make: *** [prepare] Error 1
[00:02:34] Command failed. Attempt 4/5:
[00:02:34] Command failed. Attempt 4/5:
[00:02:34]     Updating crates.io index
[00:02:35] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:35] Build completed unsuccessfully in 0:00:00
[00:02:35] make: *** [prepare] Error 1
[00:02:35] Makefile:69: recipe for target 'prepare' failed
[00:02:39] Command failed. Attempt 5/5:
[00:02:39] Command failed. Attempt 5/5:
[00:02:39]     Updating crates.io index
[00:02:39] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:39] Build completed unsuccessfully in 0:00:00
[00:02:39] Makefile:69: recipe for target 'prepare' failed
[00:02:39] The command has failed after 5 attempts.
[00:02:39] make: *** [prepare] Error 1
---
travis_time:end:002a65dc:start=1561307510311420840,finish=1561307510316179069,duration=4758229
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:10441196
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:27e6c4e4
travis_time:start:27e6c4e4
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1eba544b
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

Co-Authored-By: Joe ST <joe@fbstj.net>
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:02f67a5c:start=1561318618410054327,finish=1561318620673307163,duration=2263252836
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
################################################                          66.8%
######################################################################## 100.0%
[00:02:02] extracting /checkout/obj/build/cache/2019-05-23/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:02:02]     Updating crates.io index
[00:02:21] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:21] Build completed unsuccessfully in 0:00:35
[00:02:21] make: *** [prepare] Error 1
[00:02:21] Makefile:69: recipe for target 'prepare' failed
[00:02:22] Command failed. Attempt 2/5:
[00:02:22] Command failed. Attempt 2/5:
[00:02:22]     Updating crates.io index
[00:02:23] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:23] Build completed unsuccessfully in 0:00:00
[00:02:23] make: *** [prepare] Error 1
[00:02:23] Makefile:69: recipe for target 'prepare' failed
[00:02:25] Command failed. Attempt 3/5:
[00:02:25] Command failed. Attempt 3/5:
[00:02:25]     Updating crates.io index
[00:02:25] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:25] Build completed unsuccessfully in 0:00:00
[00:02:25] make: *** [prepare] Error 1
[00:02:25] Makefile:69: recipe for target 'prepare' failed
[00:02:28] Command failed. Attempt 4/5:
[00:02:28] Command failed. Attempt 4/5:
[00:02:28]     Updating crates.io index
[00:02:29] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:29] Build completed unsuccessfully in 0:00:00
[00:02:29] Makefile:69: recipe for target 'prepare' failed
[00:02:29] make: *** [prepare] Error 1
[00:02:33] Command failed. Attempt 5/5:
[00:02:33] Command failed. Attempt 5/5:
[00:02:33]     Updating crates.io index
[00:02:33] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:02:33] Build completed unsuccessfully in 0:00:00
[00:02:33] make: *** [prepare] Error 1
[00:02:33] Makefile:69: recipe for target 'prepare' failed
[00:02:33] The command has failed after 5 attempts.
---
travis_time:end:113e305f:start=1561318786598508711,finish=1561318786605512513,duration=7003802
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:2873d831
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:109f8597
travis_time:start:109f8597
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:058329dd
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kennytm kennytm added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 23, 2019
src/libstd/sys/windows/pipe.rs Outdated Show resolved Hide resolved
src/libstd/collections/hash/map.rs Outdated Show resolved Hide resolved
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:25185900:start=1561377658942348717,finish=1561377748990608061,duration=90048259344
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:01:09] 
######################################################################## 100.0%
[00:01:09] extracting /checkout/obj/build/cache/2019-05-23/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:09]     Updating crates.io index
[00:01:29] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:29] Build completed unsuccessfully in 0:00:33
[00:01:29] make: *** [prepare] Error 1
[00:01:29] Makefile:69: recipe for target 'prepare' failed
[00:01:30] Command failed. Attempt 2/5:
[00:01:30] Command failed. Attempt 2/5:
[00:01:30]     Updating crates.io index
[00:01:31] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:31] Build completed unsuccessfully in 0:00:00
[00:01:31] make: *** [prepare] Error 1
[00:01:31] Makefile:69: recipe for target 'prepare' failed
[00:01:33] Command failed. Attempt 3/5:
[00:01:33] Command failed. Attempt 3/5:
[00:01:33]     Updating crates.io index
[00:01:33] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:33] Build completed unsuccessfully in 0:00:00
[00:01:33] Makefile:69: recipe for target 'prepare' failed
[00:01:33] make: *** [prepare] Error 1
[00:01:36] Command failed. Attempt 4/5:
[00:01:36] Command failed. Attempt 4/5:
[00:01:36]     Updating crates.io index
[00:01:37] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:37] Build completed unsuccessfully in 0:00:00
[00:01:37] make: *** [prepare] Error 1
[00:01:37] Makefile:69: recipe for target 'prepare' failed
[00:01:41] Command failed. Attempt 5/5:
[00:01:41] Command failed. Attempt 5/5:
[00:01:41]     Updating crates.io index
[00:01:41] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:41] Build completed unsuccessfully in 0:00:00
[00:01:41] make: *** [prepare] Error 1
[00:01:41] Makefile:69: recipe for target 'prepare' failed
[00:01:41] The command has failed after 5 attempts.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@newpavlov
Copy link
Contributor Author

BTW can you help with updating Cargo.lock? cargo update -p getrandom does not work for me, and instead returns: "error: failed to read /home/newpavlov/projects/rust/temp/rust/src/tools/clippy/Cargo.toml". Hopefully this will not conflict with #61393.

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:04ef53ec:start=1561381100243087267,finish=1561381190736450864,duration=90493363597
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
#########################################################                 79.5%
######################################################################## 100.0%
[00:01:14] extracting /checkout/obj/build/cache/2019-05-23/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:14]     Updating crates.io index
[00:01:43] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:43] Build completed unsuccessfully in 0:00:46
[00:01:43] make: *** [prepare] Error 1
[00:01:43] Makefile:69: recipe for target 'prepare' failed
[00:01:44] Command failed. Attempt 2/5:
[00:01:44] Command failed. Attempt 2/5:
[00:01:44]     Updating crates.io index
[00:01:44] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:44] Build completed unsuccessfully in 0:00:00
[00:01:44] make: *** [prepare] Error 1
[00:01:44] Makefile:69: recipe for target 'prepare' failed
[00:01:46] Command failed. Attempt 3/5:
[00:01:46] Command failed. Attempt 3/5:
[00:01:46]     Updating crates.io index
[00:01:47] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:47] Build completed unsuccessfully in 0:00:00
[00:01:47] Makefile:69: recipe for target 'prepare' failed
[00:01:47] make: *** [prepare] Error 1
[00:01:50] Command failed. Attempt 4/5:
[00:01:50] Command failed. Attempt 4/5:
[00:01:50]     Updating crates.io index
[00:01:50] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:50] Build completed unsuccessfully in 0:00:00
[00:01:50] make: *** [prepare] Error 1
[00:01:50] Makefile:69: recipe for target 'prepare' failed
[00:01:54] Command failed. Attempt 5/5:
[00:01:54] Command failed. Attempt 5/5:
[00:01:54]     Updating crates.io index
[00:01:55] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:55] Build completed unsuccessfully in 0:00:00
[00:01:55] make: *** [prepare] Error 1
[00:01:55] Makefile:69: recipe for target 'prepare' failed
[00:01:55] The command has failed after 5 attempts.
---
travis_time:end:00b53aff:start=1561381319153985322,finish=1561381319159402554,duration=5417232
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:01e40ee0
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:04981a94
travis_time:start:04981a94
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0a81c644
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@Centril
Copy link
Contributor

Centril commented Jun 25, 2019

If we do this then I feel that getrandom should be moved to rust-lang/rust so that the libs team can have some supervision over the crate.

@newpavlov
Copy link
Contributor Author

Do you mean moved to rust-lang organization? I don't see why it should be specifically part of rust-lang/rust.

@dhardy
What do you think? Are you willing to transfer getrandom repository if needed?

@dhardy
Copy link
Contributor

dhardy commented Jun 25, 2019

That would be one less thing I need to keep an eye on, so fine by me. But what about you — you did much of the work on this. Also @josephlr has done a lot of work on the crate recently.

The other thing worth mentioning is rust-random/getrandom#21 — not my idea, but previously the idea of adding some type of getrandom function into std was going around. (Personally I see no reason for this over the separate getrandom crate however.)

@newpavlov
Copy link
Contributor Author

newpavlov commented Jun 25, 2019

I think that moving it to rust-lang will improve visibility of the crate and will help with reviews, so personally I am all for it (I mean moving crate to rust-lang org, not copy-pasting code into rust-lang/rust). Note that this PR and parent issue do not propose to expose getrandom as part of std public API, as I believe it will require a dedicated RFC.

src/libstd/collections/hash/map.rs Outdated Show resolved Hide resolved
src/libstd/collections/hash/map.rs Outdated Show resolved Hide resolved
@@ -24,6 +24,7 @@ compiler_builtins = { version = "0.1.16" }
profiler_builtins = { path = "../libprofiler_builtins", optional = true }
unwind = { path = "../libunwind" }
hashbrown = { version = "0.4.0", features = ['rustc-dep-of-std'] }
getrandom = "0.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caveat: this won't work on bare WASM since getrandom currently requires a feature flag to enable either stdweb or wasm_bindgen. There was mention of making wasm_bindgen the default; we might want to do this first?

Copy link
Contributor Author

@newpavlov newpavlov Jun 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would prefer if a separate target will be introduced and wasm32-unknown-wunknown will stay assumptions-free regarding executor environment.

Copy link
Contributor Author

@newpavlov newpavlov Jun 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC without enabled stdweb or wasm_bindgen features outside of WASI and Emscripten it will use a dummy impl, so it will work in the same way as it does today by using a constant seed value.

@RalfJung
Copy link
Member

RalfJung commented Jun 25, 2019

Heads-up: this will use SecRandomCopyBytes from libstd on macOS. Last time that was tried is in #59879. You will certainly probably have to adapt the build.rs like it was done there, to make sure libstd links against the right things. But last time that lead to regressions and the entire thing got dropped.

@dhardy
Copy link
Contributor

dhardy commented Jun 25, 2019

Interesting. Then we should also CC @ebarnard and consider whether we want to adjust getrandom to use /dev/urandom for MacOS?

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:1ce392e0:start=1561456759084248455,finish=1561456849928813315,duration=90844564860
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:01:08] 
######################################################################## 100.0%
[00:01:09] extracting /checkout/obj/build/cache/2019-05-23/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
[00:01:09]     Updating crates.io index
[00:01:29] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:29] Build completed unsuccessfully in 0:00:33
[00:01:29] Makefile:69: recipe for target 'prepare' failed
[00:01:29] make: *** [prepare] Error 1
[00:01:30] Command failed. Attempt 2/5:
[00:01:30] Command failed. Attempt 2/5:
[00:01:30]     Updating crates.io index
[00:01:31] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:31] Build completed unsuccessfully in 0:00:00
[00:01:31] make: *** [prepare] Error 1
[00:01:31] Makefile:69: recipe for target 'prepare' failed
[00:01:33] Command failed. Attempt 3/5:
[00:01:33] Command failed. Attempt 3/5:
[00:01:33]     Updating crates.io index
[00:01:33] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:33] Build completed unsuccessfully in 0:00:00
[00:01:33] Makefile:69: recipe for target 'prepare' failed
[00:01:33] make: *** [prepare] Error 1
[00:01:36] Command failed. Attempt 4/5:
[00:01:36] Command failed. Attempt 4/5:
[00:01:37]     Updating crates.io index
[00:01:37] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:37] Build completed unsuccessfully in 0:00:00
[00:01:37] make: *** [prepare] Error 1
[00:01:37] Makefile:69: recipe for target 'prepare' failed
[00:01:41] Command failed. Attempt 5/5:
[00:01:41] Command failed. Attempt 5/5:
[00:01:41]     Updating crates.io index
[00:01:41] error: the lock file /checkout/Cargo.lock needs to be updated but --locked was passed to prevent this
[00:01:41] Build completed unsuccessfully in 0:00:00
[00:01:41] make: *** [prepare] Error 1
[00:01:41] Makefile:69: recipe for target 'prepare' failed
[00:01:41] The command has failed after 5 attempts.
---
travis_time:end:12abf7ce:start=1561456961554700755,finish=1561456961560821379,duration=6120624
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0d66650c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:11c042be
travis_time:start:11c042be
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:09ff4f08
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

src/libstd/sys/windows/pipe.rs Outdated Show resolved Hide resolved
src/libstd/sys/windows/pipe.rs Outdated Show resolved Hide resolved
src/libstd/collections/hash/map.rs Outdated Show resolved Hide resolved
src/libstd/collections/hash/map.rs Outdated Show resolved Hide resolved
Co-Authored-By: Oliver Middleton <olliemail27@gmail.com>
@rust-highfive
Copy link
Collaborator

The job mingw-check of your PR failed (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-08-14T15:46:58.8115807Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-14T15:46:58.8318686Z ##[command]git config gc.auto 0
2019-08-14T15:46:58.8386664Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-14T15:46:58.8452917Z ##[command]git config --get-all http.proxy
2019-08-14T15:46:58.8607373Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/62082/merge:refs/remotes/pull/62082/merge
---
2019-08-14T15:47:34.4038518Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-14T15:47:34.4038550Z 
2019-08-14T15:47:34.4038787Z   git checkout -b <new-branch-name>
2019-08-14T15:47:34.4038820Z 
2019-08-14T15:47:34.4038887Z HEAD is now at 9f36e1f2b Merge 4f3e2a0bd91c6b12d3538a73b0fe2c04008ac49d into c43d03a19f326f4a323569328cc501e86eb6d22e
2019-08-14T15:47:34.4207476Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-14T15:47:34.4210486Z ==============================================================================
2019-08-14T15:47:34.4210543Z Task         : Bash
2019-08-14T15:47:34.4210606Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-14T15:52:54.8701884Z 
2019-08-14T15:52:54.9080590Z error: Could not compile `std`.
2019-08-14T15:52:54.9080752Z 
2019-08-14T15:52:54.9081022Z To learn more, run the command again with --verbose.
2019-08-14T15:52:54.9113537Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
2019-08-14T15:52:54.9124608Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2019-08-14T15:52:54.9124944Z Build completed unsuccessfully in 0:02:42
2019-08-14T15:52:54.9184144Z == clock drift check ==
2019-08-14T15:52:54.9196552Z   local time: Wed Aug 14 15:52:54 UTC 2019
2019-08-14T15:52:54.9196552Z   local time: Wed Aug 14 15:52:54 UTC 2019
2019-08-14T15:52:54.9623795Z   network time: Wed, 14 Aug 2019 15:52:54 GMT
2019-08-14T15:52:54.9624878Z == end clock drift check ==
2019-08-14T15:53:00.7515980Z ##[error]Bash exited with code '1'.
2019-08-14T15:53:00.7549268Z ##[section]Starting: Checkout
2019-08-14T15:53:00.7551065Z ==============================================================================
2019-08-14T15:53:00.7551139Z Task         : Get sources
2019-08-14T15:53:00.7551183Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@newpavlov
Copy link
Contributor Author

It's alive!

@sfackler
I think you can now remove S-blocked tag.

@@ -25,6 +25,9 @@ profiler_builtins = { path = "../libprofiler_builtins", optional = true }
unwind = { path = "../libunwind" }
hashbrown = { version = "0.4.0", features = ['rustc-dep-of-std'] }

[target.'cfg(not(all(target_arch = "wasm32", target_vendor = "unknown", target_os = "unknown")))'.dependencies]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the usage of if cfg! the getrandom crate needs to be avialable on wasm32-unknown-unknown, and I think that's fine in that this header shouldn't be necessary anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without an enabled dummy,stdweb or wasm-bindgen feature the current version of getrandom will emit a compilation error when compiled for wasm32-unknown-unknown. If I am not mistaken without this config getrandom will be compiled unconditionally even if it was not used in the crate.

let mut buf = [0u8; 16];
// Use a constant seed on wasm32-unknown-unknown.
// `cfg(target = "..")` does not work right now, see:
// https://github.com/rust-lang/rust/issues/63217
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second part of this comment can be removed, it's fine to just say that on wasm32-unknown-unknown we skip this.

@alexcrichton
Copy link
Member

I think the wasi dependency will need the same treatement for rustc-dep-of-std features and whatnot to build on the wasi target. Otherwise this PR I think still needs:

  • The libs team needs to decide that we'd like to move forward with this
  • A decision needs to be made about where getrandom is located and maintained (since it's a dependency of libstd)
  • A review of the current code in getrandom needs to be done (probably by a libs team member)

@newpavlov
Copy link
Contributor Author

newpavlov commented Aug 14, 2019

I think the wasi dependency will need the same treatement for rustc-dep-of-std features

Ah, I will try to prepare a PR then, either way it would've been needed for future removal of WASI Core API from libc. getrandom does not have to cascade rustc-dep-of-std feature to libc and wasi, since it will be enabled by libstd's Cargo.toml, right?

The libs team needs to decide that we'd like to move forward with this

Do you have an approximate estimate regarding how long this decision would take?

A decision needs to be made about where getrandom is located and maintained (since it's a dependency of libstd)

As we have said earlier, we don't have any objections against transferring the repository to the rust-lang org. So I guess after a positive decision it can be done right away.

target_os = "unknown",
))) {
getrandom::getrandom(&mut buf).unwrap();
}
Copy link
Member

@cuviper cuviper Aug 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On wasm32-unknown-unknown, this will effectively be:

if false {
    getrandom::getrandom(&mut buf).unwrap();
}

... so it does require the getrandom dependency, even though this is dead code.

If you #[cfg(...)] gate this expression instead, it won't always need getrandom.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But IIUC Cargo determines crates to be compiled only by looking at Cargo.toml, without taking crate code into account. So even if a dependency is not used, it will be still compiled, which in our case means a compilation error.

I forgot that we can use cfg like this:

#[cfg(..)]
getrandom::getrandom(&mut buf).unwrap();

I will replace those lines in the next commit.

@dhardy
Copy link
Contributor

dhardy commented Aug 15, 2019

A decision needs to be made about where getrandom is located and maintained (since it's a dependency of libstd)

I also have no objection to this. Given however how active the https://github.com/rust-random/getrandom repository has been lately, perhaps it's sensible to wait until changes have slowed down somewhat? I don't believe we're likely to see too many more changes now, but there are still a couple of open PRs (e.g. VxWorks support), while the recently adopted error representation is still in dispute (though I think it unlikely to see significant revision).

@alexcrichton
Copy link
Member

@newpavlov

Ah, I will try to prepare a PR then, either way it would've been needed for future removal of WASI Core API from libc. getrandom does not have to cascade rustc-dep-of-std feature to libc and wasi, since it will be enabled by libstd's Cargo.toml, right?

Either way's fine, I don't have a preference how it's cascaded it just needs to be somehow :). It's probably easiest if getrandom forwards the feature.

Do you have an approximate estimate regarding how long this decision would take?

Currently the libs team meets every other week, but next week is Rustconf so we're unlikely to meet. The next meeting is on September 4. This PR already has an extremely long discussion history and is difficult to follow, so it would be best if there could be a write-up of what's happening here, why, etc, that the libs team could review. It would probably be best to place that somewhere separate like an issue writeup so we can FCP merge it to not block on a synchronous meeting.

As we have said earlier, we don't have any objections against transferring the repository to the rust-lang org. So I guess after a positive decision it can be done right away.

Yes sorry I don't mean to invalidate what was said earlier, just that the libs team needs to make a decision one way or another and that hasn't happened yet.

@bors
Copy link
Contributor

bors commented Aug 16, 2019

☔ The latest upstream changes (presumably #63640) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -1050,11 +1050,14 @@ dependencies = [

[[package]]
name = "getrandom"
version = "0.1.8"
version = "0.1.9"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update Cargo.lock here, as 0.1.9 has been yanked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can wait until landing of VxWorks support.

@alexcrichton alexcrichton added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Aug 19, 2019
This was referenced Aug 27, 2019
@Mark-Simulacrum Mark-Simulacrum removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Oct 24, 2019
@Mark-Simulacrum
Copy link
Member

There doesn't appear to be any movement here in the past ~2 months so I'm going to close this and we can reopen when/if we're ready to move forward.

It looks like the immediate action here is to open an issue with a concrete description of what all has happened on this PR (rationale, decisions, etc), which can then be moved into FCP by libs team after some discussion.

@Mark-Simulacrum Mark-Simulacrum added S-blocked-closed and removed S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). labels Oct 24, 2019
@newpavlov newpavlov deleted the getrandom branch December 19, 2020 06:19
@newpavlov
Copy link
Contributor Author

FYI: I have created #80149 instead of updating this PR.

@jyn514 jyn514 added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-blocked-closed labels Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use getrandom crate for retrieving system entropy?