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

Properly parse '--extern-private' with name and path #59335

Merged
merged 13 commits into from
Apr 14, 2019

Conversation

Aaron1011
Copy link
Member

It turns out that #57586 didn't properly parse --extern-private name=path.

This PR properly implements the --extern-private option. I've added a new extern-private option to compiletest, which causes an --extern-private option to be passed to the compiler with the proper path.

Part of #44663

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(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 Mar 21, 2019
@petrochenkov petrochenkov self-assigned this Mar 21, 2019
@petrochenkov
Copy link
Contributor

@Aaron1011
It should be possible to test that --extern-private name=PATH is parsed correctly without changing compiletest, by using --extern-private name=/path/to/nowhere.
Regarding the completest support I'd suggest to cooperate with @qmx and to support both --extern and --extern-private properly (i.e. with aux-build integration) in a separate PR, like it was attempted in #54020.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 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:13a2133a:start=1553487148706837675,finish=1553487222355491777,duration=73648654102
$ 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
Setting environment variables from .travis.yml
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:22:46] 
[01:22:46] running 9 tests
[01:22:46] iiiiiiiii
[01:22:46] 
[01:22:46]  finished in 0.174
[01:22:46] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:23:03] 
[01:23:03] running 120 tests
[01:23:29] .iiiii...i.....i..i...i..i.i...i.ii...i.....i..i....i..........iiii..........i...ii...i.......ii.i.i 100/120
[01:23:34] .i......iii.i.....ii
[01:23:34] 
[01:23:34]  finished in 31.254
[01:23:34] travis_fold:end:test_debuginfo

---
[01:44:23]    Compiling rustc v0.0.0 (/checkout/src/librustc)
[01:44:49] error[E0308]: mismatched types
[01:44:49]     --> src/librustc/session/config.rs:2826:29
[01:44:49]      |
[01:44:49] 2826 |                 mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
[01:44:49]      |                             ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `session::config::ExternEntry`, found enum `std::option::Option`
[01:44:49]      = note: expected type `session::config::ExternEntry`
[01:44:49]                 found type `std::option::Option<std::string::String>`
[01:44:49] 
[01:44:49] error[E0308]: mismatched types
[01:44:49] error[E0308]: mismatched types
[01:44:49]     --> src/librustc/session/config.rs:2830:29
[01:44:49]      |
[01:44:49] 2830 |                 mk_set(vec![Some(String::from("e")), Some(String::from("f"))]),
[01:44:49]      |                             ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `session::config::ExternEntry`, found enum `std::option::Option`
[01:44:49]      = note: expected type `session::config::ExternEntry`
[01:44:49]                 found type `std::option::Option<std::string::String>`
[01:44:49] 
[01:44:49] error[E0308]: mismatched types
[01:44:49] error[E0308]: mismatched types
[01:44:49]     --> src/librustc/session/config.rs:2837:29
[01:44:49]      |
[01:44:49] 2837 |                 mk_set(vec![Some(String::from("e")), Some(String::from("f"))]),
[01:44:49]      |                             ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `session::config::ExternEntry`, found enum `std::option::Option`
[01:44:49]      = note: expected type `session::config::ExternEntry`
[01:44:49]                 found type `std::option::Option<std::string::String>`
[01:44:49] 
[01:44:49] error[E0308]: mismatched types
[01:44:49] error[E0308]: mismatched types
[01:44:49]     --> src/librustc/session/config.rs:2841:29
[01:44:49]      |
[01:44:49] 2841 |                 mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
[01:44:49]      |                             ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `session::config::ExternEntry`, found enum `std::option::Option`
[01:44:49]      = note: expected type `session::config::ExternEntry`
[01:44:49]                 found type `std::option::Option<std::string::String>`
[01:44:49] 
[01:44:49] error[E0308]: mismatched types
[01:44:49] error[E0308]: mismatched types
[01:44:49]     --> src/librustc/session/config.rs:2848:29
[01:44:49]      |
[01:44:49] 2848 |                 mk_set(vec![Some(String::from("b")), Some(String::from("c"))]),
[01:44:49]      |                             ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `session::config::ExternEntry`, found enum `std::option::Option`
[01:44:49]      = note: expected type `session::config::ExternEntry`
[01:44:49]                 found type `std::option::Option<std::string::String>`
[01:44:49] 
[01:44:49] error[E0308]: mismatched types
[01:44:49] error[E0308]: mismatched types
[01:44:49]     --> src/librustc/session/config.rs:2852:29
[01:44:49]      |
[01:44:49] 2852 |                 mk_set(vec![Some(String::from("f")), Some(String::from("e"))]),
[01:44:49]      |                             ^^^^^^^^^^^^^^^^^^^^^^^ expected struct `session::config::ExternEntry`, found enum `std::option::Option`
[01:44:49]      = note: expected type `session::config::ExternEntry`
[01:44:49]                 found type `std::option::Option<std::string::String>`
[01:44:49] 
[01:44:59] error: aborting due to 6 previous errors
[01:44:59] error: aborting due to 6 previous errors
[01:44:59] 
[01:44:59] For more information about this error, try `rustc --explain E0308`.
[01:44:59] error: Could not compile `rustc`.
[01:44:59] 
[01:44:59] To learn more, run the command again with --verbose.
[01:44:59] 
[01:44:59] 
[01:44:59] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "-p" "rustc" "--" "--quiet"
[01:44:59] 
[01:44:59] 
[01:44:59] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:44:59] Build completed unsuccessfully in 0:34:06
[01:44:59] Build completed unsuccessfully in 0:34:06
[01:44:59] Makefile:48: recipe for target 'check' failed
[01:44:59] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:04edf182
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Mon Mar 25 05:58:51 UTC 2019
---
travis_time:end:05bb51b8:start=1553493533303017648,finish=1553493533309642338,duration=6624690
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:06ffffb4
$ 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:2b528f1a
travis_time:start:2b528f1a
$ 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:0ccbe73c
$ 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 Mar 30, 2019

