Skip to content

Commit

Permalink
[FIX] issue leptos-rs#358 cargo leptos build fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Trahe committed Sep 1, 2024
1 parent 5dd5ec2 commit a1c3193
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
9 changes: 8 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ serde = { version = "1.0", features = ["derive"] }
anyhow = "1.0"
libflate = "2"
log = "0.4"
current_platform = "0.2"

lightningcss = { version = "1.0.0-alpha.57", features = ["browserslist"] }
flexi_logger = "0.28"
Expand Down
16 changes: 13 additions & 3 deletions src/config/bin_package.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use camino::Utf8PathBuf;
use cargo_metadata::{Metadata, Target};

use current_platform::CURRENT_PLATFORM;
use super::{project::ProjectDefinition, Profile, ProjectConfig};
use crate::{
config::Opts,
Expand Down Expand Up @@ -107,9 +107,19 @@ impl BinPackage {
} else {
&name
};
file.join(profile.to_string())
let mut test_file = file.join(profile.to_string())
.join(name)
.with_extension(file_ext)
.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
// if !test_file.exists(){
// test_file = Utf8PathBuf::from(format!(
// "target/{}/{}/{}",
// CURRENT_PLATFORM, profile.to_string(),test_file.file_name().unwrap()
// ));
// }
test_file
};

let mut src_paths = metadata.src_path_dependencies(&package.id);
Expand Down

0 comments on commit a1c3193

Please sign in to comment.