You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 614bf9a
Browse filesBrowse the repository at this point in the historyBrowse files
Fix macOS notarization by signing the Dart Sass snapshot (#14718)
Dart Sass 1.101.0 changed its macOS AOT snapshot
(dart-sass/src/sass.snapshot) from an ELF blob to a native Mach-O.
Apple's notary ignores non-native files but requires every Mach-O in
the payload to be signed, so the never-signed snapshot flipped
notarization to Invalid and no ticket was issued -- the "CloudKit
Record not found" seen at the stapling step was a symptom of the
missing ticket, not a propagation race. The previous exit-code-only
check masked the rejection entirely.
- Sign dart-sass/src/sass.snapshot (no entitlements; it is loaded by
the already-signed dart VM, so it needs only a valid signature and
secure timestamp)
- Verify notarytool returns status: Accepted before stapling, dumping
the developer log on rejection, so a rejected submission fails the
build instead of proceeding silently
- Echo notarytool output and log command stdout on failure, so the
notarization verdict is visible in CI
- Keep a short, fail-loud retry around stapling as narrow insurance
against a genuine, rare CloudKit ticket-propagation gap
- Document the incident and add a pre-merge step to the dependency
upgrade checklist: bundled-binary bumps must be validated by
dispatching create-release.yml, since normal CI never signs or
notarizes the installers
- Add a repo rule for single current-year copyright headers on new
files
New source files get a single current-year header — `Copyright (C) <year> Posit Software, PBC` (e.g. `2026`), not a back-dated `2020-<year>` range. Leave existing files' headers alone unless you're already substantially editing them.
11
+
12
+
Don't guess the year — read it from the system (`date +%Y`, or the current date stated at session start). Copying a header from an existing file carries a stale year.
Copy file name to clipboardExpand all lines: dev-docs/upgrade-dependencies.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,17 @@ Change version numbers in `./configuration` to correspond to new versions.
2
2
3
3
Update hardcoded version strings in `src/command/check/check.ts` (`versionConstraints` array, ~line 249) so that they match the new versions in `configuration`. The `configuration` file warns about this in a comment.
4
4
5
+
## Verify installer signing & notarization before merging (bundled binaries)
6
+
7
+
Regular CI does **not** build, sign, or notarize the installers — that only happens in `create-release.yml`. A bundled binary bump (Deno, Pandoc, Dart Sass, Typst, esbuild, …) can change what the platform code-signing/notarization steps must cover, so a bump that passes normal CI can still break the macOS/Windows release build. **Before merging any PR that bumps a bundled binary**, dispatch the release workflow on the PR branch without publishing and confirm the installer jobs pass:
8
+
9
+
```bash
10
+
gh workflow run create-release.yml --repo quarto-dev/quarto-cli --ref <branch> -f publish-release=false
11
+
# then watch make-installer-mac and make-installer-win in the resulting run
12
+
```
13
+
14
+
Why this bites (real incident, #14664): Dart Sass 1.101.0 changed its macOS AOT snapshot (`dart-sass/src/sass.snapshot`) container from ELF to Mach-O. Apple's notary ignores non-native files but requires every Mach-O signed, so the never-signed snapshot flipped notarization from Accepted to Invalid — invisible to normal CI, only caught at release time. When a bump does require a new signing entry, add it in `package/src/macos/installer.ts` / the Windows `sign-files` paths; see `llm-docs/code-signing-installers.md`.
Copy file name to clipboardExpand all lines: llm-docs/code-signing-installers.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ Sequence:
82
82
1.**Decide whether to sign** — reads `QUARTO_APPLE_APP_DEV_ID`. Empty → skip everything below with a warning.
83
83
2.**Sign individual binaries** with `codesign` (via `signCode()` at `package/src/macos/installer.ts:293`). Two lists:
84
84
-**With entitlements** (`entitlements.plist`): per-arch `deno`, `dart-sass/src/dart`, `esbuild`, `pandoc`, `typst`, optional `typst-gather`, optional `deno_dom/libplugin.dylib`. Entitlements grant JIT (`com.apple.security.cs.allow-jit`) and unsigned-executable-memory (`com.apple.security.cs.allow-unsigned-executable-memory`) — required by Deno's V8 and by the other JIT-using tools.
85
-
-**Without entitlements**: shell wrappers and JS bundle— `quarto`, `quarto.js`, `dart-sass/sass`.
85
+
-**Without entitlements**: shell wrappers, JS bundle, and the Dart Sass AOT snapshot — `quarto`, `quarto.js`, `dart-sass/sass`, `dart-sass/src/sass.snapshot`. The snapshot is a Mach-O loaded by the (entitled) `dart` VM, not its own process, so it needs a valid signature + secure timestamp but no entitlements. See the notarization-Invalid troubleshooting below for why it must be signed.
86
86
-`codesign` invocation: `-s <id> --timestamp --options=runtime --force --deep --verbose=4` (`+ --entitlements <plist>` for the first list). `--options=runtime` opts into Hardened Runtime, a notarization prerequisite.
87
87
3.**Build the tarball** (`quarto-<v>-macos.tar.gz`) from the signed `pkg-working` tree. The tarball ships unwrapped binaries with the signatures embedded — no `.pkg`, no notarization, but each Mach-O is signed individually.
88
88
4.**Build the core `.pkg`** with `pkgbuild` (identifier `org.rstudio.quarto`), then sign it via `productsign --sign <installer-id> --timestamp` (function `signPackage()` at `package/src/macos/installer.ts:282`). Renames signed output back over the original. Note: the `pkgbuild` invocation passes `--install-location` twice (`/Library/Quarto` then `/Applications/quarto`); CLI argv semantics mean the later flag wins, so the effective install location is `/Applications/quarto`. The earlier `/Library/Quarto` value is dead and should be cleaned up next time the file is touched.
@@ -121,6 +121,21 @@ If the Account Holder is unreachable (departed staff, etc.):
121
121
122
122
Determining which type the current signing team uses: inspect any past released `.pkg` from a non-CI environment (CI logs mask the Team ID portion of cert Common Names). On a Mac, `pkgutil --check-signature quarto-X.Y.Z-macos.pkg` shows the full chain. On Linux/WSL, the `.pkg` is a xar archive — its TOC contains base64-encoded X.509 certs that can be extracted with Python's stdlib and parsed with `openssl x509`. The cert subject's `O = ...` field is a company name for org enrollment, a person name for individual enrollment.
Symptom: `notarizeAndWait()` throws `Notarization was not accepted (status: Invalid)`, and the dumped `xcrun notarytool log <id>` lists per-file `issues` such as:
127
+
128
+
```text
129
+
"The binary is not signed with a valid Developer ID certificate."
130
+
"The signature does not include a secure timestamp."
131
+
```
132
+
133
+
Root cause: the named file is a Mach-O binary inside the bundle that no `codesign` call covered. Every native Mach-O in the payload must be individually signed (with `--timestamp`); Apple's notary rejects the whole submission if any is unsigned. Fix: add the file to `signWithEntitlements` (if it JITs / is a directly-executed hardened-runtime process) or `signWithoutEntitlements` (data-like code loaded by another signed process) in `package/src/macos/installer.ts`, then re-run the release build.
134
+
135
+
This is easy to miss because a bundled binary can *change format across a version bump*. Concrete case (#14664): Dart Sass `src/sass.snapshot` shipped as an **ELF** blob through 1.87.0 — Apple's notary ignored it (not native code), so it was never signed and notarization passed for years. Dart Sass 1.101.0 switched the macOS AOT snapshot to a native **Mach-O** (`cf fa ed fe`), which the notary then required signed; the never-signed snapshot flipped the result to Invalid. Diagnosing this depended on the terminal-status check in `notarizeAndWait()` — `notarytool submit --wait` had exited 0, so an exit-code-only check would (and previously did) mask the rejection and proceed to `stapler staple`, whose downstream "CloudKit … Record not found" error is a misleading symptom of the missing ticket, not a propagation race.
136
+
137
+
Prevention: dispatch `create-release.yml` (publish-release=false) on the branch before merging any bundled-binary bump — see `dev-docs/upgrade-dependencies.md`.
138
+
124
139
### Historical: `waitForNotaryStatus` / `altool` (candidate for removal)
125
140
126
141
`waitForNotaryStatus()` at `package/src/macos/installer.ts:360` is **dead code** — defined and never called. Kept here so we have enough context to decide whether to delete it next time the file is touched.
0 commit comments