Skip to content

fix(core): Incorrect resource_dir when app run from new style target/PLATFORM+ARCH/(debug|release) dir - #8852

Merged
lucasfernog merged 6 commits into
tauri-apps:devfrom
samwillis:fix
Feb 18, 2024
Merged

lucasfernog merged 6 commits into
tauri-apps:devfrom
samwillis:fix

Conversation

@samwillis

Copy link
Copy Markdown
Contributor

V2 changed the target dir from /target/(debug|release) to target/PLATFORM+ARCH/(debug|release). When the app is run from the target dir, resource_dir fails to correctly resolve the resource directory on Mac (and maybe Linux) as the cwd doesn't match the check for the /target/(debug|release).

This changes the check to support both /target/(debug|release) and target/PLATFORM+ARCH/(debug|release)

@samwillis
samwillis requested a review from a team as a code owner February 13, 2024 18:56
Comment thread core/tauri-utils/src/platform.rs Outdated
Comment on lines -242 to -243
if curr_dir.ends_with(format!("{MAIN_SEPARATOR}target{MAIN_SEPARATOR}debug").as_str())
|| curr_dir.ends_with(format!("{MAIN_SEPARATOR}target{MAIN_SEPARATOR}release").as_str())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is broken anyways, it doesn't take into account that cargo supports arbitray profile names, cc @lucasfernog

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, pushed a change. I think checking if .cargo-lock exists should be enough

lucasfernog
lucasfernog previously approved these changes Feb 18, 2024
@lucasfernog
lucasfernog merged commit 28fb036 into tauri-apps:dev Feb 18, 2024
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.

3 participants