Skip to content

Add an opt-in portable DER entitlements encoder (apple.portable_derq) - #3104

Open
mauriciogg wants to merge 1 commit into
bazelbuild:mainfrom
mauriciogg:portable-derq
Open

mauriciogg wants to merge 1 commit into
bazelbuild:mainfrom
mauriciogg:portable-derq

Conversation

@mauriciogg

@mauriciogg mauriciogg commented Oct 13, 2026 •

Copy link
Copy Markdown

Summary

ProcessDEREntitlements runs /usr/bin/derq to produce the DER copy of the entitlements. derq only exists on macOS, so every link of such a binary has a Mac-only input even when compilation and linking otherwise run on Linux remote executors.

Opt-in only. Without the feature nothing changes: the action still runs /usr/bin/derq in the Mac execution group. Documented in doc/common_info.md alongside the other apple.* features.

Testing

//tools/derq:derq_unittest checks the encoder's output is byte-identical to Apple's derq on fixtures covering every plist value type (bool, integer, string, data-free arrays and dicts, nesting, unicode, long strings) and key ordering, plus the error cases: derq aborts on <data> and <date> values and silently truncates <real>, and the tool rejects those with an error instead. The feature path has been used to build and run a large iOS app with remote execution on Linux workers, with the resulting binary installing and launching on the simulator.

ProcessDEREntitlements runs /usr/bin/derq to encode the entitlements plist
that is linked into the __TEXT,__ents_der section of simulator binaries. derq
exists only on macOS, so every link of such a binary carries a Mac-only input
even when compilation and linking run on Linux remote executors.

Add tools/derq, a Python encoder of the TN3125 DER layout invoked with derq's
argv (`query -f xml -i IN -o OUT --raw`), expose it from the xplat tools
toolchain as derq_tool, and use it for ProcessDEREntitlements when the new
apple.portable_derq feature is enabled. Without the feature nothing changes:
the action still runs /usr/bin/derq in the Mac execution group.

The encoder's output is byte-identical to derq's on fixtures covering every
plist value type and key ordering (derq_unittest). derq aborts on <data> and
<date> values and silently truncates <real>; the tool rejects them instead.
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.

2 participants