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

Edition 3 post 3 no longer compiles #1391

Closed
ajh123 opened this issue Feb 9, 2025 · 4 comments
Closed

Edition 3 post 3 no longer compiles #1391

ajh123 opened this issue Feb 9, 2025 · 4 comments

Comments

@ajh123
Copy link

ajh123 commented Feb 9, 2025

When attempting to compile post-3.3 in a new GitHub codespace I get a couple errors:

$ cargo run --bin qemu-bios
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2025-02-09, rust version 1.86.0-nightly (43ca9d18e 2025-02-08)
info: downloading component 'llvm-tools'
info: downloading component 'rust-src'
info: downloading component 'rust-std' for 'x86_64-unknown-none'
info: installing component 'llvm-tools'
info: installing component 'rust-src'
info: installing component 'rust-std' for 'x86_64-unknown-none'
    Updating crates.io index
  Downloaded crc-catalog v2.4.0
  Downloaded crc v3.0.1
  Downloaded unicode-ident v1.0.12
  Downloaded wyz v0.5.1
  Downloaded socket2 v0.4.10
  Downloaded uuid v1.6.1
  Downloaded serde v1.0.193
  Downloaded polling v2.8.0
  Downloaded syn v2.0.43
  Downloaded gpt v3.1.0
  Downloaded embedded-graphics-core v0.4.0
  Downloaded ryu v1.0.16
  Downloaded serde_json v1.0.108
  Downloaded radium v0.7.0
  Downloaded futures-util v0.3.30
  Downloaded pin-utils v0.1.0
  Downloaded rustix v0.37.27
  Downloaded micromath v2.1.0
  Downloaded pin-project-lite v0.2.13
  Downloaded pin-project-internal v1.1.3
  Downloaded rustix v0.38.28
  Downloaded pin-project v1.1.3
  Downloaded mbrman v0.5.2
  Downloaded tracing-core v0.1.32
  Downloaded serde_derive v1.0.193
  Downloaded proc-macro2 v1.0.71
  Downloaded log v0.4.20
  Downloaded llvm-tools v0.1.1
  Downloaded futures-lite v1.13.0
  Downloaded futures-core v0.3.30
  Downloaded futures-concurrency v7.4.3
  Downloaded futures-channel v0.3.30
  Downloaded futures v0.3.30
  Downloaded fatfs v0.3.6
  Downloaded fastrand v2.0.1
  Downloaded event-listener v4.0.1
  Downloaded event-listener v3.1.0
  Downloaded crossbeam-utils v0.8.18
  Downloaded smallvec v1.11.2
  Downloaded libc v0.2.151
  Downloaded slab v0.4.9
  Downloaded signal-hook-registry v1.4.1
  Downloaded quote v1.0.33
  Downloaded parking v2.2.0
  Downloaded num-traits v0.2.17
  Downloaded memchr v2.7.1
  Downloaded itoa v1.0.10
  Downloaded io-lifetimes v1.0.11
  Downloaded getrandom v0.2.11
  Downloaded futures-task v0.3.30
  Downloaded futures-sink v0.3.30
  Downloaded futures-macro v0.3.30
  Downloaded futures-io v0.3.30
  Downloaded futures-executor v0.3.30
  Downloaded float-cmp v0.9.0
  Downloaded linux-raw-sys v0.3.8
  Downloaded fastrand v1.9.0
  Downloaded event-listener-strategy v0.4.0
  Downloaded event-listener v2.5.3
  Downloaded errno v0.3.8
  Downloaded byteorder v1.5.0
  Downloaded waker-fn v1.1.1
  Downloaded tracing v0.1.40
  Downloaded thiserror-impl v1.0.52
  Downloaded thiserror v1.0.52
  Downloaded tempfile v3.9.0
  Downloaded tap v1.0.1
  Downloaded serde-big-array v0.4.1
  Downloaded futures-lite v2.1.0
  Downloaded bitvec v1.0.1
  Downloaded bitflags v2.4.1
  Downloaded az v1.2.1
  Downloaded async-signal v0.2.5
  Downloaded async-process v1.8.1
  Downloaded ovmf-prebuilt v0.1.0-alpha.1
  Downloaded async-lock v3.2.0
  Downloaded async-lock v2.8.0
  Downloaded polling v3.3.1
  Downloaded linux-raw-sys v0.4.12
  Downloaded funty v2.0.0
  Downloaded concurrent-queue v2.4.0
  Downloaded autocfg v1.1.0
  Downloaded async-io v2.2.2
  Downloaded anyhow v1.0.77
  Downloaded cfg-if v1.0.0
  Downloaded bootloader_api v0.11.5
  Downloaded bootloader-boot-config v0.11.5
  Downloaded bitflags v1.3.2
  Downloaded bincode v1.3.3
  Downloaded bootloader v0.11.5
  Downloaded async-io v1.13.0
  Downloaded embedded-graphics v0.8.1
  Downloaded 92 crates (11.2 MB) in 0.80s (largest was `embedded-graphics` at 2.5 MB)
   Compiling autocfg v1.1.0
   Compiling proc-macro2 v1.0.71
   Compiling unicode-ident v1.0.12
   Compiling cfg-if v1.0.0
   Compiling pin-project-lite v0.2.13
   Compiling libc v0.2.151
   Compiling futures-core v0.3.30
   Compiling crossbeam-utils v0.8.18
   Compiling slab v0.4.9
   Compiling parking v2.2.0
   Compiling concurrent-queue v2.4.0
   Compiling futures-io v0.3.30
   Compiling quote v1.0.33
   Compiling bitflags v2.4.1
   Compiling syn v2.0.43
   Compiling rustix v0.38.28
   Compiling linux-raw-sys v0.4.12
   Compiling memchr v2.7.1
   Compiling event-listener v4.0.1
   Compiling io-lifetimes v1.0.11
   Compiling serde v1.0.193
   Compiling log v0.4.20
   Compiling tracing-core v0.1.32
   Compiling radium v0.7.0
   Compiling event-listener-strategy v0.4.0
   Compiling tracing v0.1.40
   Compiling polling v2.8.0
   Compiling bitflags v1.3.2
   Compiling rustix v0.37.27
   Compiling futures-sink v0.3.30
   Compiling tap v1.0.1
   Compiling wyz v0.5.1
   Compiling futures-channel v0.3.30
   Compiling async-lock v3.2.0
   Compiling async-io v1.13.0
   Compiling futures-lite v2.1.0
   Compiling futures-task v0.3.30
   Compiling waker-fn v1.1.1
   Compiling linux-raw-sys v0.3.8
   Compiling funty v2.0.0
   Compiling fastrand v1.9.0
   Compiling pin-utils v0.1.0
   Compiling event-listener v2.5.3
   Compiling async-lock v2.8.0
   Compiling futures-lite v1.13.0
   Compiling bitvec v1.0.1
   Compiling serde_derive v1.0.193
   Compiling futures-macro v0.3.30
   Compiling polling v3.3.1
   Compiling pin-project-internal v1.1.3
   Compiling futures-util v0.3.30
   Compiling async-io v2.2.2
   Compiling signal-hook-registry v1.4.1
   Compiling socket2 v0.4.10
   Compiling async-signal v0.2.5
   Compiling pin-project v1.1.3
   Compiling event-listener v3.1.0
   Compiling num-traits v0.2.17
   Compiling thiserror v1.0.52
   Compiling az v1.2.1
   Compiling smallvec v1.11.2
   Compiling futures-concurrency v7.4.3
   Compiling futures-executor v0.3.30
   Compiling async-process v1.8.1
   Compiling futures v0.3.30
   Compiling thiserror-impl v1.0.52
   Compiling getrandom v0.2.11
   Compiling serde_json v1.0.108
   Compiling llvm-tools v0.1.1
   Compiling anyhow v1.0.77
   Compiling crc-catalog v2.4.0
   Compiling crc v3.0.1
   Compiling bincode v1.3.3
   Compiling serde-big-array v0.4.1
   Compiling uuid v1.6.1
   Compiling byteorder v1.5.0
   Compiling itoa v1.0.10
   Compiling ryu v1.0.16
   Compiling bootloader_api v0.11.5
   Compiling fastrand v2.0.1
   Compiling tempfile v3.9.0
   Compiling embedded-graphics-core v0.4.0
   Compiling float-cmp v0.9.0
   Compiling fatfs v0.3.6
   Compiling mbrman v0.5.2
   Compiling gpt v3.1.0
   Compiling bootloader v0.11.5
   Compiling bootloader-boot-config v0.11.5
   Compiling micromath v2.1.0
   Compiling embedded-graphics v0.8.1
   Compiling ovmf-prebuilt v0.1.0-alpha.1
   Compiling kernel v0.1.0 (/workspaces/blog_os/kernel)
