Repository navigation
fix(modrinth-sandbox): allow macOS Metal shader compiler cache access - #8561
Open
pparanoiidd wants to merge 1 commit into
Open
pparanoiidd wants to merge 1 commit into
pparanoiidd wants to merge 1 commit into
Conversation
Contributor
Pull request changelogAppAddedChangedDeprecatedRemovedFixedSecurityWebsiteAddedChangedDeprecatedRemovedFixedSecurityHostingAddedChangedDeprecatedRemovedFixedSecurity |
|
Tick the box to add this pull request to the merge queue (same as
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8556
Allows sandboxed JVM processes on macOS to use Apple's Metal shader compiler (
MTLCompilerService) cache underDARWIN_USER_CACHE_DIR. This fixesMTLLibraryErrorDomain/sandbox_extension_issue_file(Operation not permitted) failures in Metal-backed mods likemcopt, and restores persistent Metal shader caching for vanilla Minecraft 26.3's Vulkan (MoltenVK) backend.Changes (
packages/modrinth-sandbox/src/backend/macos/mod.rs)Single Seatbelt rule addition inside
if command.is_jvm:file-read*andfile-write*on<cache_root>(/<bundle-id>)?/com.apple.(metal|metalfe|gpuarchiver)(/.*)?(covers both bundled JDKs likecom.azul.zulu.javaand unbundled JDKs).file-write-create(vnode-type DIRECTORYonly) on<cache_root>/<bundle-id>soMetal.frameworkcan create the parent folder on a cold cache.file-issue-extensionon those Metal cache paths, restricted strictly tocom.apple.app-sandbox.readandcom.apple.app-sandbox.read-writeforMTLCompilerService.file-link,file-map-executable,process-exec, and non-Metal writes remain denied.Testing
Verified on macOS (Apple M3 Pro, Azul Zulu Java 25) via
sandbox-execwith the rendered profile frommod.rsand a freshly clearedDARWIN_USER_CACHE_DIR/com.azul.zulu.javabefore each run:file-write-createSeatbelt denials in ~9s; cache directory never created (shaders forced uncached in memory).javadenials;com.apple.metal,com.apple.metalfe, andcom.apple.gpuarchivercreated and populated cleanly.mcopt-metal 0.3.0-alpha.2: InitializedMetal 3 (mcopt)cleanly and wrotecom.apple.metalfe/.../monolithic_metal.pcmwith 0javadenials.makeLibrary(source:options:)compilation for both bundled and unbundled binaries, and confirmed non-Metal writes underDARWIN_USER_CACHE_DIRremain blocked.