overdrivenpotato / rust-psp

Rust on PSP. Panic and allocation support. Access PSP system libraries.
Other
588 stars 31 forks source link

Cannot Build `examples/rust-std-hello-world` #168

Closed aethiopicuschan closed 4 months ago

aethiopicuschan commented 4 months ago

I am encountering errors when trying to build examples/rust-std-hello-world. Here is my environment.

PC: M2 MacBookAir Rust Version: cargo 1.74.0-nightly (414d9e3a6 2023-09-22) Build Command: RUST_PSP_BUILD_STD=1 cargo psp Log:

❯ RUST_PSP_BUILD_STD=1 cargo psp
[NOTE]: Detected RUST_PSP_BUILD_STD env var, using "build-std".
   Compiling compiler_builtins v0.1.101
   Compiling core v0.0.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/core)
   Compiling libc v0.2.148
   Compiling cc v1.0.79
   Compiling memchr v2.5.0
   Compiling proc-macro2 v1.0.78
   Compiling std v0.0.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/std)
   Compiling unicode-ident v1.0.12
   Compiling syn v1.0.109
   Compiling paste v1.0.14
   Compiling libm v0.2.8
   Compiling psp v0.3.7 (/Users/aethiopicuschan/tmp/rust-psp/psp)
   Compiling unstringify v0.1.4
   Compiling quote v1.0.35
   Compiling unwind v0.0.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/unwind)
   Compiling num_enum_derive v0.5.11
   Compiling rustc-std-workspace-core v1.99.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc)
   Compiling cfg-if v1.0.0
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.23
   Compiling rustc-std-workspace-alloc v1.99.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling panic_unwind v0.0.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/panic_unwind)
   Compiling panic_abort v0.0.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/panic_abort)
   Compiling gimli v0.28.0
   Compiling std_detect v0.1.5 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling hashbrown v0.14.0
   Compiling object v0.32.0
   Compiling miniz_oxide v0.7.1
   Compiling addr2line v0.21.0
   Compiling proc_macro v0.0.0 (/Users/aethiopicuschan/.rustup/toolchains/nightly-2023-09-26-aarch64-apple-darwin/lib/rustlib/src/rust/library/proc_macro)
   Compiling bitflags v1.3.2
   Compiling num_enum v0.5.11
error[E0658]: use of unstable library feature 'restricted_std'
  |
  = help: add `#![feature(restricted_std)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'restricted_std'
  --> /Users/aethiopicuschan/tmp/rust-psp/psp/src/lib.rs:88:9
   |
88 | pub use std::panic::catch_unwind;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(restricted_std)]` to the crate attributes to enable

error[E0635]: unknown feature `psp_std`
  --> /Users/aethiopicuschan/tmp/rust-psp/psp/src/lib.rs:20:38
   |
20 | #![cfg_attr(feature = "std", feature(psp_std))]
   |                                      ^^^^^^^

Some errors have detailed explanations: E0635, E0658.
For more information about an error, try `rustc --explain E0635`.
error: could not compile `psp` (lib) due to 3 previous errors
`cargo build` command exited with status: ExitStatus(unix_wait_status(25856))

Is the issue I'm encountering related to my environment or the specific command I'm using? Alternatively, could this be attributed to a bug or features that are not yet implemented in the toolchain or library? Any insights or guidance on how to proceed would be greatly appreciated.

Thanks.

sajattack commented 4 months ago

The std feature is still experimental and not finished. I think you may need a different command to use it. It also hasn't been worked on in some time so it probably fell apart with upstream updates. Some community members in our discord community (@dvdkon) have been working on updating it lately. Probably the best place for you to get help with it. https://discord.gg/WY8XhDG