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

fix issue #358 #359

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fix issue #358 #359

wants to merge 2 commits into from

Conversation

holg
Copy link

@holg holg commented Sep 1, 2024

cargo leptos build looks for the server binary always in
target/debug
and then fails with:

Error: at ~/.cargo/git/checkouts/cargo-leptos-eb87bffcd2ca8f75/5dd5ec2/src/compile/server.rs:40:22

Caused by:
    0: at `~/.cargo/git/checkouts/cargo-leptos-eb87bffcd2ca8f75/5dd5ec2/src/service/site.rs:117:44
    1: Could not read "target/debug/test_leptos" at `~/.cargo/git/checkouts/cargo-leptos-eb87bffcd2ca8f75/5dd5ec2/src/ext/fs.rs:44:10
    2: No such file or directory (os error 2)

For convienience i added the current_platform = "0.2" to the dependencies
So in bin_package i added to test for the file to exist,
if not use the TARGET_TRIPLE before debug:

let mut test_file = file.join(profile.to_string())
            .join(name)
            .with_extension(file_ext);
        // Check if the file exists and if not, try to prepend target_triple
        // right now it mail fail to find target/debug/name
        // but the build is successful and in target/"target_triple"/debug/name
        // https://github.com/leptos-rs/cargo-leptos/issues/358
        if !test_file.exists(){
            test_file = Utf8PathBuf::from(format!(
                "target/{}/{}/{}",
                CURRENT_PLATFORM, profile.to_string(),test_file.file_name().unwrap()
            ));
        }
        test_file

@benwis
Copy link
Contributor

benwis commented Oct 23, 2024

@holg is this still an issue?

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

Successfully merging this pull request may close these issues.

2 participants