From e30d5998e47eaeb8915e6ab59a0381a9c622c52b Mon Sep 17 00:00:00 2001 From: claytonrcarter Date: Wed, 29 Oct 2025 23:55:02 -0400 Subject: [PATCH] bundle: Restore local install on macOS (#41482) I just pulled and ran a local build via `script/bundle-mac -l -i` but found that the resulting bundle wasn't installed as expected. (me: "ToggleAllDocks!! Wait! Where is it?!") Looking into, it looks like the `-l` flag was removed in #41392, leaving the `$local_only` var orphaned, which then left the `-i/$local_install` flag unreachable. I suspect that this was unintentional, so this PR re-adds the `-l/$local_only` flag to `script/bundle-mac`. I ran the build again and confirmed that local install seemed to work as expected. (ie "ToggleAllDocks!! :tada:") While here, I also removed the last reference to `$local_arch`, because all other references to that were removed in #41392. /cc @osiewicz Release Notes: - N/A --------- Co-authored-by: Conrad Irwin --- .github/workflows/run_tests.yml | 2 +- script/bundle-mac | 29 +++++-------------- .../xtask/src/tasks/workflows/run_tests.rs | 2 +- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index a9d20e2d88aa5bf15396304fa0fb24a5d0655387..63c882bf7b0cf447bfd641002bcf67667bbea8b6 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -46,7 +46,7 @@ jobs: echo "${output_name}=false" >> "$GITHUB_OUTPUT" } - check_pattern "run_action_checks" '^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask' -qP + check_pattern "run_action_checks" '^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask|script/' -qP check_pattern "run_docs" '^docs/' -qP check_pattern "run_licenses" '^(Cargo.lock|script/.*licenses)' -qP check_pattern "run_nix" '^(nix/|flake\.|Cargo\.|rust-toolchain.toml|\.cargo/config.toml)' -qP diff --git a/script/bundle-mac b/script/bundle-mac index 3f895ec14b72522abddb7548a6139729adcdfe8d..0b4c1285fb21915c24bfeafecd9d8f1e190681fc 100755 --- a/script/bundle-mac +++ b/script/bundle-mac @@ -6,8 +6,6 @@ source script/lib/blob-store.sh build_flag="--release" target_dir="release" open_result=false -local_arch=false -local_only=false local_install=false can_code_sign=false @@ -196,10 +194,6 @@ function sign_app_binaries() { /usr/bin/codesign --force --timestamp --options runtime --entitlements crates/zed/resources/zed.entitlements --sign "$IDENTITY" "${app_path}" -v else echo "One or more of the following variables are missing: MACOS_CERTIFICATE, MACOS_CERTIFICATE_PASSWORD, APPLE_NOTARIZATION_KEY, APPLE_NOTARIZATION_KEY_ID, APPLE_NOTARIZATION_ISSUER_ID" - if [[ "$local_only" = false ]]; then - echo "To create a self-signed local build use ./scripts/build.sh -ldf" - exit 1 - fi echo "====== WARNING ======" echo "This bundle is being signed without all entitlements, some features (e.g. universal links) will not work" @@ -215,7 +209,7 @@ function sign_app_binaries() { codesign --force --deep --entitlements "${app_path}/Contents/Resources/zed.entitlements" --sign ${MACOS_SIGNING_KEY:- -} "${app_path}" -v fi - if [[ "$target_dir" = "debug" && "$local_only" = false ]]; then + if [[ "$target_dir" = "debug" ]]; then if [ "$open_result" = true ]; then open "$app_path" else @@ -227,20 +221,13 @@ function sign_app_binaries() { bundle_name=$(basename "$app_path") - if [ "$local_only" = true ]; then - if [ "$local_install" = true ]; then - rm -rf "/Applications/$bundle_name" - mv "$app_path" "/Applications/$bundle_name" - echo "Installed application bundle: /Applications/$bundle_name" - if [ "$open_result" = true ]; then - echo "Opening /Applications/$bundle_name" - open "/Applications/$bundle_name" - fi - else - if [ "$open_result" = true ]; then - echo "Opening $app_path" - open "$app_path" - fi + if [ "$local_install" = true ]; then + rm -rf "/Applications/$bundle_name" + mv "$app_path" "/Applications/$bundle_name" + echo "Installed application bundle: /Applications/$bundle_name" + if [ "$open_result" = true ]; then + echo "Opening /Applications/$bundle_name" + open "/Applications/$bundle_name" fi else dmg_target_directory="target/${target_triple}/${target_dir}" diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rs index 8060bafa5aaabc34a3b20cdb29ff606298a82f64..82b40f23d5b4adfa2ae04eb2aa14d0b92ff66285 100644 --- a/tooling/xtask/src/tasks/workflows/run_tests.rs +++ b/tooling/xtask/src/tasks/workflows/run_tests.rs @@ -25,7 +25,7 @@ pub(crate) fn run_tests() -> Workflow { let should_check_docs = PathCondition::new("run_docs", r"^docs/"); let should_check_scripts = PathCondition::new( "run_action_checks", - r"^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask", + r"^\.github/(workflows/|actions/|actionlint.yml)|tooling/xtask|script/", ); let should_check_licences = PathCondition::new("run_licenses", r"^(Cargo.lock|script/.*licenses)");