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

configure: Give a better error when the local rustc version is too old #47872

Closed
paulmenzel opened this issue Jan 30, 2018 · 10 comments
Closed
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@paulmenzel
Copy link

$ wget https://static.rust-lang.org/dist/rustc-1.23.0-src.tar.gz
fetching https://static.rust-lang.org/dist/rustc-1.23.0-src.tar.gz
--2018-01-30 11:12:15--  https://static.rust-lang.org/dist/rustc-1.23.0-src.tar.gz
Resolving static.rust-lang.org... 52.222.253.135, 52.222.253.206, 52.222.253.85, ...
Connecting to static.rust-lang.org|52.222.253.135|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 60010149 (57M) [application/x-tar]
Saving to: ‘/dev/shm/bee-root/rustc/files/rustc-1.23.0-src.tar.gz’

/dev/shm/bee-root/rustc/fil 100%[=========================================>]  57.23M  4.64MB/s    in 15s

2018-01-30 11:12:30 (3.93 MB/s) - ‘/dev/shm/bee-root/rustc/files/rustc-1.23.0-src.tar.gz’ saved [60010149/60010149]

-rw-r--r-- 1 root system 60010149 Jan  4 17:02 /dev/shm/bee-root/rustc/files/rustc-1.23.0-src.tar.gz
$ # extract and change directory
$ ./configure --prefix=${PREFIX} \
                   --mandir=${MANDIR} \
                   --libdir=${LIBDIR} \
                   --enable-local-rust \
                   --disable-rpath \
                   --enable-extended \
                   --disable-codegen-tests
configure: processing command line
configure:
configure: build.extended       := True
configure: rust.rpath           := False
configure: install.libdir       := /usr/lib
configure: rust.codegen-tests   := False
configure: install.prefix       := /usr
configure: build.rustc          := /usr/bin/rustc
configure: build.cargo          := /usr/bin/cargo
configure: install.mandir       := /usr/share/man
configure: build.configure-args := ['--prefix=/usr', '--mandir=/usr/share/man', ' ...
configure:
configure: writing `config.toml` in current directory
configure:
configure: run `python /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/x.py --help`
configure:
$ make -j63
info: looks like you are running this command under `sudo`
      and so in order to preserve your $HOME this will now
      use vendored sources by default. Note that if this
      does not work you should run a normal build first
      before running a command like `sudo make install`
   Compiling serde v1.0.21   
   Compiling itoa v0.3.4
   Compiling getopts v0.2.15 
   Compiling unicode-xid v0.0.4
   Compiling lazy_static v0.2.11
   Compiling dtoa v0.4.2
   Compiling quote v0.3.15   
   Compiling cc v1.0.3
   Compiling num-traits v0.1.40
   Compiling cfg-if v0.1.2
   Compiling libc v0.2.33
   Compiling synom v0.11.3
   Compiling syn v0.11.11
   Compiling filetime v0.1.14
   Compiling num_cpus v1.7.0
   Compiling build_helper v0.1.0 (file:///dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/build_helper)
   Compiling cmake v0.1.28
   Compiling serde_derive_internals v0.17.0
   Compiling serde_derive v1.0.21
   Compiling serde_json v1.0.6
   Compiling toml v0.4.5
   Compiling bootstrap v0.0.0 (file:///dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/bootstrap)
    Finished dev [unoptimized] target(s) in 36.55 secs
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling cfg-if v0.1.2
   Compiling unwind v0.0.0 (file:///dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libunwind)
   Compiling libc v0.2.33
   Compiling core v0.0.0 (file:///dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore)
   Compiling cc v1.0.3
error: expected one of `)` or `,`, found `=`
    --> /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/slice/mod.rs:1049:13
     |
1049 |         (0..=self.end).get(slice)
     |             ^ expected one of `)` or `,` here

error: expected one of `)` or `,`, found `=`
    --> /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/slice/mod.rs:1054:13
     |
1054 |         (0..=self.end).get_mut(slice)
     |             ^ expected one of `)` or `,` here

error: expected one of `)` or `,`, found `=`
    --> /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/slice/mod.rs:1059:13
     |
1059 |         (0..=self.end).get_unchecked(slice)
     |             ^ expected one of `)` or `,` here

error: expected one of `)` or `,`, found `=`
    --> /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/slice/mod.rs:1064:13
     |
1064 |         (0..=self.end).get_unchecked_mut(slice)
     |             ^ expected one of `)` or `,` here

error: expected one of `)` or `,`, found `=`
    --> /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/slice/mod.rs:1069:13
     |
1069 |         (0..=self.end).index(slice)
     |             ^ expected one of `)` or `,` here

error: expected one of `)` or `,`, found `=`
    --> /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/slice/mod.rs:1074:13
     |
1074 |         (0..=self.end).index_mut(slice)
     |             ^ expected one of `)` or `,` here

   Compiling filetime v0.1.14
   Compiling build_helper v0.1.0 (file:///dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/build_helper)
error[E0522]: definition of an unknown language item: `generator`.
   --> /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/ops/generator.rs:76:1
    |
76  | / pub trait Generator {
77  | |     /// The type of value this generator yields.
78  | |     ///
79  | |     /// This associated type corresponds to the `yield` expression and the
...   |
119 | |     fn resume(&mut self) -> GeneratorState<Self::Yield, Self::Return>;
120 | | }
    | |_^

error[E0522]: definition of an unknown language item: `generator_state`.
  --> /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/ops/generator.rs:19:1
   |
19 | / pub enum GeneratorState<Y, R> {
20 | |     /// The generator suspended with a value.
21 | |     ///
22 | |     /// This state indicates that a generator has been suspended, and typically
...  |
33 | |     Complete(R),
34 | | }
   | |_^
error: aborting due to 8 previous errors

   Compiling std v0.0.0 (file:///dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libstd)
error: Could not compile `core`.

Caused by:
  process didn't exit successfully: `/dev/shm/bee-root/rustc/rustc-1.23.0-0/build/build/bootstrap/debug/rustc --crate-name core /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libcore/lib.rs --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=4474a6595f5a1cf9 -C extra-filename=-4474a6595f5a1cf9 --out-dir /dev/shm/bee-root/rustc/rustc-1.23.0-0/build/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/dev/shm/bee-root/rustc/rustc-1.23.0-0/build/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/dev/shm/bee-root/rustc/rustc-1.23.0-0/build/build/x86_64-unknown-linux-gnu/stage0-std/release/deps` (exit code: 101)
warning: build failed, waiting for other jobs to finish...
error: build failed
thread 'main' panicked at 'command did not execute successfully: "/usr/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--frozen" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', /dev/shm/bee-root/rustc/rustc-1.23.0-0/source/src/bootstrap/compile.rs:882:8
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/sys_common/backtrace.rs:60
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/panicking.rs:397
   4: std::panicking::rust_panic_with_hook
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/panicking.rs:611
   5: std::panicking::begin_panic
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/panicking.rs:572
   6: std::panicking::begin_panic_fmt
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/panicking.rs:522
   7: bootstrap::compile::run_cargo
   8: <bootstrap::compile::Std as bootstrap::builder::Step>::run
   9: bootstrap::builder::Builder::ensure
  10: <bootstrap::compile::Test as bootstrap::builder::Step>::run
  11: bootstrap::builder::Builder::ensure
  12: <bootstrap::compile::Rustc as bootstrap::builder::Step>::run
  13: bootstrap::builder::Builder::ensure
  14: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
  15: bootstrap::builder::Builder::ensure
  16: bootstrap::builder::Builder::compiler
  17: <bootstrap::compile::Assemble as bootstrap::builder::Step>::run
  18: bootstrap::builder::Builder::ensure
  19: bootstrap::builder::Builder::compiler
  20: <bootstrap::compile::Std as bootstrap::builder::Step>::make_run
  21: bootstrap::builder::StepDescription::maybe_run
  22: bootstrap::builder::StepDescription::run
  23: bootstrap::builder::Builder::run
  24: bootstrap::Build::build
  25: bootstrap::main
  26: __rust_maybe_catch_panic
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libpanic_unwind/lib.rs:99
  27: std::rt::lang_start
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/panicking.rs:459
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/panic.rs:361
             at /scratch/local/bee-root/rustc/rustc-1.21.0-2/source/src/libstd/rt.rs:61
  28: main
  29: __libc_start_main
             at ../csu/libc-start.c:295
  30: _start
             at ../sysdeps/x86_64/start.S:120
failed to run: /dev/shm/bee-root/rustc/rustc-1.23.0-0/build/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:00:43
Makefile:22: recipe for target 'all' failed
make: *** [all] Error 1
@oli-obk
Copy link
Contributor

oli-obk commented Jan 30, 2018

configure: build.rustc := /usr/bin/rustc

your system installed rustc is too old. It doesn't support the ..= syntax yet. There's always a special nightly that is used, but you can probably take any recent one

@paulmenzel
Copy link
Author

paulmenzel commented Jan 30, 2018 via email

@paulmenzel
Copy link
Author

So the configure script should really be fixed to check for the versions it needs to successfully build.

@oli-obk
Copy link
Contributor

oli-obk commented Jan 30, 2018

I am really irritated, why two version less should be too old to build

Because each version is built by the previous one. That's simply the policy.

So the configure script should really be fixed to check for the versions it needs to successfully build.

Well it does ;) it downloads the correct version by default. You explicitly opted to use your system's rustc with --enable-local-rust

@paulmenzel
Copy link
Author

paulmenzel commented Jan 30, 2018 via email

@oli-obk
Copy link
Contributor

oli-obk commented Jan 30, 2018

Such a switch should have force in it.

makes sense. --force-local-rust is much clearer about something potentially surprising going on

// If local-rust is the same major.minor as the current version, then force a local-rebuild

makes it seem like there should be some checking going on?

@pietroalbini pietroalbini added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jan 30, 2018
@jyn514 jyn514 changed the title Building rustc 1.23.0 fails with error: expected one of ) or ,, found =`` configure: Give a better error when the local rustc version is too old Oct 11, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

Mentoring instructions: change the code around

rust/src/bootstrap/lib.rs

Lines 554 to 557 in 006ca9b

if local_release.split('.').take(2).eq(version.split('.').take(2)) {
build.verbose(&format!("auto-detected local-rebuild {}", local_release));
build.local_rebuild = true;
}
to give a hard error if the version of the system rustc is not the same as the compiler in src/stage0.json. It may be helpful to land 9307bb2 first so you can reuse the CompilerMetadata struct.

@jyn514 jyn514 added A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. and removed A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html labels Feb 3, 2023
@cuviper
Copy link
Member

cuviper commented Feb 3, 2023

give a hard error if the version of the system rustc is not the same as the compiler in src/stage0.json.

Huh? That local-rebuild case is important for distros, and will not be the same version as stage0.json.

@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

@cuviper sorry, I was unclear - if it's not the same as stage0.json and it's not the same as src/version. Those are the only 2 versions that are supported.

@jyn514
Copy link
Member

jyn514 commented Jun 19, 2023

fixed in #112231

@jyn514 jyn514 closed this as completed Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

5 participants