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

Help suggests non-existent package std::os::ext::process::CommandExt #55007

Merged
merged 1 commit into from Oct 20, 2018

Conversation

Projects
None yet
6 participants
@davidtwco
Copy link
Member

davidtwco commented Oct 12, 2018

Fixes #39175.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Oct 12, 2018

r? @nikomatsakis

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

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Oct 16, 2018

r? @petrochenkov

Glad to see this getting fixed, @davidtwco =)

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Oct 17, 2018

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 17, 2018

📌 Commit e95472b has been approved by petrochenkov

kennytm added a commit to kennytm/rust that referenced this pull request Oct 18, 2018

Rollup merge of rust-lang#55007 - davidtwco:issue-39175, r=petrochenkov
Help suggests non-existent package std::os::ext::process::CommandExt

Fixes rust-lang#39175.

bors added a commit that referenced this pull request Oct 18, 2018

Auto merge of #55181 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #54300 (Updated RELEASES.md for 1.30.0)
 - #54979 (Custom E0277 diagnostic for `Path`)
 - #55004 (Check the type of statics and constants for `Sized`ness)
 - #55007 (Help suggests non-existent package std::os::ext::process::CommandExt)
 - #55071 (Fix ICE and report a human readable error)
 - #55073 (rustc: Fix (again) simd vectors by-val in ABI)
 - #55144 (Cleanup resolve)
 - #55166 (Don't warn about parentheses on `match (return)`)
 - #55179 (Make OpTy field op public for priroda)

kennytm added a commit to kennytm/rust that referenced this pull request Oct 19, 2018

Rollup merge of rust-lang#55007 - davidtwco:issue-39175, r=petrochenkov
Help suggests non-existent package std::os::ext::process::CommandExt

Fixes rust-lang#39175.

bors added a commit that referenced this pull request Oct 19, 2018

Auto merge of #55194 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #54300 (Updated RELEASES.md for 1.30.0)
 - #55007 (Help suggests non-existent package std::os::ext::process::CommandExt)
 - #55040 (Replace `ParamEnv` with a new type in chalk context.)
 - #55071 (Fix ICE and report a human readable error)
 - #55144 (Cleanup resolve)
 - #55166 (Don't warn about parentheses on `match (return)`)
 - #55169 (Add a `copysign` function to f32 and f64)
 - #55178 (Stabilize slice::chunks_exact(), chunks_exact_mut(), rchunks(), rchunks_mut(), rchunks_exact(), rchunks_exact_mut())
 - #55179 (Make OpTy field op public for priroda)

Failed merges:

r? @ghost
@bors

This comment was marked as outdated.

Copy link
Contributor

bors commented Oct 19, 2018

⌛️ Testing commit e95472b with merge 2ed0b94...

bors added a commit that referenced this pull request Oct 19, 2018

Auto merge of #55007 - davidtwco:issue-39175, r=petrochenkov
Help suggests non-existent package std::os::ext::process::CommandExt

Fixes #39175.
@bors

This comment was marked as outdated.

Copy link
Contributor

bors commented Oct 19, 2018

💔 Test failed - status-appveyor

@kennytm

This comment was marked as resolved.

Copy link
Member

kennytm commented Oct 19, 2018

@bors r-

exec doesn't exist on Windows.

---- [ui] ui\issues\issue-39175.rs stdout ----
diff of stderr:
3	   |
4	LL |     Command::new("echo").arg("hello").exec();
5	   |                                       ^^^^
-	   |
-	   = help: items from traits can only be used if the trait is in scope
-	help: the following trait is implemented but not in scope, perhaps add a `use` for it:
-	   |
-	LL | use std::os::unix::process::CommandExt;
-	   |
12	
13	error: aborting due to previous error
14	

@davidtwco davidtwco force-pushed the davidtwco:issue-39175 branch from e95472b to 7b615f6 Oct 19, 2018

@davidtwco

This comment has been minimized.

Copy link
Member Author

davidtwco commented Oct 19, 2018

Updated the test to only run on unix - this change isn't platform dependent so I think it's fine to not have a corresponding test for a Windows-only extension trait.

@bors r=petrochenkov

@bors

This comment was marked as outdated.

Copy link
Contributor

bors commented Oct 19, 2018

📌 Commit 7b615f6 has been approved by petrochenkov

bors added a commit that referenced this pull request Oct 19, 2018

