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(cli): ios dev and ios build support for bun #10569

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Conversation

lucasfernog
Copy link
Member

No description provided.

@lucasfernog lucasfernog requested a review from a team as a code owner August 11, 2024 20:44
Copy link
Contributor

Package Changes Through 028cffe

There are 6 changes which include tauri-build with prepatch, tauri-codegen with prerelease, tauri-utils with prerelease, tauri-cli with prerelease, @tauri-apps/cli with prerelease, tauri with prerelease

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tauri-utils 2.0.0-rc.2 2.0.0-rc.3
tauri-bundler 2.0.1-rc.1 2.0.1-rc.2
tauri-runtime 2.0.0-rc.2 2.0.0-rc.3
tauri-runtime-wry 2.0.0-rc.2 2.0.0-rc.3
tauri-codegen 2.0.0-rc.2 2.0.0-rc.3
tauri-macros 2.0.0-rc.2 2.0.0-rc.3
tauri-plugin 2.0.0-rc.2 2.0.0-rc.3
tauri-build 2.0.0-rc.2 2.0.1-rc.0
tauri 2.0.0-rc.2 2.0.0-rc.3
@tauri-apps/cli 2.0.0-rc.3 2.0.0-rc.4
tauri-cli 2.0.0-rc.3 2.0.0-rc.4

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Comment on lines +65 to +67
// so we must change working directory to the src-tauri folder to resolve the tauri dir
if (var_os("npm_lifecycle_event").is_none() && var_os("PNPM_PACKAGE_NAME").is_none())
|| var("npm_config_user_agent").map_or(false, |agent| agent.starts_with("bun"))
Copy link
Member

Choose a reason for hiding this comment

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

should we remove this check and always set the directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

when using pnpm npm yarn etc the CWD is automatically set to the app dir, so moving up two parents would crash it.
when using cargo or bun it'll actually be under gen/apple, and we can't resolve the tauri dir from there.. so we need this condition

Copy link
Member Author

Choose a reason for hiding this comment

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

we could instead check if CWD ends with gen/apple idk if it helps

Copy link
Member

Choose a reason for hiding this comment

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

xcode-script and android-script are only valid if they are executed from a process that was launched by ios dev/build or android dev/build, right? ios dev/build or android dev/build could pass the app_dir using either the options mechanism we have or through an environment variable.

Copy link
Member

Choose a reason for hiding this comment

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

also looking at

crate::helpers::app_paths::resolve();
, we already resolve the app_dir, why not use that and set the directory to it.

Copy link
Member Author

Choose a reason for hiding this comment

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

we can only resolve because we changed the CWD earlier..
to use the options we need to resolve the tauri config, which means we need to resolve the tauri dir too, so it doesn't help

Copy link
Member Author

Choose a reason for hiding this comment

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

and xcode isn't a big fan of environment variables, plus if there's already an opened instance it wouldn't receive it

Copy link
Member

Choose a reason for hiding this comment

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

alright, let's merge as is and hope it doesn't crash again.

@bfish510
Copy link

I believe this may still be an issue. I changed the rust build phase of the Xcode project from bun tauri ios xcode-script -v --platform to cargo tauri ios xcode-script -v --platform to fix iOS builds. Unsure of the repercussions of this, but it's unblocked me.

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