[dotnet] Runtime pack retains Homebrew Brotli paths and breaks hardened-runtime app redistribution #6991
Unanswered
ttrias
asked this question in
Writing Formulae/Casks
Replies: 1 comment 3 replies
|
This sounds like a bug in dotnet to me. It copies libraries without checking their dependencies and doesn't resign any libraries either? |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
The Apple-silicon
dotnet10.0.302 bottle modifies the .NET macOS runtime pack'slibSystem.IO.Compression.Native.dylibso that it depends on Homebrew's external Brotli libraries. When that runtime-pack binary is copied into a self-contained, Developer ID-signed macOS application, hardened runtime rejects the external Brotli library because it has a different signing Team ID. The application can be signed and notarized successfully but aborts indyldbefore launch.Bottle evidence
This can be inspected without installing the formula:
For the current ARM64 Tahoe bottle (
dotnet10.0.302, bottle SHA-256a420ba0e0a6f87c5b62327a4f40c6d2130bf589af985ec6ed02f7c00d9067cec), the output includes:After installation, the placeholders resolve under
/opt/homebrew. Anet10.0-macosRelease build withosx-arm64, hardened runtime, and Developer ID signing copies this native library intoMyApp.app/Contents/MonoBundle. The application then fails at launch with:The app bundle and installer passed strict
codesignverification, Apple notarization, stapling, and Gatekeeper assessment. Those checks did not catch the external runtime dependency.Comparison with Microsoft's SDK
The corresponding native library installed by Microsoft's official .NET 10.0.302 SDK does not depend on Homebrew or external Brotli libraries:
Rebuilding the same application with Microsoft's SDK produced a signed bundle with no non-system absolute dependencies and the application launched successfully.
Expected behavior
Native libraries under
Microsoft.NETCore.App.Runtime.osx-arm64should remain suitable for self-contained macOS publication. Ideally, the formula would preserve the upstream relocatable runtime-pack binaries instead of relinking them to Homebrew dependencies. If that is not compatible with Homebrew policy, the formula should clearly warn that it cannot safely produce hardened-runtime redistributable macOS applications.If Homebrew retains those external links, preserving .NET's
--self-containedcontract requires the Homebrew-provided SDK to package the external native dependency closure into the application. Bundling those libraries is not an optional workaround; it is the alternative implementation of a genuinely self-contained runtime. That closure must include not onlylibbrotlidecandlibbrotlienc, but also dependencies such aslibbrotlicommon, inside the application bundle—for example, underContents/Frameworks.The publish integration would also need to:
@loader_pathor@rpathreferences;/opt/homebrew,/usr/local, or another build-machine-specific path;DYLD_LIBRARY_PATHavailable.A runtime pack that leaves Brotli under
/opt/homebrewis framework- or environment-dependent in practice, even when the project was published with--self-contained. Merely requiring Brotli to be installed on the target machine would not preserve self-contained runtime semantics and would continue to fail on clean Macs. If Homebrew cannot provide or maintain this publishing integration, preserving the upstream runtime-pack binaries is the simpler and safer behavior.Environment
I could not use the Homebrew Core issue template because
brew doctorreports intentional local conditions, including centrally owned Homebrew directories and FileMaker ODBC libraries under/usr/local/lib. The template directs reports with unresolved doctor warnings to Discussions.Disclosure: I used OpenAI Codex to help inspect the binaries and draft this report. I verified the commands and output and will answer maintainer questions myself.
All reactions