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

rustbuild fixes #66834

Merged
merged 2 commits into from
Dec 2, 2019
Merged

rustbuild fixes #66834

merged 2 commits into from
Dec 2, 2019

Conversation

infinity0
Copy link
Contributor

When upgrading Debian's rustc to 1.38 I needed these patches:

(1) In order to cross-compile rustc 1.38 and take it through the full rustbuild process including install, I needed the first patch.

(2) In order to build rustc 1.38 using rustc 1.38 itself I need to set --cap-lints warn, otherwise I get this error:

error: unnecessary `unsafe` block
   --> src/bootstrap/builder.rs:148:19
    |
148 |             name: unsafe { ::std::intrinsics::type_name::<S>() },
    |                   ^^^^^^ unnecessary `unsafe` block
    |
note: lint level defined here
   --> src/bootstrap/lib.rs:107:9
    |
107 | #![deny(warnings, rust_2018_idioms, unused_lifetimes)]
    |         ^^^^^^^^
    = note: `#[deny(unused_unsafe)]` implied by `#[deny(warnings)]`

error: aborting due to previous error

error: could not compile `bootstrap`.

In order to set --cap-lints warn however, I need bootstrap.py not to clobber RUSTFLAGS. (This worked previously, not sure if it was broken intentionally but we would like support for it.)

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(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 Nov 28, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.0 of your PR failed (pretty log, 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-11-28T10:16:35.5938549Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-11-28T10:16:35.5953353Z ##[command]git config gc.auto 0
2019-11-28T10:16:35.5957117Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-11-28T10:16:35.5960445Z ##[command]git config --get-all http.proxy
2019-11-28T10:16:35.5964501Z ##[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/66834/merge:refs/remotes/pull/66834/merge
---
2019-11-28T10:19:51.7647569Z extracting /checkout/obj/build/cache/2019-11-06/cargo-beta-x86_64-unknown-linux-gnu.tar.gz
2019-11-28T10:19:51.7666280Z Traceback (most recent call last):
2019-11-28T10:19:51.7666357Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:19:51.7666405Z     main()
2019-11-28T10:19:51.7666500Z   File "/checkout/src/bootstrap/bootstrap.py", line 910, in main
2019-11-28T10:19:51.7666550Z     bootstrap(help_triggered)
2019-11-28T10:19:51.7666598Z   File "/checkout/src/bootstrap/bootstrap.py", line 881, in bootstrap
2019-11-28T10:19:51.7666645Z     build.build_bootstrap()
2019-11-28T10:19:51.7666741Z   File "/checkout/src/bootstrap/bootstrap.py", line 646, in build_bootstrap
2019-11-28T10:19:51.7667193Z     env["RUSTFLAGS"] += " -Cdebuginfo=2"
2019-11-28T10:19:51.7667424Z KeyError: 'RUSTFLAGS'
2019-11-28T10:19:51.7713154Z Makefile:67: recipe for target 'prepare' failed
2019-11-28T10:19:52.7733465Z Command failed. Attempt 2/5:
2019-11-28T10:19:52.8113424Z Traceback (most recent call last):
2019-11-28T10:19:52.8114503Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:19:52.8114503Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:19:52.8115182Z     main()
2019-11-28T10:19:52.8115601Z   File "/checkout/src/bootstrap/bootstrap.py", line 910, in main
2019-11-28T10:19:52.8115958Z     bootstrap(help_triggered)
2019-11-28T10:19:52.8116033Z   File "/checkout/src/bootstrap/bootstrap.py", line 881, in bootstrap
2019-11-28T10:19:52.8119871Z     build.build_bootstrap()
2019-11-28T10:19:52.8120036Z   File "/checkout/src/bootstrap/bootstrap.py", line 646, in build_bootstrap
2019-11-28T10:19:52.8122649Z     env["RUSTFLAGS"] += " -Cdebuginfo=2"
2019-11-28T10:19:52.8122959Z KeyError: 'RUSTFLAGS'
2019-11-28T10:19:52.8153382Z make: *** [prepare] Error 1
2019-11-28T10:19:54.8169282Z Command failed. Attempt 3/5:
2019-11-28T10:19:54.8596667Z Traceback (most recent call last):
2019-11-28T10:19:54.8596887Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:19:54.8596887Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:19:54.8596936Z     main()
2019-11-28T10:19:54.8596981Z   File "/checkout/src/bootstrap/bootstrap.py", line 910, in main
2019-11-28T10:19:54.8602198Z     bootstrap(help_triggered)
2019-11-28T10:19:54.8602859Z   File "/checkout/src/bootstrap/bootstrap.py", line 881, in bootstrap
2019-11-28T10:19:54.8603102Z     build.build_bootstrap()
2019-11-28T10:19:54.8603443Z   File "/checkout/src/bootstrap/bootstrap.py", line 646, in build_bootstrap
2019-11-28T10:19:54.8607192Z     env["RUSTFLAGS"] += " -Cdebuginfo=2"
2019-11-28T10:19:54.8607815Z KeyError: 'RUSTFLAGS'
2019-11-28T10:19:54.8638491Z make: *** [prepare] Error 1
2019-11-28T10:19:57.8655841Z Command failed. Attempt 4/5:
2019-11-28T10:19:57.9026927Z Traceback (most recent call last):
2019-11-28T10:19:57.9027968Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:19:57.9027968Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:19:57.9030639Z     main()
2019-11-28T10:19:57.9030845Z   File "/checkout/src/bootstrap/bootstrap.py", line 910, in main
2019-11-28T10:19:57.9031223Z     bootstrap(help_triggered)
2019-11-28T10:19:57.9031361Z   File "/checkout/src/bootstrap/bootstrap.py", line 881, in bootstrap
2019-11-28T10:19:57.9034267Z     build.build_bootstrap()
2019-11-28T10:19:57.9034481Z   File "/checkout/src/bootstrap/bootstrap.py", line 646, in build_bootstrap
2019-11-28T10:19:57.9035257Z     env["RUSTFLAGS"] += " -Cdebuginfo=2"
2019-11-28T10:19:57.9035744Z KeyError: 'RUSTFLAGS'
2019-11-28T10:19:57.9060993Z make: *** [prepare] Error 1
2019-11-28T10:20:01.9079527Z Command failed. Attempt 5/5:
2019-11-28T10:20:01.9500743Z Traceback (most recent call last):
2019-11-28T10:20:01.9501503Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:20:01.9501503Z   File "/checkout/src/bootstrap/bootstrap.py", line 927, in <module>
2019-11-28T10:20:01.9501838Z     main()
2019-11-28T10:20:01.9502066Z   File "/checkout/src/bootstrap/bootstrap.py", line 910, in main
2019-11-28T10:20:01.9505062Z     bootstrap(help_triggered)
2019-11-28T10:20:01.9505388Z   File "/checkout/src/bootstrap/bootstrap.py", line 881, in bootstrap
2019-11-28T10:20:01.9509261Z     build.build_bootstrap()
2019-11-28T10:20:01.9509655Z   File "/checkout/src/bootstrap/bootstrap.py", line 646, in build_bootstrap
2019-11-28T10:20:01.9510532Z     env["RUSTFLAGS"] += " -Cdebuginfo=2"
2019-11-28T10:20:01.9511044Z KeyError: 'RUSTFLAGS'
2019-11-28T10:20:01.9539619Z make: *** [prepare] Error 1
2019-11-28T10:20:01.9543071Z The command has failed after 5 attempts.
2019-11-28T10:20:01.9543634Z == clock drift check ==
2019-11-28T10:20:01.9550285Z   local time: Thu Nov 28 10:20:01 UTC 2019
2019-11-28T10:20:01.9550285Z   local time: Thu Nov 28 10:20:01 UTC 2019
2019-11-28T10:20:02.2244561Z   network time: Thu, 28 Nov 2019 10:20:02 GMT
2019-11-28T10:20:02.2246075Z == end clock drift check ==
2019-11-28T10:20:13.6150519Z 
2019-11-28T10:20:13.6245811Z ##[error]Bash exited with code '1'.
2019-11-28T10:20:13.6282970Z ##[section]Starting: Checkout
2019-11-28T10:20:13.6308149Z ==============================================================================
2019-11-28T10:20:13.6308196Z Task         : Get sources
2019-11-28T10:20:13.6308263Z 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)

compiler: self.compiler,
});
install_rustc(builder, self.compiler.stage, self.target);
for host in &builder.hosts {
Copy link
Member

Choose a reason for hiding this comment

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

Is it plausible that this should happen for the other steps here? If so, we can likely achieve that by changing the macro a bit.

Currently it has:

                run.builder.ensure($name {
                    compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.build),
                    target: run.target,
                });

