fix: pin MACOSX_DEPLOYMENT_TARGET for cargo build (CRAN M1mac WARNING) - #2
Merged
Conversation
The CRAN M1mac check of 0.2.2 reported "object file ... was built for newer 'macOS' version (26.5) than being linked (26.0)" for the C/asm object files of the bundled `ring` crate. When MACOSX_DEPLOYMENT_TARGET is unset, the macOS deployment target chosen by the `cc` crate (host SDK version) differs from the one used by rustc and by R's link step, so ring's objects are stamped for a newer macOS than R links against, triggering the linker warning. Export an explicit MACOSX_DEPLOYMENT_TARGET for the cargo build on macOS (tools/config.R injects @MACOS_DEPLOYMENT_TARGET@ into src/Makevars.in), using R's own value when set, else rustc's per-arch default minimum (11.0 arm64 / 10.13 x86_64). The warning is one-directional, so a value <= R's link target is always safe. Verified locally: ring objects now stamp minos 11.0 (was 26.5). Bump to 0.2.4 and update cran-comments.md for the resubmission. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The CRAN M1mac additional check of v0.2.2 reported 1 WARNING (Prof. Brian Ripley, deadline 2026-07-06):
…repeated for 21 object files — all the C/assembly files from the bundled
ringcrate (curve25519, aes, montgomery, chacha, ghash, sha, p256…). The 12 main CRAN flavors were OK; only the M1mac check warned.Root cause
rust-lang/rust#136113: when
MACOSX_DEPLOYMENT_TARGETis unset, the macOS deployment target differs between the tools that producelibpdfsigner.a:cccrate (compiles ring's C/asm) defaults to the host SDK version (26.5);rustcand R's link step use a lower target (26.0).So ring's objects are stamped for a newer macOS than R links against → the one-directional "built for newer than being linked" warning.
Fix
Export an explicit
MACOSX_DEPLOYMENT_TARGETfor thecargo buildstep on macOS socc-rs andrustcagree on a target<=R's link target (the warning never fires for older-than-link):tools/config.Rcomputes.macos_deployment_target(R's ownMACOSX_DEPLOYMENT_TARGETwhen set, else rustc's per-arch default:11.0arm64 /10.13x86_64) and substitutes@MACOS_DEPLOYMENT_TARGET@;src/Makevars.inprefixes the placeholder onto thecargo buildinvocation (no-op on non-macOS / Windows).Verification
libpdfsigner.awith the fix: ring objects now stampminos 11.0(was 26.5), confirmed viaotool -loncurve25519.o,aes_nohw.o,montgomery.o.R CMD check --as-cranonpdfsigner_0.2.4.tar.gz: nold"newer macOS" warning in the install log. Remaining items are the known local-env messages (checkbashisms/ HTML Tidy not installed, installed-size NOTE).Bumps version to 0.2.4 and updates
cran-comments.mdfor the resubmission.🤖 Generated with Claude Code