thepowersgang / mrustc

Alternative rust compiler (re-implementation)
MIT License
2.17k stars 108 forks source link

Boostrap for 1.29.0 fails with "Unknown flag --manifest-path" #132

Closed andir closed 4 years ago

andir commented 4 years ago

I am trying to boostrap rustc 1.29.0 with the 0.9 release of mrustc.

I can build mrustc just fine. I have aliased minicargo as cargo to ease a bit of the plumbing in our rust boostrap code.

Whenever I try to start building rust 1.29.0 it fails building the "real" cargo with the below output. I am wondering why nobody else every ran into this since it seems pretty "normal" for 1.29.0:

Unknown flag --manifest-path
failed to run: /nix/store/55vdqaa8jh1zbpy6pz4wm7bh2zkxyg6y-mrustc-0.9/bin/cargo build --manifest-path /build/rustc-1.29.0-src/src/bootstrap/Cargo.toml --frozen

Looking at TestRustcBootstrap.sh I don't see an obvious difference in how things are being build.

Complete log:

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/bhcydl21b28x9rynd8v1wvc5gkl8rp2k-rustc-1.29.0-src.tar.gz
source root is rustc-1.29.0-src
setting SOURCE_DATE_EPOCH to timestamp 1536641398 of file rustc-1.29.0-src/src/vendor/winapi-i686-pc-windows-gnu/src/lib.rs
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
patching script interpreter paths in src/etc
src/etc/generate-deriving-span-tests.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/496hlkwcniy4yi3nix0cps43a3ll2c11-python-2.7.17/bin/python"
src/etc/generate-keyword-tests.py: interpreter directive changed from "/usr/bin/env python" to "/nix/store/496hlkwcniy4yi3nix0cps43a3ll2c11-python-2.7.17/bin/python"
src/etc/indenter: interpreter directive changed from "/usr/bin/env python" to "/nix/store/496hlkwcniy4yi3nix0cps43a3ll2c11-python-2.7.17/bin/python"
src/etc/cat-and-grep.sh: interpreter directive changed from "/bin/sh" to "/nix/store/b34zjdmq5l8k6rwdykjx55yl9r9isl8k-bash-4.4-p23/bin/sh"
src/etc/rust-lldb: interpreter directive changed from "/bin/sh" to "/nix/store/b34zjdmq5l8k6rwdykjx55yl9r9isl8k-bash-4.4-p23/bin/sh"
src/etc/rust-gdb: interpreter directive changed from "/bin/sh" to "/nix/store/b34zjdmq5l8k6rwdykjx55yl9r9isl8k-bash-4.4-p23/bin/sh"
src/etc/installer/pkg/postinstall: interpreter directive changed from "/bin/sh" to "/nix/store/b34zjdmq5l8k6rwdykjx55yl9r9isl8k-bash-4.4-p23/bin/sh"
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
configure flags: --prefix=/nix/store/9jlwjhrnyiqnl976wv9wd0mdlj8ryhrp-rustc-1.29.0 --release-channel=stable --set=build.rustc=/nix/store/55vdqaa8jh1zbpy6pz4wm7bh2zkxyg6y-mrustc-0.9/bin/rustc --set=build.cargo=/nix/store/55vdqaa8jh1zbpy6pz4wm7bh2zkxyg6y-mrustc-0.9/bin/cargo --enable-rpath --enable-vendor --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu --set=target.x86_64-unknown-linux-gnu.cc=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/cc --set=target.x86_64-unknown-linux-gnu.cc=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/cc --set=target.x86_64-unknown-linux-gnu.cc=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/cc --set=target.x86_64-unknown-linux-gnu.linker=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/cc --set=target.x86_64-unknown-linux-gnu.linker=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/cc --set=target.x86_64-unknown-linux-gnu.linker=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/cc --set=target.x86_64-unknown-linux-gnu.cxx=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/c++ --set=target.x86_64-unknown-linux-gnu.cxx=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/c++ --set=target.x86_64-unknown-linux-gnu.cxx=/nix/store/l2sqva7kzr8y68lji2aajk2s8017jyq4-gcc-wrapper-8.3.0/bin/c++ --enable-llvm-link-shared --set=target.x86_64-unknown-linux-gnu.llvm-config=/nix/store/gr4154kyvnx3fjs07mz4lxxpakxw51s8-llvm-9.0.0/bin/llvm-config --set=target.x86_64-unknown-linux-gnu.llvm-config=/nix/store/gr4154kyvnx3fjs07mz4lxxpakxw51s8-llvm-9.0.0/bin/llvm-config --set=target.x86_64-unknown-linux-gnu.llvm-config=/nix/store/gr4154kyvnx3fjs07mz4lxxpakxw51s8-llvm-9.0.0/bin/llvm-config --enable-profiler
configure: processing command line
configure: 
configure: llvm.link-shared     := True
configure: build.rustc          := /nix/store/55vdqaa8jh1zbpy6pz4wm7bh2zkxyg6y-mr ...
configure: build.cargo          := /nix/store/55vdqaa8jh1zbpy6pz4wm7bh2zkxyg6y-mr ...
configure: target.x86_64-unknown-linux-gnu.cc := /nix/store/l2sqva7kzr8y68lji2aaj ...
configure: target.x86_64-unknown-linux-gnu.cc := /nix/store/l2sqva7kzr8y68lji2aaj ...
configure: target.x86_64-unknown-linux-gnu.cc := /nix/store/l2sqva7kzr8y68lji2aaj ...
configure: target.x86_64-unknown-linux-gnu.linker := /nix/store/l2sqva7kzr8y68lji ...
configure: target.x86_64-unknown-linux-gnu.linker := /nix/store/l2sqva7kzr8y68lji ...
configure: target.x86_64-unknown-linux-gnu.linker := /nix/store/l2sqva7kzr8y68lji ...
configure: target.x86_64-unknown-linux-gnu.cxx := /nix/store/l2sqva7kzr8y68lji2aa ...
configure: target.x86_64-unknown-linux-gnu.cxx := /nix/store/l2sqva7kzr8y68lji2aa ...
configure: target.x86_64-unknown-linux-gnu.cxx := /nix/store/l2sqva7kzr8y68lji2aa ...
configure: target.x86_64-unknown-linux-gnu.llvm-config := /nix/store/gr4154kyvnx3 ...
configure: target.x86_64-unknown-linux-gnu.llvm-config := /nix/store/gr4154kyvnx3 ...
configure: target.x86_64-unknown-linux-gnu.llvm-config := /nix/store/gr4154kyvnx3 ...
configure: build.vendor         := True
configure: build.target         := ['x86_64-unknown-linux-gnu']
configure: rust.channel         := stable
configure: rust.rpath           := True
configure: build.host           := ['x86_64-unknown-linux-gnu']
configure: build.profiler       := True
configure: install.prefix       := /nix/store/9jlwjhrnyiqnl976wv9wd0mdlj8ryhrp-ru ...
configure: build.build          := x86_64-unknown-linux-gnu
configure: build.configure-args := ['--prefix=/nix/store/9jlwjhrnyiqnl976wv9wd0md ...
configure: 
configure: writing `config.toml` in current directory
configure: 
configure: run `python /build/rustc-1.29.0-src/x.py --help`
configure: 
@nix { "action": "setPhase", "phase": "buildPhase" }
building
build flags: SHELL=/nix/store/b34zjdmq5l8k6rwdykjx55yl9r9isl8k-bash-4.4-p23/bin/bash
Unknown flag --manifest-path
failed to run: /nix/store/55vdqaa8jh1zbpy6pz4wm7bh2zkxyg6y-mrustc-0.9/bin/cargo build --manifest-path /build/rustc-1.29.0-src/src/bootstrap/Cargo.toml --frozen
Build completed unsuccessfully in 0:00:00
make: *** [Makefile:28: all] Error 1
thepowersgang commented 4 years ago

That looks supisciously like /nix/store/55vdqaa8jh1zbpy6pz4wm7bh2zkxyg6y-mrustc-0.9/bin/cargo is actually mrustc's minicargo

minicargo is not a drop-in replacement for cargo (just like mrustc isn't a drop-in replacement for rustc), What script are you using to build? TestRustcBootstrap.sh should be using a mrustc-built copy of rustc/cargo (not directly using mrustc/minicargo)

andir commented 4 years ago

Oh! I guess I'll have to build cargo first then. Some how I had the impression minicargo would be suitable to build cargo but not all the complicated cases cargo supports.

thepowersgang commented 4 years ago

There are makefiles in run_rustc that build rustc and cargo, which are then used to do the full 1.30 bootstrap.