-
-
Notifications
You must be signed in to change notification settings - Fork 401
fix: bundle daemon sidecars in app build #506
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b23219d
fix: bundle daemon sidecars in app build
ad44bf9
fix: move tauri external bins to bundle-only config
e27036e
fix: run sidecar prebuild command cross-platform
d66dc60
docs: split macOS launchd daemon setup into docs guide
7983ece
fix: honor Tauri target triple for sidecar builds
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ CodexMonitor.zip | |
| .claude/ | ||
| .cursor/ | ||
| public/assets/material-icons/ | ||
| src-tauri/binaries/ | ||
|
|
||
| # Nix | ||
| result | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| repo_root="$(cd "${script_dir}/.." && pwd)" | ||
| src_tauri_dir="${repo_root}/src-tauri" | ||
| binaries_dir="${src_tauri_dir}/binaries" | ||
|
|
||
| build_target="${TARGET:-${CARGO_BUILD_TARGET:-}}" | ||
| if [[ -z "${build_target}" ]]; then | ||
| build_target="$(rustc -vV | awk '/^host: / { print $2 }')" | ||
| fi | ||
| if [[ -z "${build_target}" ]]; then | ||
| echo "Failed to resolve Rust target triple" | ||
| exit 1 | ||
| fi | ||
|
|
||
| cargo_target_args=() | ||
| release_dir="${src_tauri_dir}/target/release" | ||
| if [[ -n "${TARGET:-${CARGO_BUILD_TARGET:-}}" ]]; then | ||
| cargo_target_args=(--target "${build_target}") | ||
| release_dir="${src_tauri_dir}/target/${build_target}/release" | ||
| fi | ||
|
|
||
| bin_ext="" | ||
| if [[ "${build_target}" == *windows* ]]; then | ||
| bin_ext=".exe" | ||
| fi | ||
|
|
||
| mkdir -p "${binaries_dir}" | ||
|
|
||
| daemon_sidecar_path="${binaries_dir}/codex_monitor_daemon-${build_target}${bin_ext}" | ||
| daemonctl_sidecar_path="${binaries_dir}/codex_monitor_daemonctl-${build_target}${bin_ext}" | ||
|
|
||
| # Bootstrap sidecar paths so tauri's build-script path checks can pass. | ||
| if [[ ! -f "${daemon_sidecar_path}" ]]; then | ||
| : > "${daemon_sidecar_path}" | ||
| fi | ||
| if [[ ! -f "${daemonctl_sidecar_path}" ]]; then | ||
| : > "${daemonctl_sidecar_path}" | ||
| fi | ||
| if [[ -z "${bin_ext}" ]]; then | ||
| chmod +x "${daemon_sidecar_path}" "${daemonctl_sidecar_path}" | ||
| fi | ||
|
|
||
| ( | ||
| cd "${src_tauri_dir}" | ||
| if [[ ${#cargo_target_args[@]} -gt 0 ]]; then | ||
| cargo build --release "${cargo_target_args[@]}" \ | ||
| --bin codex_monitor_daemon \ | ||
| --bin codex_monitor_daemonctl | ||
| else | ||
| cargo build --release \ | ||
| --bin codex_monitor_daemon \ | ||
| --bin codex_monitor_daemonctl | ||
| fi | ||
| ) | ||
|
|
||
| cp -f \ | ||
| "${release_dir}/codex_monitor_daemon${bin_ext}" \ | ||
| "${daemon_sidecar_path}" | ||
| cp -f \ | ||
| "${release_dir}/codex_monitor_daemonctl${bin_ext}" \ | ||
| "${daemonctl_sidecar_path}" | ||
|
|
||
| if [[ -z "${bin_ext}" ]]; then | ||
| chmod +x "${daemon_sidecar_path}" "${daemonctl_sidecar_path}" | ||
| fi | ||
|
|
||
| echo "Prepared sidecars for ${build_target} in ${binaries_dir}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "bundle": { | ||
| "externalBin": [ | ||
| "binaries/codex_monitor_daemon", | ||
| "binaries/codex_monitor_daemonctl" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
build:tauri-sidecarsscript invokessh scripts/build-tauri-sidecars.sh, butbuild-tauri-sidecars.shis written for Bash (set -euo pipefail, arrays,[[ ... ]],BASH_SOURCE). On systems where/bin/shis not Bash (e.g. Ubuntudash), this command fails immediately (set: Illegal option -o pipefail), so the sidecar build entrypoint added in this commit is unusable and cannot prepare binaries when called directly.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e27036e. I replaced the shell-only sidecar step with a cross-platform Node script (
scripts/build-tauri-sidecars.mjs) and updated bothbuild:tauri-sidecarsandbeforeBuildCommandto use it, so this no longer depends on Bash or./...shon Windows.