Repository navigation
Conversation
When conda installs a package, it rewrites the build-time prefix stored inside some binaries. For osx-arm64 packages it then re-signs them (ad hoc), but for osx-64 packages it does not. Recent conda-forge osx-64 builds are ad hoc signed (e.g. kiwisolver >= 1.4.9; older builds were unsigned), so after installation these files carry a signature that no longer matches their contents. Most processes, including conda's Python, don't care. But the official Julia binaries (as installed by juliaup) run with Apple's hardened runtime, and the kernel kills such a process (SIGKILL, "Code Signature Invalid") as soon as it touches a modified page. So on an Intel Mac, `using ReactionMechanismSimulator` in `julia` gets killed when PythonCall imports matplotlib, and with it kiwisolver's extension module. This includes the "Loading RMS" check that install_rms.sh itself runs, whose failure is currently hidden by the script's "continuing anyway" fallback. Running RMG itself is not affected, because there Python is the host process and loads Julia into it. This adds `python utilities.py fix-macos-signatures`, which reads conda's own records (conda-meta/*.json) to find the files it patched in binary mode, and re-signs only those whose signature is now invalid. Unsigned files and files with valid signatures are left alone, so it is safe to run repeatedly, and on Apple Silicon it normally finds nothing to do. install_rms.sh runs it on macOS before it first starts Julia. Because later `conda install`s can break signatures again, the installation docs explain the symptom and how to re-run the fix. micromamba (used by CondaPkg) has the same osx-arm64-only rule; pixi (rattler) re-signs on all macOS platforms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #3037.
Why
On Intel Macs, conda leaves some binaries with invalid code signatures: it rewrites paths stored inside them during installation, but only re-signs them for osx-arm64 packages. The official Julia binaries run with Apple's hardened runtime, so Julia is killed ("Code Signature Invalid", exit code 137) as soon as it loads one. For example,
using ReactionMechanismSimulatorinjuliais killed when PythonCall imports matplotlib'skiwisolverextension. RMG runs are unaffected, because there Python hosts Julia. See #3037 for the full diagnosis.What this changes
utilities.py fix-macos-signatures(new). It reads conda's install records (conda-meta/*.json) to find the files conda patched in binary mode, checks each withcodesign --verify, and re-signs (ad hoc) only those whose signature is invalid. Unsigned files and valid signatures are left alone. It does nothing on Linux or Windows. It's safe to re-run, and on Apple Silicon it should normally find nothing to do.install_rms.shruns it on macOS, after the script's lastconda installand before it first starts Julia.anacondaDeveloper.rst): a note describing the symptom and how to re-run the fix after laterconda installs, which can break signatures again.Testing
On an Intel Mac (macOS 26.7, conda 26.3.2 with the libmamba solver, Julia 1.10.9 from juliaup):
codesign --verifyreported 25 conda-patched files inrmg_envwith invalid signatures. Importing, fromjuliathrough PythonCall,greenlet,kiwisolveror other affected modules killed Julia (exit 137), while importing them frompythonworked.using ReactionMechanismSimulatorinjuliawas killed.using ReactionMechanismSimulatorworks.kiwisolver(which brings back the invalid signature), then ranpython utilities.py fix-macos-signatures. It re-signed kiwisolver plus 9 executables from glib and dbus that were also invalid, in about 11 s. A second run re-signed nothing.bash -nandzsh -npass oninstall_rms.sh. I have not run the fullinstall_rms.shwith this change. macOS CI (Intel and Apple Silicon) will run it.Not changed
install_rms.sh's "Loading RMS" check is followed by|| echo "... continuing anyway", so a failed (or killed) load is reported as success. That's why this went unnoticed. I left that behaviour alone here.🤖 Generated with Claude Code