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!! 🎉")

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 <conrad.irwin@gmail.com>
This commit is contained in:
claytonrcarter
2025-10-29 21:55:02 -06:00
committed by GitHub
co-authored by Conrad Irwin
parent 277ae27ca2
commit e30d5998e4
3 changed files with 10 additions and 23 deletions
+1 -1
View File
@@ -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
+8 -21
View File
@@ -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}"
@@ -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)");