semarie / build-rust

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

build beta on OpenBSD 7.4 seems to be broken ATM #24

Closed dhuseby closed 1 month ago

dhuseby commented 5 months ago

I got the following error message while trying to build beta and haven't had the time to debug it yet:

Running `/usr/local/bin/rustc --crate-name bootstrap --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=1 -C metadata=a1fd553cd0349a12 -C extra-filename=-a1fd553cd0349a12 --out-dir /usr/obj/build_dir/build/bootstrap/debug/deps -C incremental=/usr/obj/build_dir/build/bootstrap/debug/incremental -L dependency=/usr/obj/build_dir/build/bootstrap/debug/deps --extern build_helper=/usr/obj/build_dir/build/bootstrap/debug/deps/libbuild_helper-6934efbc80646c19.rmeta --extern cc=/usr/obj/build_dir/build/bootstrap/debug/deps/libcc-d93ab6a8bd62607b.rmeta --extern clap=/usr/obj/build_dir/build/bootstrap/debug/deps/libclap-ffc493c94e57a846.rmeta --extern clap_complete=/usr/obj/build_dir/build/bootstrap/debug/deps/libclap_complete-b662d9c187f898ae.rmeta --extern cmake=/usr/obj/build_dir/build/bootstrap/debug/deps/libcmake-a015fcff17150acd.rmeta --extern fd_lock=/usr/obj/build_dir/build/bootstrap/debug/deps/libfd_lock-babb9d66560fee0b.rmeta --extern filetime=/usr/obj/build_dir/build/bootstrap/debug/deps/libfiletime-2ea0b0ee7ac70815.rmeta --extern home=/usr/obj/build_dir/build/bootstrap/debug/deps/libhome-c04ce8470aec78af.rmeta --extern ignore=/usr/obj/build_dir/build/bootstrap/debug/deps/libignore-bca5af4e8721a2d8.rmeta --extern libc=/usr/obj/build_dir/build/bootstrap/debug/deps/liblibc-5dc981ee2cc06d3e.rmeta --extern object=/usr/obj/build_dir/build/bootstrap/debug/deps/libobject-1454c766b05d5a47.rmeta --extern once_cell=/usr/obj/build_dir/build/bootstrap/debug/deps/libonce_cell-2388795bf8660aed.rmeta --extern opener=/usr/obj/build_dir/build/bootstrap/debug/deps/libopener-4592528a12c0f858.rmeta --extern semver=/usr/obj/build_dir/build/bootstrap/debug/deps/libsemver-18d263a106c6af2f.rmeta --extern serde=/usr/obj/build_dir/build/bootstrap/debug/deps/libserde-9fb714f88d8e3413.rmeta --extern serde_derive=/usr/obj/build_dir/build/bootstrap/debug/deps/libserde_derive-9cc8fea5c5bb6972.so --extern serde_json=/usr/obj/build_dir/build/bootstrap/debug/deps/libserde_json-d2958861fe6555f2.rmeta --extern sha2=/usr/obj/build_dir/build/bootstrap/debug/deps/libsha2-c5865f159dbc707c.rmeta --extern tar=/usr/obj/build_dir/build/bootstrap/debug/deps/libtar-bc766197e1c3636b.rmeta --extern termcolor=/usr/obj/build_dir/build/bootstrap/debug/deps/libtermcolor-9f0f67a2979ab677.rmeta --extern toml=/usr/obj/build_dir/build/bootstrap/debug/deps/libtoml-9371171af31b5dc6.rmeta --extern walkdir=/usr/obj/build_dir/build/bootstrap/debug/deps/libwalkdir-5811fbaa977a65fa.rmeta --extern xz2=/usr/obj/build_dir/build/bootstrap/debug/deps/libxz2-7478273d320a59a4.rmeta -Zallow-features= -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -L native=/usr/local/lib`
error[E0658]: use of unstable library feature 'file_set_times'
    --> src/core/build_steps/dist.rs:2057:34
     |
2057 |                 t!(linker_script.set_modified(mtime));
     |                                  ^^^^^^^^^^^^
     |
     = note: see issue #98245 <https://github.com/rust-lang/rust/issues/98245> for more information
     = help: add `#![feature(file_set_times)]` to the crate attributes to enable

It looks like that solution is to just add the file_set_times feature to the opener dependency to make this error go away.

semarie commented 5 months ago

it isn't the better moment to build beta currently. it requires a 1.77.0 (stable) compiler which was commited in openbsd ports tree only few hours ago.

could you ensure that you are using (and building) the expected versions ?

at the beginning of the build, you should have something like:

Fri Mar 22 11:38:27 CET 2024: info: building: 1.78.0-beta.1 (efd9d2df1 2024-03-18)
Fri Mar 22 11:38:27 CET 2024: info: required stage0:
  "compiler": {
    "date": "2024-02-04",
    "version": "beta"
  },
Fri Mar 22 11:38:27 CET 2024: info: rustc -vV
        rustc 1.77.0 (aedd173a2 2024-03-17) (built from a source tarball)
        binary: rustc
        commit-hash: aedd173a2c086e558c2b66d3743b344f977621a7
        commit-date: 2024-03-17
        host: x86_64-unknown-openbsd
        release: 1.77.0
        LLVM version: 16.0.6
ezaquarii commented 5 months ago

You mean OpenBSD 7.4?

dhuseby commented 5 months ago

You mean OpenBSD 7.4?

Oops. Yes. Fixed.

dhuseby commented 5 months ago

it requires a 1.77.0 (stable) compiler which was commited in openbsd ports tree only few hours ago.

I just checked out the current ports and sources and I'm building the 1.77 rust right now.

dhuseby commented 5 months ago

I just did a fresh install of 7.4 i386, used cvs to pull down the current ports, src, and xeoncara trees. Tried building 1.77 but it fails. This is on an old 32-bit laptop from 2008 so I'm not sure if it is because of the i386/32-bit build is broken or if I didn't something wrong setting up my test box. Do I need to build and run the current kernel/sys/ports for this to work?

semarie commented 5 months ago

using -current ports tree on 7.4 system isn't a supported configuration. for example, for building lang/rust, it is using binary bootstrap build for -current, and the binaries isn't necessary compatible with 7.4.

it is preferable to install a -current system (mostly 7.5 currently) using snapshots.

nalysius commented 5 months ago

@dhuseby If I remember, rustc can't compile itself on 32-bits platforms.

I've build 1.73, 1.74, 1.75, 1.76 & 1.77 on OpenBSD 7.4 x86_64 during the weekend. 1.77 can be downloaded there for those who don't want to build it manually, and its SHA256 hash is 66c4952e1e5ed91f0cb5e0714b4e379c61d3583f88968eeda32838df9d17a58b

semarie commented 5 months ago

@dhuseby If I remember, rustc can't compile itself on 32-bits platforms.

It works well. I am building all bootstraps natively, and it is also how OpenBSD is producing the package on i386.

nalysius commented 5 months ago

@dhuseby If I remember, rustc can't compile itself on 32-bits platforms. It works well. I am building all bootstraps natively, and it is also how OpenBSD is producing the package on i386.

My bad, it was an old problem which has been fixed.

semarie commented 1 month ago

closing. building is expected to be done on OpenBSD -current version.