Ping from triage, @Aaron1011, you have some test failures.

@Aaron1011 Aaron1011 force-pushed the fix/extern-priv-final branch from 41d3ab2 to 9ebc97a Compare April 1, 2019 19:14
@Aaron1011
Copy link
Member Author

@Centril Fixed

@Centril Centril added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 1, 2019
@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 2, 2019
@petrochenkov
Copy link
Contributor

@Aaron1011
Ah, I see, then "remove commit" -> "cleanup the history to avoid this back and forth", if possible.

@bors delegate+

@bors
Copy link
Contributor

bors commented Apr 14, 2019

✌️ @Aaron1011 can now approve this pull request

On musl (and some other platforms), compiletest ends up creating a static rlib
(instead of a dylib) when building 'aux-build' crates.

This commit changes the '--extern-private' path computed by compiletest
to properly take this into account
@Aaron1011 Aaron1011 force-pushed the fix/extern-priv-final branch from 399439f to 5cd51b1 Compare April 14, 2019 19:46
@Aaron1011
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Apr 14, 2019

📌 Commit 5cd51b1 has been approved by Aaron1011

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 14, 2019
@bors
Copy link
Contributor

bors commented Apr 14, 2019

⌛ Testing commit 5cd51b1 with merge aa99abe...

bors added a commit that referenced this pull request Apr 14, 2019
Properly parse '--extern-private' with name and path

It turns out that #57586 didn't properly parse `--extern-private name=path`.

This PR properly implements the `--extern-private` option. I've added a new `extern-private` option to `compiletest`, which causes an `--extern-private` option to be passed to the compiler with the proper path.

Part of #44663
@bors
Copy link
Contributor

bors commented Apr 14, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Aaron1011
Pushing aa99abe to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 14, 2019
@bors bors merged commit 5cd51b1 into rust-lang:master Apr 14, 2019
@Aaron1011 Aaron1011 deleted the fix/extern-priv-final branch April 14, 2019 22:56
Aaron1011 added a commit to Aaron1011/cargo that referenced this pull request Apr 26, 2019
This is part of rust-lang/rust#44663

This implements the 'frontend' portion of RFC 1977. Once PRs
rust-lang/rust#59335 and
rust-lang/crates.io#1685 are merged,
it will be possible to test the full public-private dependency feature:
marking a dependency a public, seeing exported_private_dependencies
warnings from rustc, and seeing pub-dep-reachability errors from Cargo.

Everything in this commit should be fully backwards-compatible - users
who don't enable the 'public-dependency' cargo feature won't notice any
changes.

Note that this commit does *not* implement the remaining two features of
the RFC:

* Choosing smallest versions when 'cargo publish' is run
* Turning exported_private_dependencies warnings into hard errors when
'cargo publish' is run

The former is a major change to Cargo's behavior, and should be done
in a separate PR with some kind of rollout plan.

The latter is described by the RFC as being enabled at 'some point in
the future'. This can be done via a follow-up PR.
bors added a commit to rust-lang/cargo that referenced this pull request Apr 26, 2019
Implement the 'frontend' of public-private dependencies

This is part of rust-lang/rust#44663

This implements the 'frontend' portion of [RFC 1977](https://github.com/rust-lang/rfcs/blob/master/text/1977-public-private-dependencies.md). Once PRs rust-lang/rust#59335 and rust-lang/crates.io#1685 are merged,
it will be possible to test the full public-private dependency feature:
marking a dependency a public, seeing exported_private_dependencies
warnings from rustc, and seeing pub-dep-reachability errors from Cargo.

Everything in this commit should be fully backwards-compatible - users
who don't enable the 'public-dependency' cargo feature won't notice any
changes.

Note that this commit does *not* implement the remaining two features of
the RFC:

* Choosing smallest versions when 'cargo publish' is run
* Turning exported_private_dependencies warnings into hard errors when 'cargo publish' is run

The former is a major change to Cargo's behavior, and should be done in a separate PR with some kind of rollout plan.

The latter is described by the RFC as being enabled at 'some point in the future'. This can be done via a follow-up PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants