semarie / build-rust

Script helper for building rustc and cargo from source on OpenBSD (without rustup)
59 stars 15 forks source link

Unable to compile rust beta on OpenBSD 7.3 #23

Closed samebchase closed 10 months ago

samebchase commented 10 months ago

Hi,

I'm on:

> uname -a
OpenBSD carolyn.my.domain 7.3 GENERIC.MP#1125 amd64
> cargo --version
cargo 1.68.0
> rustc --version
rustc 1.68.0 (2c8cc3432 2023-03-06) (built from a source tarball)
samuel@carolyn ~/s/build-rust (master)>

and the error, I get is:

error[E0658]: use of unstable library feature 'is_terminal'
  --> config.rs:15:5
   |
15 | use std::io::IsTerminal;
   |     ^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #98070 <https://github.com/rust-lang/rust/issues/98070> for more information

error[E0658]: use of unstable library feature 'is_terminal'
    --> config.rs:1061:50
     |
1061 |         config.stdout_is_tty = std::io::stdout().is_terminal();
     |                                                  ^^^^^^^^^^^
     |
     = note: see issue #98070 <https://github.com/rust-lang/rust/issues/98070> for more information

error[E0658]: use of unstable library feature 'is_terminal'
    --> config.rs:1062:50
     |
1062 |         config.stderr_is_tty = std::io::stderr().is_terminal();
     |                                                  ^^^^^^^^^^^
     |
     = note: see issue #98070 <https://github.com/rust-lang/rust/issues/98070> for more information

error[E0658]: use of unstable library feature 'is_some_and'
  --> sanity.rs:66:53
   |
66 |         env::var_os("BOOTSTRAP_SKIP_TARGET_SANITY").is_some_and(|s| s == "1" || s == "true");
   |                                                     ^^^^^^^^^^^
   |
   = note: see issue #93050 <https://github.com/rust-lang/rust/issues/93050> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `bootstrap` due to 4 previous errors

Thanks for the script!

semarie commented 10 months ago

to build rustc beta (upcoming 1.74.0), you need a rustc stable (stable in sense of rustc release: 1.73.0). as you try to build it with 1.68.0, it failed.

I am just suprised that the build script didn't catch the version mismatch.

samebchase commented 10 months ago

@semarie Thanks for the quick reply. šŸ™

Hmm, I after upgrading to OpenBSD 7.4 which packages 1.72, and still it failed. As you said it seems 1.73 is required.

What's the best way of building the latest stable then?

semarie commented 10 months ago

with 1.72.0, you could build 1.73.0. and next you could build beta and nightly.

rustc version X only support building from version X-1 (or version X).

you could also upgrade to OpenBSD -current, and you will have rustc 1.73.0 from ports (using pkg_add).

depending your need regarding rustc features from beta or nightly, it is possible to opt-in for have unstable features presents in 1.72.0 by passing RUSTC_BOOTSTRAP=1 in your environment.

samebchase commented 10 months ago

Thanks a lot for the info! This helps greatly. šŸ‘