Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ci): ignore Nix developer override for DMG linker (#5581)

Sean Ayefeefc90d1572
diff --git a/.github/workflows/build_desktop_on_tag.yml b/.github/workflows/build_desktop_on_tag.yml
index 86e5430305..9041ff0be5 100644
--- a/.github/workflows/build_desktop_on_tag.yml
+++ b/.github/workflows/build_desktop_on_tag.yml
@@ -8,7 +8,7 @@ name: Build Desktop on Tag
workflow_dispatch:
inputs:
ref:
- description: Release tag to build (v* or refs/tags/v*). Defaults to the selected protected ref or release tag.
+ description: Optional release tag override (v* or refs/tags/v*). Leave empty to build the branch or tag selected for this workflow run.
type: string
jobs:
resolve-ref:
@@ -26,7 +26,7 @@ jobs:
# Resolve the git ref for desktop builds from any trigger type:
# push (tag) → github.ref
# create (tag) → github.event.ref
- # workflow_dispatch → inputs.ref (validated) or github.ref (protected)
+ # workflow_dispatch → inputs.ref (release tag) or the selected workflow ref
case "$EVENT_NAME" in
push)
@@ -40,20 +40,22 @@ jobs:
echo "ref=$GITHUB_EVENT_REF" >> "$GITHUB_OUTPUT"
;;
workflow_dispatch)
- ref="${INPUT_REF:-$SELECTED_REF}"
- if [[ "$ref" =~ ^refs/tags/v[0-9][0-9A-Za-z._-]*$ ]]; then
- echo "ref=$ref" >> "$GITHUB_OUTPUT"
+ # An empty override means "build the ref selected in GitHub's Run workflow
+ # menu". This allows branch builds while keeping explicit overrides limited
+ # to release tags.
+ if [ -z "$INPUT_REF" ]; then
+ echo "ref=$SELECTED_REF" >> "$GITHUB_OUTPUT"
exit 0
fi
- if [[ "$ref" =~ ^v[0-9][0-9A-Za-z._-]*$ ]]; then
- echo "ref=refs/tags/$ref" >> "$GITHUB_OUTPUT"
+ if [[ "$INPUT_REF" =~ ^refs/tags/v[0-9][0-9A-Za-z._-]*$ ]]; then
+ echo "ref=$INPUT_REF" >> "$GITHUB_OUTPUT"
exit 0
fi
- if [ -z "$INPUT_REF" ] && [ "$SELECTED_REF_PROTECTED" = "true" ]; then
- echo "ref=$SELECTED_REF" >> "$GITHUB_OUTPUT"
+ if [[ "$INPUT_REF" =~ ^v[0-9][0-9A-Za-z._-]*$ ]]; then
+ echo "ref=refs/tags/$INPUT_REF" >> "$GITHUB_OUTPUT"
exit 0
fi
- echo "Manual desktop builds only allow release tags (v*) or a protected ref." >&2
+ echo "The ref input only accepts release tags (v*). To build a branch, select it in the Run workflow menu and leave ref empty." >&2
exit 1
;;
*)
@@ -68,8 +70,6 @@ jobs:
GITHUB_EVENT_REF: ${{ github.event.ref }}
GITHUB_EVENT_REF_TYPE: ${{ github.event.ref_type }}
SELECTED_REF: ${{ github.ref }}
- SELECTED_REF_NAME: ${{ github.ref_name }}
- SELECTED_REF_PROTECTED: ${{ github.ref_protected }}
build-appimage:
needs:
- resolve-ref
diff --git a/nix/tauri-desktop.nix b/nix/tauri-desktop.nix
index 398b96f904..823fa27aa3 100644
--- a/nix/tauri-desktop.nix
+++ b/nix/tauri-desktop.nix
@@ -507,14 +507,32 @@
};
tauriDesktopDmgSigningIdentity = builtins.getEnv "APPLE_SIGNING_IDENTITY";
tauriDesktopDmgAppleLd = pkgs.writeShellScriptBin "ld" ''
- appleLd=$(/usr/bin/xcrun --sdk macosx --find ld)
+ appleDeveloperDir=$(
+ unset DEVELOPER_DIR
+ /usr/bin/xcode-select --print-path
+ )
+ appleLd="$appleDeveloperDir/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
if [ ! -x "$appleLd" ]; then
- echo "xcrun did not return an executable Apple linker: $appleLd" >&2
+ appleLd=$(
+ export DEVELOPER_DIR="$appleDeveloperDir"
+ export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
+ unset SDKROOT TOOLCHAINS
+ /usr/bin/xcrun --sdk macosx --find ld
+ )
+ fi
+ if [ ! -x "$appleLd" ]; then
+ echo "could not locate an executable Apple linker: $appleLd" >&2
exit 1
fi
+ case "$appleDeveloperDir" in
+ /nix/store/*)
+ echo "xcode-select unexpectedly selected Nix: $appleDeveloperDir" >&2
+ exit 1
+ ;;
+ esac
case "$appleLd" in
/nix/store/*)
- echo "xcrun unexpectedly selected a Nix linker: $appleLd" >&2
+ echo "Apple linker selection unexpectedly resolved to Nix for $appleDeveloperDir: $appleLd" >&2
exit 1
;;
esac
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag.rs
index 81fda08787..1a0f3cee73 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag.rs
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag.rs
@@ -56,7 +56,7 @@ fn workflow_dispatch() -> WorkflowDispatch {
inputs.insert(
"ref".into(),
WorkflowDispatchInput {
- description: "Release tag to build (v* or refs/tags/v*). Defaults to the selected protected ref or release tag.".into(),
+ description: "Optional release tag override (v* or refs/tags/v*). Leave empty to build the branch or tag selected for this workflow run.".into(),
required: false,
input_type: "string".into(),
default: None,
@@ -87,6 +87,4 @@ fn resolve_ref_step() -> Step<Run> {
.add_env(("GITHUB_EVENT_REF", "${{ github.event.ref }}"))
.add_env(("GITHUB_EVENT_REF_TYPE", "${{ github.event.ref_type }}"))
.add_env(("SELECTED_REF", "${{ github.ref }}"))
- .add_env(("SELECTED_REF_NAME", "${{ github.ref_name }}"))
- .add_env(("SELECTED_REF_PROTECTED", "${{ github.ref_protected }}"))
}
diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/resolve_desktop_ref.sh b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/resolve_desktop_ref.sh
index 4488146c89..e6b3e096fb 100644
--- a/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/resolve_desktop_ref.sh
+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/scripts/resolve_desktop_ref.sh
@@ -3,7 +3,7 @@ set -euo pipefail
# Resolve the git ref for desktop builds from any trigger type:
# push (tag) → github.ref
# create (tag) → github.event.ref
-# workflow_dispatch → inputs.ref (validated) or github.ref (protected)
+# workflow_dispatch → inputs.ref (release tag) or the selected workflow ref
case "$EVENT_NAME" in
push)
@@ -17,20 +17,22 @@ case "$EVENT_NAME" in
echo "ref=$GITHUB_EVENT_REF" >> "$GITHUB_OUTPUT"
;;
workflow_dispatch)
- ref="${INPUT_REF:-$SELECTED_REF}"
- if [[ "$ref" =~ ^refs/tags/v[0-9][0-9A-Za-z._-]*$ ]]; then
- echo "ref=$ref" >> "$GITHUB_OUTPUT"
+ # An empty override means "build the ref selected in GitHub's Run workflow
+ # menu". This allows branch builds while keeping explicit overrides limited
+ # to release tags.
+ if [ -z "$INPUT_REF" ]; then
+ echo "ref=$SELECTED_REF" >> "$GITHUB_OUTPUT"
exit 0
fi
- if [[ "$ref" =~ ^v[0-9][0-9A-Za-z._-]*$ ]]; then
- echo "ref=refs/tags/$ref" >> "$GITHUB_OUTPUT"
+ if [[ "$INPUT_REF" =~ ^refs/tags/v[0-9][0-9A-Za-z._-]*$ ]]; then
+ echo "ref=$INPUT_REF" >> "$GITHUB_OUTPUT"
exit 0
fi
- if [ -z "$INPUT_REF" ] && [ "$SELECTED_REF_PROTECTED" = "true" ]; then
- echo "ref=$SELECTED_REF" >> "$GITHUB_OUTPUT"
+ if [[ "$INPUT_REF" =~ ^v[0-9][0-9A-Za-z._-]*$ ]]; then
+ echo "ref=refs/tags/$INPUT_REF" >> "$GITHUB_OUTPUT"
exit 0
fi
- echo "Manual desktop builds only allow release tags (v*) or a protected ref." >&2
+ echo "The ref input only accepts release tags (v*). To build a branch, select it in the Run workflow menu and leave ref empty." >&2
exit 1
;;
*)