For "only_hosts" steps, this will run with target = host for each host already. I think then the only difference is previously we were running the dist::Rustc step always with the "build" triple compiler, whereas the new code runs it with the host triple compiler. If I understand what's going on, then the code you've added could also be something like this, and without the loop, and still work.

            builder.ensure(dist::Rustc {
                compiler: builder.compiler(builder.top_stage, self.target),
            });
            install_rustc(builder, self.compiler.stage, self.target);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the alternate suggestion. I've verified this works and updated my commits.

@Mark-Simulacrum
Copy link
Member

I'm going to @bors r+ this.

However, I think it would be good to try to go a bit further if you have the time with the install.rs file and try and get a framework of some kind for what the intent is behind our mix of only_hosts/target/host installs; currently it seems to be rather ad-hoc (basically each one does something a little different it looks like). I think unifying that is likely a good goal, though I'm not sure how we'd do so -- maybe inspiration from other compiler installers can be taken, or rustup itself. I don't have the time to do much more than review though :)

@bors
Copy link
Contributor

bors commented Dec 1, 2019

📌 Commit 0533249 has been approved by Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 1, 2019

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 1, 2019
RalfJung added a commit to RalfJung/rust that referenced this pull request Dec 2, 2019
rustbuild fixes

When upgrading Debian's rustc to 1.38 I needed these patches:

(1) In order to cross-compile rustc 1.38 and take it through the full rustbuild process including install, I needed the first patch.

(2) In order to build rustc 1.38 using rustc 1.38 itself I need to set --cap-lints warn, otherwise I get this error:

~~~~
error: unnecessary `unsafe` block
   --> src/bootstrap/builder.rs:148:19
    |
148 |             name: unsafe { ::std::intrinsics::type_name::<S>() },
    |                   ^^^^^^ unnecessary `unsafe` block
    |
note: lint level defined here
   --> src/bootstrap/lib.rs:107:9
    |
107 | #![deny(warnings, rust_2018_idioms, unused_lifetimes)]
    |         ^^^^^^^^
    = note: `#[deny(unused_unsafe)]` implied by `#[deny(warnings)]`

error: aborting due to previous error

error: could not compile `bootstrap`.

~~~~

In order to set --cap-lints warn however, I need bootstrap.py not to clobber RUSTFLAGS. (This worked previously, not sure if it was broken intentionally but we would like support for it.)
RalfJung added a commit to RalfJung/rust that referenced this pull request Dec 2, 2019
rustbuild fixes

When upgrading Debian's rustc to 1.38 I needed these patches:

(1) In order to cross-compile rustc 1.38 and take it through the full rustbuild process including install, I needed the first patch.

(2) In order to build rustc 1.38 using rustc 1.38 itself I need to set --cap-lints warn, otherwise I get this error:

~~~~
error: unnecessary `unsafe` block
   --> src/bootstrap/builder.rs:148:19
    |
148 |             name: unsafe { ::std::intrinsics::type_name::<S>() },
    |                   ^^^^^^ unnecessary `unsafe` block
    |
note: lint level defined here
   --> src/bootstrap/lib.rs:107:9
    |
107 | #![deny(warnings, rust_2018_idioms, unused_lifetimes)]
    |         ^^^^^^^^
    = note: `#[deny(unused_unsafe)]` implied by `#[deny(warnings)]`

error: aborting due to previous error

error: could not compile `bootstrap`.

~~~~

In order to set --cap-lints warn however, I need bootstrap.py not to clobber RUSTFLAGS. (This worked previously, not sure if it was broken intentionally but we would like support for it.)
RalfJung added a commit to RalfJung/rust that referenced this pull request Dec 2, 2019
rustbuild fixes

When upgrading Debian's rustc to 1.38 I needed these patches:

(1) In order to cross-compile rustc 1.38 and take it through the full rustbuild process including install, I needed the first patch.

(2) In order to build rustc 1.38 using rustc 1.38 itself I need to set --cap-lints warn, otherwise I get this error:

~~~~
error: unnecessary `unsafe` block
   --> src/bootstrap/builder.rs:148:19
    |
148 |             name: unsafe { ::std::intrinsics::type_name::<S>() },
    |                   ^^^^^^ unnecessary `unsafe` block
    |
note: lint level defined here
   --> src/bootstrap/lib.rs:107:9
    |
107 | #![deny(warnings, rust_2018_idioms, unused_lifetimes)]
    |         ^^^^^^^^
    = note: `#[deny(unused_unsafe)]` implied by `#[deny(warnings)]`

error: aborting due to previous error

error: could not compile `bootstrap`.

~~~~

In order to set --cap-lints warn however, I need bootstrap.py not to clobber RUSTFLAGS. (This worked previously, not sure if it was broken intentionally but we would like support for it.)
bors added a commit that referenced this pull request Dec 2, 2019
Rollup of 5 pull requests

Successful merges:

 - #66245 (Conditional compilation for sanitizers)
 - #66654 (Handle const-checks for `&mut` outside of `HasMutInterior`)
 - #66822 (libunwind_panic: adjust miri panic hack)
 - #66827 (handle diverging functions forwarding their return place)
 - #66834 (rustbuild fixes)

Failed merges:

r? @ghost
@bors bors merged commit 0533249 into rust-lang:master Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants