Skip to content

Fix host code appearing in Wasm binaries #137457

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JayAndJef
Copy link

@JayAndJef JayAndJef commented Feb 23, 2025

This is a direct fix for issue 132802.
Followed the outline as follows:

  • give a hard error in bootstrap when using gcc to compile for wasm
  • change our CI to use clang instead of gcc
  • add a test that compiling a sample program for wasm32-unknown doesn't give any linker warnings

The test-various ci job was also changed.

try-job: test-various
try-job: dist-various-1
try-job: dist-various-2
try-job: x86_64-msvc-1

@rustbot
Copy link
Collaborator

rustbot commented Feb 23, 2025

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Kobzol (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Feb 23, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 23, 2025

This PR modifies tests/run-make/. If this PR is trying to port a Makefile
run-make test to use rmake.rs, please update the
run-make port tracking issue
so we can track our progress. You can either modify the tracking issue
directly, or you can comment on the tracking issue and link this PR.

cc @jieyouxu


fn is_gcc_compiler(path: PathBuf, build: &Build) -> bool {
let cc_output = command(&path).arg("--version").run_capture_stdout(build).stdout();
cc_output.contains("GCC")
Copy link
Member

Choose a reason for hiding this comment

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

i don't think this does what you want. on my machine, cc --version prints "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0", even though it's really gcc.

i am not sure how to check this ... maybe the rust equivalent of realpath $(which cc) | rg gcc? or we could check cc.is_like_clang(): https://docs.rs/cc/latest/cc/struct.Tool.html#method.is_like_clang

Copy link
Author

Choose a reason for hiding this comment

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

I'll try to find a gcc-specific flag to run. If all else fails, we can try compiling a C program and check if some headers are defined.

Copy link
Member

Choose a reason for hiding this comment

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

When going down this path I might recommend something like clang -E -dM -x c /dev/null | rg -i clang which will print #define __clang__ 1. That's a test for clang rather than a test for "not gcc" but at this time only clang has support for wasm, so it might work as a detection mechanism nonetheless?

Although IMO rejecting compilers like this is a bit of a tricky business that's bound to have false positives and negatives so personally I'd probably just skip this part and rely on the test you added instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

This can just be a UI test (tests/ui), which are cheaper to run than rmake (one thing to compile rather than 2-3). You'll just need the directives //@ only-wasm32 and //@ compile-flags: -Dlinker-messages.

Please make sure tests have a doc comment describing what they are testing as well.

Copy link
Author

Choose a reason for hiding this comment

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

Got it. I'll rewrite this next week - is there anything else?

Copy link
Author

Choose a reason for hiding this comment

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

Just to be clear - this should be a //@ build-pass test without an expected output, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

That sounds correct 👍

Copy link
Contributor

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

Detecting GCC would be also useful for other things, but it sounds a bit tricky. Left one nit, otherwise the bootstrap changes (modulo GCC detection, which isn't working yet) look fine. I don't know about WASM though, so someone else should look at that.

@@ -314,6 +314,17 @@ than building it.
.entry(*target)
.or_insert_with(|| Target::from_triple(&target.triple));

// compiler-rt c fallbacks for wasm cannot be built with gcc
if (target.triple == "wasm32-unknown-unknown" || target.triple == "wasm32v1-none") // bare metal targets without wasi sdk
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a method to TargetSelection named e.g. is_bare_wasm, or is_wasm_without_wasi or something like that that describes this family of targets?

Copy link
Member

Choose a reason for hiding this comment

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

If going down this compiler-detection route I'd recommend enabling this for all wasm targets, not just the unknown/none targets. The WASI targets have some auto-configuration but the same principle applies here where if gcc is used then that's a bug for WASI as well.

Copy link
Author

Choose a reason for hiding this comment

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

If going down this compiler-detection route I'd recommend enabling this for all wasm targets, not just the unknown/none targets.

Would this entail some sort of check to see if the wasi sdk is using gcc?

Copy link
Member

Choose a reason for hiding this comment

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

In theory (unless I'm misremembering something) nothing more than what's already here other than updating this conditional. The detected compiler for WASI targets should make its way to here and always be clang (wasi-sdk doesn't have gcc and won't for the forseeable future)

@jieyouxu
Copy link
Member

cc @alexcrichton (target maintainer for wasm32-unknown-unknown) in case you have any concerns/feedback

@tgross35
Copy link
Contributor

Detecting GCC would be also useful for other things, but it sounds a bit tricky. Left one nit, otherwise the bootstrap changes (modulo GCC detection, which isn't working yet) look fine. I don't know about WASM though, so someone else should look at that.

cc exposes this functionality, maybe we could wrap that rather than recreating it here?

@jieyouxu
Copy link
Member

cc exposes this functionality, maybe we could wrap that rather than recreating it here?

Do note that bootstrap cc unfortunately has to be pinned to a quite an old version, FWIW.

@JayAndJef
Copy link
Author

Hey yall, just wanted everyone to be aware I'm in a power outage so I probably can't work on this today.

@tgross35
Copy link
Contributor

Hey yall, just wanted everyone to be aware I'm in a power outage so I probably can't work on this today.

There is never any requirement to work on a PR every day, thanks for being active but take your time :)

@JayAndJef
Copy link
Author

There is never any requirement to work on a PR every day, thanks for being active but take your time :)

Thanks, I'll probably finish the changes on Sunday or so then

@jieyouxu jieyouxu added the O-wasm Target: WASM (WebAssembly), http://webassembly.org/ label Feb 27, 2025
@JayAndJef
Copy link
Author

I've changed the test to a UI test, and changed the compiler detection. I'm not sure about the consensus on that - are we still going use it? The commits for that can be scrapped if so

@Kobzol
Copy link
Contributor

Kobzol commented Mar 3, 2025

The UI and runtime tests sadly won't help that much for this issue, because it's possible that we might use Clang on test builders, but GCC on dist builders. But the bootstrap sanity check should hopefully do the trick.

@alexcrichton
Copy link
Member

For wasm specifically targets I think that Clang should be used everywhere because gcc doesn't have support for wasm. If any builder is using gcc for wasm that's definitely a bug that needs fixing (which the tests might help detect?)

@Kobzol
Copy link
Contributor

Kobzol commented Mar 3, 2025

Well, the dist builders only build stuff, it's not actually tested on most dist builders, which is why #132802 was a thing. So the UI/run-make tests are nice to have, but wouldn't help for this situation. But with the bootstrap sanity test I think it's fine.

You can r=me, unless you want to do more changes.

@alexcrichton
Copy link
Member

Oh, right, yes! (sorry your original comment is clearer now that I've woken up more...)

@JayAndJef
Copy link
Author

Great, so the sanity test is going to be kept?

@Kobzol
Copy link
Contributor

Kobzol commented Mar 3, 2025

Yeah, let's keep the tests. Let's see if CI works.

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 3, 2025
fix for issue 132802: x86 code in `wasm32-unknown-unknown` binaries

This is a direct fix for issue [132802](rust-lang#132802).
Followed the outline as follows:
> * give a hard error in bootstrap when using gcc to compile for wasm
> * change our CI to use clang instead of gcc
> * add a test that compiling a sample program for wasm32-unknown doesn't give any linker warnings

The `test-various` ci job was also changed.

try-job: test-various
try-job: dist-various-2
@bors
Copy link
Collaborator

bors commented Mar 3, 2025

⌛ Trying commit 63db26f with merge ca07aa7...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Mar 3, 2025

💔 Test failed - checks-actions

@JayAndJef
Copy link
Author

got it, i thought dist various 1 didnt have wasm targets

@Kobzol
Copy link
Contributor

Kobzol commented Mar 15, 2025

@bors try

@bors
Copy link
Collaborator

bors commented Mar 15, 2025

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout issue-132802-fix (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self issue-132802-fix --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging src/bootstrap/src/lib.rs
CONFLICT (content): Merge conflict in src/bootstrap/src/lib.rs
Auto-merging src/bootstrap/src/core/sanity.rs
Automatic merge failed; fix conflicts and then commit the result.

@bors
Copy link
Collaborator

bors commented Mar 15, 2025

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

Added sanity check to bootstrap to hard error on wasm builds without
clang, and changed distribution image `dist-various-2` to use clang to
build for official targets.
Also fixed a typo in the sanity check for bootstrap, as we are checking for clang-likeness in every wasm target.
@Kobzol
Copy link
Contributor

Kobzol commented Mar 16, 2025

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 16, 2025
fix for issue 132802: x86 code in `wasm32-unknown-unknown` binaries

This is a direct fix for issue [132802](rust-lang#132802).
Followed the outline as follows:
> * give a hard error in bootstrap when using gcc to compile for wasm
> * change our CI to use clang instead of gcc
> * add a test that compiling a sample program for wasm32-unknown doesn't give any linker warnings

The `test-various` ci job was also changed.

try-job: test-various
try-job: dist-various-1
try-job: dist-various-2
try-job: x86_64-msvc-1
@bors
Copy link
Collaborator

bors commented Mar 16, 2025

⌛ Trying commit dfe4ac0 with merge 207f62c...

@rust-log-analyzer
Copy link
Collaborator

The job dist-various-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
file:.git/config remote.origin.url=https://github.com/rust-lang-ci/rust
file:.git/config remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config gc.auto=0
file:.git/config http.https://github.com/.extraheader=AUTHORIZATION: basic ***
file:.git/config branch.try.remote=origin
file:.git/config branch.try.merge=refs/heads/try
file:.git/config remote.upstream.url=https://github.com/rust-lang/rust
file:.git/config remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*
file:.git/config submodule.library/backtrace.active=true
file:.git/config submodule.library/backtrace.url=https://github.com/rust-lang/backtrace-rs.git
file:.git/config submodule.library/stdarch.active=true
---

COPY host-x86_64/dist-various-1/install-emscripten.sh /build
RUN ./install-emscripten.sh

# Add Emscripten to PATH
ENV PATH="/build/emsdk:/build/emsdk/upstream/emscripten:/build/emsdk/node/current/bin:${PATH}"

# Suppress some warnings in the openwrt toolchains we downloaded
ENV STAGING_DIR=/tmp

COPY scripts/musl.sh /build
---
#23 2.147   cups-common liblcms2-utils pciutils lm-sensors npm libnss-mdns
#23 2.147   fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho
#23 2.147   fonts-wqy-microhei | fonts-wqy-zenhei fonts-indic
#23 2.147 Recommended packages:
#23 2.147   libgl1-amber-dri nodejs-doc libatk-wrapper-java-jni fonts-dejavu-extra
#23 2.213 The following NEW packages will be installed:
#23 2.213   ca-certificates-java default-jre default-jre-headless fontconfig-config
#23 2.213   fonts-dejavu-core java-common libavahi-client3 libavahi-common-data
#23 2.213   libavahi-common3 libc-ares2 libcups2 libdrm-amdgpu1 libdrm-intel1
#23 2.213   libdrm-nouveau2 libdrm-radeon1 libedit2 libfontconfig1 libfreetype6 libgif7
---
#23 7.836 
#23 8.008 done.
#23 8.008 done.
#23 8.045 + git clone https://github.com/emscripten-core/emsdk.git
#23 8.047 Cloning into 'emsdk'...
#23 8.448 + cd emsdk
#23 8.448 + ./emsdk install latest
#23 8.654 Resolving SDK alias 'latest' to '4.0.5'
#23 8.654 Resolving SDK version '4.0.5' to 'sdk-releases-d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-64bit'
#23 8.654 Installing SDK 'sdk-releases-d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-64bit'..
#23 8.654 Installing tool 'node-20.18.0-64bit'..
#23 8.654 Downloading: /build/emsdk/downloads/node-v20.18.0-linux-x64.tar.xz from https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-v20.18.0-linux-x64.tar.xz, 25738964 Bytes
#23 8.654  [----------------------------------------------------------------------------]
#23 10.83 Unpacking '/build/emsdk/downloads/node-v20.18.0-linux-x64.tar.xz' to '/build/emsdk/node/20.18.0_64bit'
#23 10.83 Done installing tool 'node-20.18.0-64bit'.
#23 10.83 Installing tool 'releases-d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-64bit'..
#23 10.83 Downloading: /build/emsdk/downloads/d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-wasm-binaries.tar.xz from https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239/wasm-binaries.tar.xz, 300524536 Bytes
#23 10.83  [----------------------------------------------------------------------------]
#23 31.64 Unpacking '/build/emsdk/downloads/d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-wasm-binaries.tar.xz' to '/build/emsdk/upstream'
#23 31.64 Done installing tool 'releases-d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-64bit'.
#23 31.64 Done installing SDK 'sdk-releases-d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-64bit'.
#23 31.65 + ./emsdk activate latest
#23 31.74 Resolving SDK alias 'latest' to '4.0.5'
#23 31.74 Resolving SDK version '4.0.5' to 'sdk-releases-d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-64bit'
#23 31.74 Setting the following tools as active:
#23 31.74    node-20.18.0-64bit
#23 31.74    releases-d7f8ff5e2ca3539c33fae81e98f7c56ef9fa1239-64bit
#23 31.74 
#23 31.74 Next steps:
---
cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `arm-linux-musleabihf-g++` installed?
cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `arm-linux-musleabihf-g++` installed?
cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `sparc64-linux-gnu-g++` installed?
cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `sparc64-linux-gnu-g++` installed?
cargo:warning=Compiler family detection failed due to error: ToolExecError: Command "emcc" "-E" "/tmp/12388544568563907636detect_compiler_family.c" with args emcc did not execute successfully (status code exit status: 1).
cargo:warning=Compiler family detection failed due to error: ToolExecError: Command "em++" "-E" "/tmp/5009887824444102905detect_compiler_family.c" with args em++ did not execute successfully (status code exit status: 1).
cargo:warning=Compiler family detection failed due to error: ToolExecError: Command "em++" "-E" "/tmp/15472697614068236456detect_compiler_family.c" with args em++ did not execute successfully (status code exit status: 1).
cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `arm-linux-musleabihf-g++` installed?
cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `arm-linux-musleabihf-g++` installed?

thread 'main' panicked at src/bootstrap/src/core/sanity.rs:321:17:
only clang supports building c code for wasm targets

@bors
Copy link
Collaborator

bors commented Mar 16, 2025

💔 Test failed - checks-actions

@JayAndJef
Copy link
Author

worked on my machine 😔. will look into later

@alex-semenyuk
Copy link
Member

@JayAndJef
Thanks for your contribution
From wg-triage. Any updates on this PR?

@bors
Copy link
Collaborator

bors commented Jun 19, 2025

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

@tgross35
Copy link
Contributor

tgross35 commented Jun 24, 2025

@JayAndJef any chance you are able to pick this back up? You probably need to install clang in the dockerfiles.

@JayAndJef
Copy link
Author

Sorry yall, I kind of completely forgot about this pr. Is anyone else willing to take this on?

@tgross35
Copy link
Contributor

Well, somebody did mention interest in #132802. But this seems close enough to get over the line if you are able! Needs a rebase plus Clang should be installed, probably not too much after that.

@JayAndJef
Copy link
Author

Gotchu, will work on this week. Sorry for the wait

@tgross35
Copy link
Contributor

No worries! It's open source and life happens :)

@JayAndJef
Copy link
Author

Sorry, what should I do so that the changes would be mergeable?

@tgross35
Copy link
Contributor

The error message at the bottom of #137457 (comment) says:

only clang supports building c code for wasm targets

which is the error message added here. You probably need to make similar change to the dist-various-1 dockerfile that you did to dist-various-2, setting the {CC,CXX}_wasm* environment variables, and making sure clang gets installed since it doesn't seem to be in the list yet. It would probably be good to set a default CC=gcc CXX=g++ (like dist-various-2 has) to make sure we keep the default. (I'm assuming some tooling might otherwise pick up the presence of Clang and prefer that.)

Also this needs a rebase since there is a conflict.

Comment on lines +315 to +323
if target.contains("wasm")
&& (build.config.optimized_compiler_builtins(*target)
|| build.config.rust_std_features.contains("compiler-builtins-c"))
{
let is_clang = build.cc_tool(*target).is_like_clang();
if !is_clang {
panic!("only clang supports building c code for wasm targets");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Mind adding some more guidance to the panic message so anyone who hits this doesn't have to dig too much? Maybe something like

                panic!(
                    "Clang is required to build C code for Wasm targets, got `{}` instead\n\
                    this is because compiler-builtins is configured to build C source. Either \
                    ensure Clang is used, or adjust this configuration.",
                    tool.path().display()
                );

@tgross35 tgross35 changed the title fix for issue 132802: x86 code in wasm32-unknown-unknown binaries Fix host code appearing in wasm32-unknown-unknown binaries Jun 30, 2025
@tgross35 tgross35 changed the title Fix host code appearing in wasm32-unknown-unknown binaries Fix host code appearing in Wasm binaries Jun 30, 2025
@JayAndJef
Copy link
Author

JayAndJef commented Jun 30, 2025

I keep getting merge conflicts while rebasing and I don't know how to solve them.

warning: skipped previously applied commit aa67f0ca2a3
hint: use --reapply-cherry-picks to include skipped commits
hint: Disable this message with "git config set advice.skippedCherryPicks false"
Auto-merging Cargo.lock
Auto-merging src/bootstrap/src/core/build_steps/llvm.rs
Failed to merge submodule src/tools/cargo (commits not present)
CONFLICT (submodule): Merge conflict in src/tools/cargo
hint: Recursive merging with submodules currently only supports trivial cases.
hint: Please manually handle the merging of each conflicted submodule.
hint: This can be accomplished with the following steps:
hint:  - come back to superproject and run:
hint:
hint:       git add src/tools/cargo
hint:
hint:    to record the above merge or update
hint:  - resolve any other conflicts in the superproject
hint:  - commit the resulting index in the superproject
hint:
hint: Disable this message with "git config set advice.submoduleMergeConflict false"
error: could not apply 6efacfb7a59... add fix for full tools and sanitizer
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Could not apply 6efacfb7a59... add fix for full tools and sanitizer

I tried manually updating the cargo submodule to the latest commit in upstream, but then when I run git add and continue the rebase it complains that I haven't solved the conflict and added the changes.

I'll add installing clang to the dockerfile right now and fix these after

@tgross35
Copy link
Contributor

tgross35 commented Jun 30, 2025

Maybe abort the rebase and do git submodule deinit --all --force before trying to rebase again? Submodules can be a bit wonky but deinitializing them and letting bootstrap re-init them fixes the vast majority of problems.

Make sure you're not changing the submodule in a commit or something (doesn't look like it from the state of the PR)

@JayAndJef
Copy link
Author

I'm incredibly confused on wtf is going on with git right now because I keep running into unexpected things - I'm going to take a break and hopefully find some clarity tomorrow.

Just to be clear, I was supposed to sync the repository then git pull --rebase?

@tgross35
Copy link
Contributor

What are you running into?

I think the Get Out of Jail Free card should look something like this:

# Ensure you are on the right branch and it is up to date
git switch issue-132802-fix
git pull --rebase
# ^ if that fails for whatever reason, you can do a more extreme
# `git reset --hard dfe4ac0ba7ed`, which will blow away any chances and
# reset your branch to the last commit on this PR. Careful!

# Forget submodules
git submodule deinit --all --force

# Fetch rust-lang/rust. The latest commit on master will be FETCH_HEAD
git fetch https://github.com/rust-lang/rust.git master

# Do the actual rebase. You will need to resolve a conflict; do that, `git add .`,
# and `git rebase --continue`.
#
# Make sure you don't accidentally add a submodule here, sometimes git can be
# weird like that. If you see anything suspicious, `git submodule deinit --all --force`
git rebase FETCH_HEAD

# And update the PR
git push --force-with-lease

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc O-wasm Target: WASM (WebAssembly), http://webassembly.org/ S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.