Auto merge of #55007 - davidtwco:issue-39175, r=petrochenkov
Help suggests non-existent package std::os::ext::process::CommandExt

Fixes #39175.
@bors

This comment was marked as outdated.

Copy link
Contributor

bors commented Oct 19, 2018

💔 Test failed - status-travis

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Oct 19, 2018

The job wasm32-unknown 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.
[00:56:31] ---- [ui] ui/issues/issue-39175.rs stdout ----
[00:56:31] diff of stderr:
[00:56:31] 
[00:56:31] 3    |
[00:56:31] 4 LL |     Command::new("echo").arg("hello").exec();
[00:56:31] -    |
[00:56:31] -    = help: items from traits can only be used if the trait is in scope
[00:56:31] - help: the following trait is implemented but not in scope, perhaps add a `use` for it:
[00:56:31] -    |
[00:56:31] -    |
[00:56:31] - LL | use std::os::unix::process::CommandExt;
[00:56:31] 12 
[00:56:31] 13 error: aborting due to previous error
[00:56:31] 14 
[00:56:31] 
[00:56:31] 
[00:56:31] 
[00:56:31] The actual stderr differed from the expected stderr.
[00:56:31] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-39175/issue-39175.stderr
[00:56:31] To update references, rerun the tests and pass the `--bless` flag
[00:56:31] To only update this specific test, also pass `--test-args issues/issue-39175.rs`
[00:56:31] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:503:22
[00:56:31] error: 1 errors occurred comparing output.
[00:56:31] status: exit code: 1
[00:56:31] status: exit code: 1
[00:56:31] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-39175.rs" "--target=wasm32-unknown-unknown" "--error-format" "json" "-Zui-testing" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-39175/a.wasm" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-39175/auxiliary" "-A" "unused"
[00:56:31] ------------------------------------------
[00:56:31] 
[00:56:31] ------------------------------------------
[00:56:31] stderr:
[00:56:31] stderr:
[00:56:31] ------------------------------------------
[00:56:31] {"message":"no method named `exec` found for type `&mut std::process::Command` in the current scope","code":{"code":"E0599","explanation":"\nThis error occurs when a method is used on a type which doesn't implement it:\n\nErroneous code example:\n\n```compile_fail,E0599\nstruct Mouth;\n\nlet x = Mouth;\nx.chocolate(); // error: no method named `chocolate` found for type `Mouth`\n               //        in the current scope\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-39175.rs","byte_start":837,"byte_end":841,"line_start":21,"line_end":21,"column_start":39,"column_end":43,"is_primary":true,"text":[{"text":"    Command::new(\"echo\").arg(\"hello\").exec();","highlight_start":39,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0599]: no method named `exec` found for type `&mut std::process::Command` in the current scope\n  --> /checkout/src/test/ui/issues/issue-39175.rs:21:39\n   |\nLL |     Command::new(\"echo\").arg(\"hello\").exec();\n   |                                       ^^^^\n\n"}
[00:56:31] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:56:31] {"message":"For more information about this error, try `rustc --explain E0599`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0599`.\n"}
[00:56:31] ------------------------------------------
[00:56:31] 
[00:56:31] thread '[ui] ui/issues/issue-39175.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3284:9
[00:56:31] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:56:31] test result: FAILED. 4589 passed; 1 failed; 46 ignored; 0 measured; 0 filtered out
[00:56:31] 
[00:56:31] 
[00:56:31] 
[00:56:31] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-wasm32-unknown-unknown" "--mode" "ui" "--target" "wasm32-unknown-unknown" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/node-v9.2.0-linux-x64/bin/node" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0svn\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:56:31] 
[00:56:31] 
[00:56:31] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-unknown src/test/run-make src/test/ui src/test/run-pass src/test/compile-fail src/test/parse-fail src/test/mir-opt src/test/codegen-units src/libcore
[00:56:31] Build completed unsuccessfully in 0:53:38
---
travis_time:end:349cd8b0:start=1539954805935518750,finish=1539954805942219611,duration=6700861
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:19f3ecb2
$ 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:000c5afd
travis_time:start:000c5afd
$ 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:049cc332
$ 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)

Only suggest paths that exist.
In order to output a path that could actually be imported (valid and
visible), we need to handle re-exports correctly.

