Skip to content

Fix Quick Look extension entitlements stripped by release signing#494

Merged
schuyler merged 2 commits into
mainfrom
claude/fix-ql-entitlements-284-fa9e1d2f2388a87e
Jun 30, 2026
Merged

Fix Quick Look extension entitlements stripped by release signing#494
schuyler merged 2 commits into
mainfrom
claude/fix-ql-entitlements-284-fa9e1d2f2388a87e

Conversation

@schuyler

Copy link
Copy Markdown
Owner

Summary

  • Remove global CODE_SIGN_ENTITLEMENTS override from build action — each target now uses its own entitlements as declared in the Xcode project
  • Replace codesign --deep with inside-out signing — QL extension signed with its own entitlements first, then outer app bundle
  • Add com.apple.security.network.client to QL extension entitlements (WKWebView needs it for subprocess IPC in sandbox)
  • Add sandbox entitlement verification gates in release and staple workflows

Context

The Quick Look extension shipped in RC 3000.0.7-rc.2 without com.apple.security.app-sandbox because the release pipeline overwrote its entitlements in two places. macOS refused to load the unsandboxed extension. Additionally, the extension was missing network.client, causing WKWebView's subprocesses to crash inside the sandbox.

Verified locally: QL preview renders markdown after these changes.

Related to #284

Test plan

  • 1026 tests pass (0 unexpected), matches baseline
  • Local QL preview confirmed working (Finder Space on .md file)
  • CI release-build workflow passes with new entitlement gates
  • Next RC: @caius confirms QL preview works in signed/notarized build

The release signing pipeline overwrote the QL extension's entitlements
with the main app's in two places: a global CODE_SIGN_ENTITLEMENTS
override on the xcodebuild command line, and codesign --deep re-signing
all nested components with the app's entitlements. The extension shipped
without com.apple.security.app-sandbox, so macOS refused to load it.

Additionally, the extension was missing com.apple.security.network.client,
which WKWebView requires for its subprocess IPC even when rendering
local HTML inside a sandbox.

- Remove CODE_SIGN_ENTITLEMENTS override from build action
- Replace --deep with inside-out signing (extension first, then app)
- Add network.client entitlement to QL extension
- Add sandbox entitlement verification gates in release and staple workflows

Related to #284
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Report

Current Coverage: 62.98%

Coverage Details (Summary)
Name                                                                                                                                   Coverage             
-------------------------------------------------------------------------------------------------------------------------------------- -------------------- 
MASPreferences.bundle                                                                                                                  0.00% (0/0)          
MacDown 3000.app                                                                                                                       63.95% (9323/14579)  
    /Users/runner/work/macdown3000/macdown3000/MacDown/Code/Utility/MPMathJaxListener.m                                                61.54% (16/26)       
        -[MPMathJaxListener callbacks]                                                                                                 100.00% (5/5)        
        -[MPMathJaxListener addCallback:forKey:]                                                                                       100.00% (3/3)        
        -[MPMathJaxListener invokeCallbackForKey:]                                                                                     100.00% (8/8)        
        +[MPMathJaxListener isSelectorExcludedFromWebScript:]                                                                          0.00% (0/5)          
        +[MPMathJaxListener isKeyExcludedFromWebScript:]                                                                               0.00% (0/5)          
    /Users/runner/work/macdown3000/macdown3000/MacDown/Code/Extension/DOMNode+Text.m                                                   100.00% (111/111)    
        MPAccumulatedTextCountMake                                                                                                     100.00% (7/7)        
        MPAccumulatedTextCountZero                                                                                                     100.00% (3/3)        
        MPAccumulatedTextCountAdd                                                                                                      100.00% (5/5)        
        MPGetStringAccumulatedTextCount                                                                                                100.00% (34/34)      
        __MPGetStringAccumulatedTextCount_block_invoke                                                                                 100.00% (3/3)        
        __MPGetStringAccumulatedTextCount_block_invoke.2                                                                               100.00% (4/4)        
        MPGetChildrenAccumulatedTextCount                                                                                              100.00% (6/6)        
        MPGetNodeAccumulatedTextCount                                                                                                  100.00% (32/32)      
        MPTextCountForString                                                                                                           100.00% (9/9)        
        -[DOMNode(Text) textCount]                                                                                                     100.00% (8/8)        
    /Users/runner/work/macdown3000/macdown3000/Dependency/peg-markdown-highlight/HGMarkdownHighlightingStyle.m                         89.23% (58/65)       
        +[HGMarkdownHighlightingStyle colorFromARGBColor:]                                                                             100.00% (6/6)        
        -[HGMarkdownHighlightingStyle initWithType:attributesToAdd:toRemove:fontTraitsToAdd:]                                          88.89% (8/9)         
        -[HGMarkdownHighlightingStyle initWithStyleAttributes:baseFont:]                                                               88.00% (44/50)       
    /Users/runner/work/macdown3000/macdown3000/MacDown/Code/Utility/FileURLInlining.m                                                  26.60% (25/94)       
        +[FileURLInlining inlineFromIterable:]                                                                                         0.00% (0/11)         
        -[FileURLInlining initWithURL:]                                                                                                0.00% (0/6)          
        -[FileURLInlining init]                                                                                                        100.00% (3/3)        
        -[FileURLInlining inlineContent]                                                                                               0.00% (0/9)          
        -[FileURLInlining imageContent]                                                                                                0.00% (0/12)         
        +[FileURLInlining mimeTypeForFilePath:]                                                                                        100.00% (22/22)      
        -[FileURLInlining clippingContent]                                                                                             0.00% (0/4)          
        +[FileURLInlining isTextClippingAtPath:]                                                                                       0.00% (0/12)         
        +[FileURLInlining textContentFromClipping:]                                                                                    0.00% (0/15)         
    /Users/runner/work/macdown3000/macdown3000/MacDown/Code/Utility/MPResourceWatcherSet.m                                             93.75% (90/96)       
        -[MPResourceWatcherSet init]                                                                                                   100.00% (6/6)        
        -[MPResourceWatcherSet dealloc]                                                                                                0.00% (0/3)          
        -[MPResourceWatcherSet watchedPaths]                                                                                           100.00% (3/3)        
        -[MPResourceWatcherSet updateWatchedPaths:]                                                                                    100.00% (16/16)      
        -[MPResourceWatcherSet addWatcherForPath:]                                                                                     100.00% (34/34)      
        __42-[MPResourceWatcherSet addWatcherForPath:]_block_invoke                                                                    100.00% (6/6)        
        __42-[MPResourceWatcherSet addWatcherForPath:]_block_invoke.5                                                                  93.33% (14/15)       
        __42-[MPResourceWatcherSet addWatcherForPath:]_block_invoke_2                                                                  75.00% (6/8)         
        -[MPResourceWatcherSet stopAll]                                                                                                100.00% (5/5)        
    /Users/runner/work/macdown3000/macdown3000/MacDown/Code/Extension/hoedown_html_patch.c                                             91.39% (191/209)     
        hoedown_patch_reset_checkbox_index                                                                                             100.00% (3/3)        
        new_growable_buffer                                                                                                            100.00% (3/3)        
        hoedown_patch_get_checkbox_index                                                                                               0.00% (0/3)          
        hoedown_patch_render_blockcode                                                                                                 89.09% (49/55)       

... (3430 more lines truncated)

📊 **Full coverage report available in workflow artifacts**

@schuyler schuyler merged commit 7859d95 into main Jun 30, 2026
5 of 9 checks passed
@schuyler schuyler deleted the claude/fix-ql-entitlements-284-fa9e1d2f2388a87e branch June 30, 2026 22:25
schuyler added a commit that referenced this pull request Jul 1, 2026
## Summary

- Remove global `CODE_SIGN_ENTITLEMENTS` override from build action —
each target now uses its own entitlements as declared in the Xcode
project
- Replace `codesign --deep` with inside-out signing — QL extension
signed with its own entitlements first, then outer app bundle
- Add `com.apple.security.network.client` to QL extension entitlements
(WKWebView needs it for subprocess IPC in sandbox)
- Add sandbox entitlement verification gates in release and staple
workflows

## Context

The Quick Look extension shipped in RC 3000.0.7-rc.2 without
`com.apple.security.app-sandbox` because the release pipeline overwrote
its entitlements in two places. macOS refused to load the unsandboxed
extension. Additionally, the extension was missing `network.client`,
causing WKWebView's subprocesses to crash inside the sandbox.

Verified locally: QL preview renders markdown after these changes.

Related to #284

## Test plan

- [x] 1026 tests pass (0 unexpected), matches baseline
- [x] Local QL preview confirmed working (Finder Space on .md file)
- [ ] CI release-build workflow passes with new entitlement gates
- [ ] Next RC: @caius confirms QL preview works in signed/notarized
build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant