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

[bug] MacOS bootstrapper breaks builds #3786

Closed
braebo opened this issue Mar 28, 2022 · 0 comments
Closed

[bug] MacOS bootstrapper breaks builds #3786

braebo opened this issue Mar 28, 2022 · 0 comments

Comments

@braebo
Copy link

braebo commented Mar 28, 2022

Describe the bug

When attempting to launch an app built with useBootstrapper enabled, the app fails to start. Running __bootstrapper directly results in a lot of errors.

Without the bootstrapper, custom commands fail with No such file or directory (os error 2).

Reproduction

Running __bootstrapper directly results in errors:

error log
$ /Users/fractal/dev/Projects/seamless-desktop/src-tauri/target/debug/bundle/macos/Seamless.app/Contents/MacOS/__bootstrapper
/Users/fractal/.zprofile: eval: line 57: conditional binary operator expected
/Users/fractal/.zprofile: eval: line 57: syntax error near `PS1'
/Users/fractal/.zprofile: eval: line 57: `  [[ -v PS1 ]] && PS1="$FIG_USER_PS1"'
/Users/fractal/.zshrc: line 10: ${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh: bad substitution
Error: Oh My Zsh can't be loaded from: sh. You need to run zsh instead.
Here's the process tree:

 PPID   PID COMMAND
    1 10063 /Applications/iTerm.app/Contents/MacOS/iTerm2
10063 10070 /Users/fractal/Library/Application Support/iTerm2/iTermServer-3.5.0beta5 /Users/fractal/Library/Application Support/iTerm2/iterm2-daemon-1.sock
10070 10072 /usr/bin/login -fqpl fractal /Applications/iTerm.app/Contents/MacOS/ShellLauncher --launch_shell
10072 10073 /bin/zsh (figterm)
10073 10081 /bin/zsh --login
10081 15158 sh /Users/fractal/dev/Projects/seamless-desktop/src-tauri/target/debug/bundle/macos/Seamless.app/Contents/MacOS/__bootstrapper

/Users/fractal/.p10k.zsh: line 15: local: can only be used in a function
/Users/fractal/.p10k.zsh: line 19: builtin: setopt: not a shell builtin
/Users/fractal/.p10k.zsh: line 21: syntax error near unexpected token `)'
/Users/fractal/.p10k.zsh: line 21: `() {'
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 31: alias: -L: invalid option
alias: usage: alias [-p] [name[=value] ... ]
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 36: unalias: -m: invalid option
unalias: usage: unalias [-a] name [name ...]
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 39: 0=${(%):-%N}: bad substitution
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 42: /.version: No such file or directory
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 42: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 43: /.revision-hash: No such file or directory
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 43: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 58: autoload: command not found
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 59: is-at-least: command not found
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 62: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 66: typeset: -g: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ...
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 81: syntax error near unexpected token `}'
/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh: line 81: `  if [[ $WIDGET == zle-isearch-update ]] && { $zsh_highlight__pat_static_bug || ! (( $+ISEARCHMATCH_ACTIVE )) }; then'
/Users/fractal/.zshrc: line 243: autoload: command not found
/Users/fractal/.zshrc: line 251: `p10k-on-pre-prompt': not a valid identifier

Without the bootstrapper:

Test example
<!-- index.svelte -->
<script lang="ts">
	import { Command } from '@tauri-apps/api/shell'
	
	async function test() {
		try {
			await new Command('echo', 'test').execute()
		} catch (e) {
			console.error('Test: ', e)  // `Test: - No such file or directory (os error 2)`
		}
	}
</script>

<button on:click={test}> Test </button>

With this scope:

{
	"name": "echo_test",
	"cmd": "echo",
	"args": [{ "validator": "\\S+" }]
}

A debug build shows the following error in the console: No such file or directory (os error 2)

Expected behavior

The app to start when clicked.

Platform and versions

Environment
  › OS: Mac OS 12.3.0 X64
  › Node.js: 16.13.1
  › npm: 8.1.2
  › pnpm: 6.32.3
  › yarn: 1.22.18
  › rustup: 1.24.3
  › rustc: 1.59.0
  › cargo: 1.59.0
  › Rust toolchain: stable-x86_64-apple-darwin

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.6(outdated, latest: 1.0.0-rc.7)
  › @tauri-apps/api [NPM]: 1.0.0-rc.2(outdated, latest: 1.0.0-rc.2)
  › tauri [RUST]: 1.0.0-rc.4,
  › tauri-build [RUST]: 1.0.0-rc.4,
  › tao [RUST]: 0.6.4,
  › wry [RUST]: 0.13.3,

App
  › build-type: bundle
  › CSP: default-src blob: data: asset: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'
  › distDir: ../build
  › devPath: http://localhost:3000/
  › framework: Svelte
  › bundler: Rollup

App directory structure
  ├─ node_modules
  ├─ static
  ├─ src-tauri
  ├─ .svelte-kit
  ├─ build
  ├─ .git
  ├─ .vscode
  ├─ .VSCodeCounter
  └─ src

Stack trace

No response

Additional context

I'm using the latest version of SvelteKit with SSR disabled.

lucasfernog added a commit to lucasfernog/tauri that referenced this issue Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant