overdrivenpotato / rust-psp

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

cargo psp doesn't seem to work in workspaces #146

Closed hatmajster closed 1 year ago

hatmajster commented 1 year ago

I get the following error

   Compiling bitflags v1.3.2
   Compiling num_enum v0.5.11
   Compiling psp-test v0.1.0 ($DIR/workspacetest/psp-test)
    Finished dev [unoptimized + debuginfo] target(s) in 10.76s
Saved to $DIR/workspacetest/target/mipsel-sony-psp/debug/EBOOT.PBP
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', $HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-psp-0.2.2/src/fix_imports.rs:27:42
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrac

Here's a reproduction script:

#!/bin/bash -xe

cargo new workspacetest
cd workspacetest
cargo new psp-test
echo '
[workspace]
members = ["psp-test"]

' >> Cargo.toml

cd psp-test
cargo add psp

echo '#![no_std]
#![no_main]

// Create a module named "sample_module" with version 1.0
psp::module!("sample_module", 1, 0);

fn psp_main() {
    psp::enable_home_button();
    psp::dprintln!("Hello PSP from rust!");
}' > src/main.rs

cd ..
cargo psp -p psp-test

For whatever reason, this is producing EBOOT.PBP file, so it might not be that bad. But my real project for unknown to me reason does not have this line "Saved to ...EBOOT.PBP" at all. Investigating still, but would apreciate what to do with just what's described.

zetanumbers commented 1 year ago

If i remember correctly, #125 resolves this. Could you please try it out?

hatmajster commented 1 year ago

Of course it does, for whatever reason I decided to not look into already submited PRs. Uninstalling cargo-psp and installing it from your PR fixed the issue both in the above demo and in my own workspace project. Closing, and thanks for quick response