For example, take `std::os::unix::process::CommandExt`, this trait is
actually defined at `std::sys::unix::ext::process::CommandExt` (at time
of writing).

`std::os::unix` rexports the contents of `std::sys::unix::ext`.
`std::sys` is private so the "true" path to `CommandExt` isn't accessible.

In this case, the visible parent map will look something like this:

(child) -> (parent)
`std::sys::unix::ext::process::CommandExt` -> `std::sys::unix::ext::process`
`std::sys::unix::ext::process` -> `std::sys::unix::ext`
`std::sys::unix::ext` -> `std::os`

This is correct, as the visible parent of `std::sys::unix::ext` is in fact
`std::os`.

When printing the path to `CommandExt` and looking at the current
segment that corresponds to `std::sys::unix::ext`, we would normally
print `ext` and then go to the parent - resulting in a mangled path like
`std::os::ext::process::CommandExt`.

Instead, we must detect that there was a re-export and instead print `unix`
(which is the name `std::sys::unix::ext` was re-exported as in `std::os`).

@davidtwco davidtwco force-pushed the davidtwco:issue-39175 branch from 7b615f6 to 4334aaa Oct 19, 2018

@davidtwco

This comment has been minimized.

Copy link
Member Author

davidtwco commented Oct 19, 2018

Updated the test again so it only runs on platforms that other tests using CommandExt run on.

@bors r=petrochenkov

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 19, 2018

📌 Commit 4334aaa has been approved by petrochenkov

@bors

This comment was marked as outdated.

Copy link
Contributor

bors commented Oct 19, 2018

⌛️ Testing commit 4334aaa with merge 734140f...

bors added a commit that referenced this pull request Oct 19, 2018

Auto merge of #55007 - davidtwco:issue-39175, r=petrochenkov
Help suggests non-existent package std::os::ext::process::CommandExt

Fixes #39175.
@bors

This comment was marked as outdated.

Copy link
Contributor

bors commented Oct 19, 2018

💔 Test failed - status-travis

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Oct 19, 2018

The job arm-android 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.
[01:41:52] test time::tests::system_time_elapsed ... ok
[01:41:52] test time::tests::system_time_math ... ok
[01:41:57] test sync::mpsc::tests::stress_recv_timeout_two_threads ... ok
[01:41:59] test collections::hash::map::test_map::test_lots_of_insertions ... ok
[01:42:34] test process::tests::test_process_output_fail_to_start ... test process::tests::test_process_output_fail_to_start has been running for over 60 seconds
No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

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)

@davidtwco

This comment has been minimized.

Copy link
Member Author

davidtwco commented Oct 19, 2018

@bors retry

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 20, 2018

⌛️ Testing commit 4334aaa with merge 89be71a...

bors added a commit that referenced this pull request Oct 20, 2018

Auto merge of #55007 - davidtwco:issue-39175, r=petrochenkov
Help suggests non-existent package std::os::ext::process::CommandExt

Fixes #39175.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Oct 20, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing 89be71a to master...

@bors bors merged commit 4334aaa into rust-lang:master Oct 20, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@davidtwco davidtwco deleted the davidtwco:issue-39175 branch Oct 21, 2018

davidtwco added a commit to davidtwco/rust that referenced this pull request Jan 21, 2019

Print visible name for types as well as modules.
This commit extends previous work in rust-lang#55007 where the name from the
visible parent was used for modules. Now, we also print the name from
the visible parent for types.

davidtwco added a commit to davidtwco/rust that referenced this pull request Jan 21, 2019

Print visible name for types as well as modules.
This commit extends previous work in rust-lang#55007 where the name from the
visible parent was used for modules. Now, we also print the name from
the visible parent for types.

Centril added a commit to Centril/rust that referenced this pull request Jan 25, 2019

Rollup merge of rust-lang#57802 - davidtwco:issue-56943, r=estebank
Print visible name for types as well as modules.

Fixes rust-lang#56943 and fixes rust-lang#57713.

This commit extends previous work in rust-lang#55007 where the name from the
visible parent was used for modules. Now, we also print the name from
the visible parent for types.

r? @estebank

VardhanThigle pushed a commit to jethrogb/rust that referenced this pull request Jan 31, 2019

Print visible name for types as well as modules.
This commit extends previous work in rust-lang#55007 where the name from the
visible parent was used for modules. Now, we also print the name from
the visible parent for types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.