error: failed to run custom build command for `bootloader v0.11.5`

Caused by:
  process didn't exit successfully: `/workspaces/blog_os/target/debug/build/bootloader-141f7d00b13db262/build-script-build` (exit status: 101)
  --- stderr
      Updating crates.io index
   Downloading crates ...
      Blocking waiting for file lock on package cache
      Blocking waiting for file lock on package cache
    Downloaded bootloader-x86_64-uefi v0.11.5
      Blocking waiting for file lock on package cache
      Blocking waiting for file lock on package cache
      Updating crates.io index
      Blocking waiting for file lock on package cache
   Downloading crates ...
    Downloaded bootloader-x86_64-bios-stage-3 v0.11.5
      Updating crates.io index
      Blocking waiting for file lock on package cache
   Downloading crates ...
    Downloaded bootloader-x86_64-bios-stage-4 v0.11.5
      Updating crates.io index
      Blocking waiting for file lock on package cache
   Downloading crates ...
    Downloaded bootloader-x86_64-bios-boot-sector v0.11.5
      Updating crates.io index
      Blocking waiting for file lock on package cache
   Downloading crates ...
    Downloaded bootloader-x86_64-bios-stage-2 v0.11.5
    Installing bootloader-x86_64-uefi v0.11.5
      Blocking waiting for file lock on package cache
    Installing bootloader-x86_64-bios-stage-3 v0.11.5
      Blocking waiting for file lock on package cache
    Installing bootloader-x86_64-bios-stage-2 v0.11.5
      Updating crates.io index
    Installing bootloader-x86_64-bios-stage-4 v0.11.5
      Blocking waiting for file lock on package cache
    Installing bootloader-x86_64-bios-boot-sector v0.11.5
      Blocking waiting for file lock on package cache
      Blocking waiting for file lock on package cache
      Updating crates.io index
      Blocking waiting for file lock on package cache
      Updating crates.io index
      Blocking waiting for file lock on package cache
      Updating crates.io index
      Blocking waiting for file lock on package cache
      Blocking waiting for file lock on package cache
  warning: package `atomic-polyfill v0.1.11` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
  warning: package `critical-section v1.1.1` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
      Blocking waiting for file lock on package cache
  warning: package `atomic-polyfill v0.1.11` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
  warning: package `critical-section v1.1.1` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
      Updating crates.io index
  error: failed to compile `bootloader-x86_64-bios-stage-3 v0.11.5`, intermediate artifacts can be found at `/tmp/cargo-installllbxQB`.
  To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

  Caused by:
    failed to run `rustc` to learn about target-specific information

  Caused by:
    process didn't exit successfully: `/home/codespace/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names --target /home/codespace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bootloader-0.11.5/i686-stage-3.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
    --- stderr
    error: Error loading target specification: target feature `soft-float` is incompatible with the ABI but gets enabled in target spec. Run `rustc --print target-list` for a list of built-in targets


  thread 'main' panicked at /home/codespace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bootloader-0.11.5/build.rs:239:9:
  failed to build bios stage-3
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
      Blocking waiting for file lock on package cache
      Updating crates.io index
      Blocking waiting for file lock on package cache
      Updating crates.io index
  error: failed to compile `bootloader-x86_64-bios-stage-4 v0.11.5`, intermediate artifacts can be found at `/tmp/cargo-installchFj5b`.
  To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

  Caused by:
    failed to run `rustc` to learn about target-specific information

  Caused by:
    process didn't exit successfully: `/home/codespace/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names --target /home/codespace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bootloader-0.11.5/x86_64-stage-4.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
    --- stderr
    error: Error loading target specification: target feature `sse2` is required by the ABI but gets disabled in target spec. Run `rustc --print target-list` for a list of built-in targets

      Blocking waiting for file lock on package cache
      Blocking waiting for file lock on package cache
   Downloading crates ...
    Downloaded byteorder v1.4.3
    Downloaded mbr-nostd v0.1.0
    Downloaded bootloader-x86_64-bios-common v0.11.5
      Blocking waiting for file lock on package cache
   Downloading crates ...
      Blocking waiting for file lock on package cache
    Downloaded scopeguard v1.1.0
    Downloaded ryu v1.0.14
    Downloaded bootloader-x86_64-common v0.11.5
    Downloaded rustversion v1.0.13
    Downloaded zero v0.1.3
    Downloaded spinning_top v0.2.5
    Downloaded stable_deref_trait v1.2.0
    Downloaded unicode-ident v1.0.10
    Downloaded xmas-elf v0.8.0
    Downloaded syn v1.0.109
    Downloaded serde_derive v1.0.166
    Downloaded x86_64 v0.14.10
    Downloaded serde v1.0.166
    Downloaded raw-cpuid v10.7.0
    Downloaded heapless v0.7.16
    Downloaded uefi v0.20.0
    Downloaded proc-macro2 v1.0.63
    Downloaded serde-json-core v0.5.0
    Downloaded log v0.4.19
    Downloaded syn v2.0.23
    Downloaded lock_api v0.4.10
    Downloaded hash32 v0.2.1
    Downloaded conquer-util v0.3.0
    Downloaded rand_core v0.6.4
    Downloaded ptr_meta_derive v0.2.0
    Downloaded rand v0.8.5
    Downloaded ptr_meta v0.2.0
    Downloaded spin v0.9.8
    Downloaded rustc_version v0.4.0
    Downloaded rand_hc v0.3.2
    Downloaded quote v1.0.29
    Downloaded volatile v0.4.6
    Downloaded usize_conversions v0.2.0
    Downloaded uefi-macros v0.11.0
    Downloaded ucs2 v0.3.2
    Downloaded uart_16550 v0.2.18
    Downloaded semver v1.0.17
    Downloaded conquer-once v0.3.2
    Downloaded noto-sans-mono-bitmap v0.2.0
    Downloaded bit_field v0.10.2
      Updating crates.io index
      Blocking waiting for file lock on package cache
      Updating crates.io index
      Blocking waiting for file lock on package cache
      Blocking waiting for file lock on package cache
      Blocking waiting for file lock on package cache
      Blocking waiting for file lock on package cache
   Downloading crates ...
    Downloaded rustc-demangle v0.1.24
    Downloaded allocator-api2 v0.2.21
    Downloaded getopts v0.2.21
    Downloaded hashbrown v0.15.2
    Downloaded unicode-width v0.1.14
    Downloaded libc v0.2.169
    Downloaded compiler_builtins v0.1.145
   Downloading crates ...
      Blocking waiting for file lock on package cache
    Downloaded r-efi-alloc v1.0.0
    Downloaded r-efi v4.5.0
      Blocking waiting for file lock on package cache
     Compiling compiler_builtins v0.1.145
     Compiling core v0.0.0 (/home/codespace/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
     Compiling bootloader-x86_64-bios-boot-sector v0.11.5
     Compiling compiler_builtins v0.1.145
     Compiling core v0.0.0 (/home/codespace/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
     Compiling compiler_builtins v0.1.145
     Compiling bootloader-x86_64-bios-stage-2 v0.11.5
     Compiling core v0.0.0 (/home/codespace/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
     Compiling proc-macro2 v1.0.63
     Compiling quote v1.0.29
     Compiling unicode-ident v1.0.10
     Compiling autocfg v1.1.0
     Compiling semver v1.0.17
     Compiling syn v1.0.109
     Compiling lock_api v0.4.10
     Compiling rustversion v1.0.13
     Compiling syn v2.0.23
     Compiling serde v1.0.166
     Compiling rustc_version v0.4.0
     Compiling heapless v0.7.16
     Compiling bootloader_api v0.11.5
     Compiling serde_derive v1.0.166
     Compiling ptr_meta_derive v0.2.0
     Compiling uefi-macros v0.11.0
     Compiling rustc-std-workspace-core v1.99.0 (/home/codespace/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
  error: data-layout for target `i386-code16-stage-2-5063592404793443119`, `e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128`, differs from LLVM target's `i386-unknown-none-code16` default layout, `e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128`

  error: data-layout for target `i386-code16-boot-sector-5063592404793443119`, `e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128`, differs from LLVM target's `i386-unknown-none-code16` default layout, `e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128`

  error: could not compile `core` (lib) due to 1 previous error
  error: failed to compile `bootloader-x86_64-bios-stage-2 v0.11.5`, intermediate artifacts can be found at `/tmp/cargo-installLFwuwT`.
  To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
  error: could not compile `core` (lib) due to 1 previous error
  error: failed to compile `bootloader-x86_64-bios-boot-sector v0.11.5`, intermediate artifacts can be found at `/tmp/cargo-installxPh9QQ`.
  To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
     Compiling scopeguard v1.1.0
     Compiling bit_field v0.10.2
     Compiling bitflags v1.3.2
     Compiling volatile v0.4.6
     Compiling rand_core v0.6.4
     Compiling byteorder v1.4.3
     Compiling x86_64 v0.14.10
     Compiling hash32 v0.2.1
  error[E0053]: method `steps_between` has an incompatible type for trait
     --> /home/codespace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/x86_64-0.14.10/src/addr.rs:348:51
      |
  348 |     fn steps_between(start: &Self, end: &Self) -> Option<usize> {
      |                                                   ^^^^^^^^^^^^^ expected `(usize, Option<usize>)`, found `Option<usize>`
      |
      = note: expected signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> (usize, Option<usize>)`
                 found signature `fn(&addr::VirtAddr, &addr::VirtAddr) -> Option<usize>`
  help: change the output type to match the trait
      |
  348 |     fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
      |                                                   ~~~~~~~~~~~~~~~~~~~~~~

     Compiling spin v0.9.8
  error[E0053]: method `steps_between` has an incompatible type for trait
     --> /home/codespace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/x86_64-0.14.10/src/structures/paging/page.rs:272:51
      |
  272 |     fn steps_between(start: &Self, end: &Self) -> Option<usize> {
      |                                                   ^^^^^^^^^^^^^ expected `(usize, Option<usize>)`, found `Option<usize>`
      |
      = note: expected signature `fn(&Page<_>, &Page<_>) -> (usize, Option<usize>)`
                 found signature `fn(&Page<_>, &Page<_>) -> Option<usize>`
  help: change the output type to match the trait
      |
  272 |     fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
      |                                                   ~~~~~~~~~~~~~~~~~~~~~~

     Compiling zero v0.1.3
  error[E0599]: `(usize, Option<usize>)` is not an iterator
     --> /home/codespace/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/x86_64-0.14.10/src/structures/paging/page.rs:274:14
      |
  273 | /         Step::steps_between(&start.start_address, &end.start_address)
  274 | |             .map(|steps| steps / S::SIZE as usize)
      | |             -^^^ `(usize, Option<usize>)` is not an iterator
      | |_____________|
      |
      |
      = note: the following trait bounds were not satisfied:
              `(usize, Option<usize>): Iterator`
              which is required by `&mut (usize, Option<usize>): Iterator`

     Compiling conquer-util v0.3.0
     Compiling stable_deref_trait v1.2.0
     Compiling log v0.4.19
  Some errors have detailed explanations: E0053, E0599.
  For more information about an error, try `rustc --explain E0053`.
  error: could not compile `x86_64` (lib) due to 3 previous errors
  warning: build failed, waiting for other jobs to finish...
  error: failed to compile `bootloader-x86_64-uefi v0.11.5`, intermediate artifacts can be found at `/tmp/cargo-installjsMwxG`.
  To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path

(I understand that QEMU won't actually run in a Codespace but it should still compile)


Rust versions (installed with Rustup)

$ rustc --version
rustc 1.86.0-nightly (43ca9d18e 2025-02-08)

$ cargo --version
cargo 1.86.0-nightly (2928e3273 2025-02-07)
@ViktorPopp
Copy link

See #1387

@ajh123
Copy link
Author

ajh123 commented Feb 9, 2025

See #1387

@ViktorPopp That references files that don't exist on edition 3 like:

  1. x86_64-blog_os.json (simple fix - just copy it into a new file)
  2. x86_64-bootloader.json which no longer exists in ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bootloader-0.11.5/. There is a x86_64-stage-4.json but putting "rustc-abi": "x86-softfloat" inside it does not help.

@phil-opp
Copy link
Owner

Thanks for reporting! This should be fixed by rust-osdev/bootloader#491 and rust-osdev/bootloader#493. You might need to run a cargo update -p bootloader or cargo update -p bootloader_api to update your lockfile.

@ajh123
Copy link
Author

ajh123 commented Feb 10, 2025

Thanks for reporting! This should be fixed by rust-osdev/bootloader#491 and rust-osdev/bootloader#493. You might need to run a cargo update -p bootloader or cargo update -p bootloader_api to update your lockfile.

@phil-opp Can confirm it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants