semarie / build-rust

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

Build fails on openbsd 6.7 rustc 1.42.0 #17

Closed gridbugs closed 4 years ago

gridbugs commented 4 years ago

Error is:

   Compiling bootstrap v0.0.0 (/home/steve/pkg/build-rust/build_dir/rustc-beta-src/src/bootstrap)
error[E0658]: use of unstable library feature 'str_strip': newly added
   --> src/bootstrap/lib.rs:439:31
    |
439 |             .filter_map(|x| x.strip_prefix("release:"))
    |                               ^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/67302
    = help: add `#![feature(str_strip)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'str_strip': newly added
    --> src/bootstrap/lib.rs:1092:22
     |
1092 |                 line.strip_prefix("version = \"").and_then(|s| s.strip_suffix("\""))
     |                      ^^^^^^^^^^^^
     |
     = note: for more information, see https://github.com/rust-lang/rust/issues/67302
     = help: add `#![feature(str_strip)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'str_strip': newly added
    --> src/bootstrap/lib.rs:1092:66
     |
1092 |                 line.strip_prefix("version = \"").and_then(|s| s.strip_suffix("\""))
     |                                                                  ^^^^^^^^^^^^
     |
     = note: for more information, see https://github.com/rust-lang/rust/issues/67302
     = help: add `#![feature(str_strip)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'str_strip': newly added
   --> src/bootstrap/compile.rs:968:22
    |
968 |                     .strip_prefix(&prefix[..])
    |                      ^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/67302
    = help: add `#![feature(str_strip)]` to the crate attributes to enable

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0658`.
error: could not compile `bootstrap`.

To learn more, run the command again with --verbose.
Traceback (most recent call last):
  File "/home/steve/pkg/build-rust/build_dir/rustc-beta-src/x.py", line 11, in <module>
    bootstrap.main()
  File "/home/steve/pkg/build-rust/build_dir/rustc-beta-src/src/bootstrap/bootstrap.py", line 981, in main
    bootstrap(help_triggered)
  File "/home/steve/pkg/build-rust/build_dir/rustc-beta-src/src/bootstrap/bootstrap.py", line 948, in bootstrap
    build.build_bootstrap()
  File "/home/steve/pkg/build-rust/build_dir/rustc-beta-src/src/bootstrap/bootstrap.py", line 733, in build_bootstrap
    run(args, env=env, verbose=self.verbose)
  File "/home/steve/pkg/build-rust/build_dir/rustc-beta-src/src/bootstrap/bootstrap.py", line 143, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /usr/local/bin/cargo build --manifest-path /home/steve/pkg/build-rust/build_dir/rustc-beta-src/src/bootstrap/Cargo.toml --frozen
Sun Aug  9 22:47:55 AEST 2020: task not finished: see build.log for detail
Sun Aug  9 22:47:55 AEST 2020: task not finished: see build.log for detail
pkg_info rust
Information for inst:rust-1.42.0p0
uname -a
OpenBSD foo.hub 6.7 GENERIC.MP#182 amd64

Looks similar to: https://github.com/semarie/build-rust/issues/15

At the time of writing, the stable version of rustc is 1.45.2. Would it make sense to bootstrap stable from 1.42.0 (if that's even possible) first, and then continue to bootstrap beta and nightly as desired? I really just want stable rust on my openbsd machine, as the version in ports or the binary repo on openbsd 6.7 is too old to build some projects.

semarie commented 4 years ago

In order to build beta (or nightly) rust channel, you need the required rustc compiler: here 1.45.0. it is a Rust requirement.

The fact that OpenBSD doesn't provide it in 6.7 -stable is related to the way -stable is done.

You could try to build lang/rust 1.45.2 from -current (the port is self contained, but could use specific part of libc which require -current kernel). It might work (kernel/libc incompatibility exists but aren't too common)