Conversation
The pty4j library contains native executables (pty4j-unix-spawn-helper) that need to be signed with hardened runtime for Apple notarization. Changes: - Split build into createDistributable + packageDmg steps - Add step to extract, sign, and repackage JARs with native executables - Sign all Mach-O binaries with hardened runtime and entitlements - Re-sign entire app bundle after JAR modifications 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The pty4j library contains native executables (pty4j-unix-spawn-helper) that must be signed with hardened runtime for Apple notarization. This task: - Extracts pty4j JAR from the built app bundle - Signs all native binaries (.dylib and spawn-helper) with hardened runtime - Repackages the JAR with signed binaries - Re-signs the entire app bundle with entitlements Task dependencies: - Runs after createDistributable (via finalizedBy) - Runs before packageDmg (via mustRunAfter) Based on working implementation from boss-main project. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Code Review: macOS Notarization and PTY4J SigningOverall AssessmentThis PR addresses a critical issue with macOS notarization by properly signing PTY4J native binaries with hardened runtime. The implementation is solid and well-documented, with a few suggestions for improvement. ✅ Strengths
🔍 Issues & Concerns1. Duplication Between Gradle Task and CI Workflow (Minor)The Recommendation: Choose one approach:
The Gradle task is preferable because it works for local development and is easier to test. 2. SIGNED_SOMETHING Variable Issue (Critical)In the CI workflow (line 166), Fix: Use process substitution or restructure the logic to avoid subshell issues. 3. Silent Failure in CI Workflow (Moderate)Line 171 in the CI workflow has Recommendation: Fail the build on signing errors instead of just printing warnings. 4. Missing Error Handling in Gradle Task (Moderate)The Gradle task wraps signing in try-catch but continues on failure (line 292). This could lead to partially signed JARs. Consider tracking failures and throwing a GradleException if any signing operations fail. 5. Jar Extraction/Repackaging Could Break Signatures (Moderate)The CI workflow uses Recommendation: Test that signed binaries remain properly signed after repackaging. Consider using 6. File Detection Logic Could Be More Robust (Minor)Lines 164-165 (CI) and similar logic in Gradle use basic pattern matching. A Mach-O binary check using the 📊 Performance Considerations
🔒 Security Considerations
🧪 Test CoverageMissing:
Recommendations:
📝 Code Quality
Minor Nits
🎯 Action ItemsMust Fix (Breaking Issues):
Should Fix (Before Merge):
Nice to Have:
Verdict:
|
fix: macOS notarization and PTY4J signing
Summary
signPty4jBinariesGradle task for macOS notarizationdisable-library-validation,debugger)runtime-entitlements.plistfor JVM runtimeProblem
Apple notarization was failing because:
pty4j-unix-spawn-helperinside the pty4j JAR doesn't have hardened runtime enabledSolution
The new
signPty4jBinariesGradle task:--options runtimeTask dependencies:
createDistributable(viafinalizedBy)packageDmg(viamustRunAfter)Test plan
./gradlew :compose-ui:createDistributablelocallysignPty4jBinariestask executes and signs PTY4J natives./gradlew :compose-ui:packageDmgto create DMG🤖 Generated with Claude Code