Add OpenMP upstream sync + correctness CI test (bump 19.1.0 → 19.1.5)#2
Merged
Conversation
The sed split on '<tr' leaves the HTML preamble as the first chunk. That preamble contains 'Apple clang 1700+' prose and a Release tarball example, so it passed the Apple-clang filter and triggered a spurious "clang 1700 has no SHA1; skipping" WARN on stderr. Fix: tighten the case pattern from '*"Apple clang"*' to '"<tr"*"Apple clang"*' so only genuine table-row chunks are considered; the preamble (which starts with '<html>') is silently skipped.
- Add begin/end marker count check (grep -cF) in replace_block; errors and returns non-zero without touching the file if either marker is absent or appears more than once (fixes latent truncation bug). - Capture original file mode portably (stat -f on macOS, stat -c on Linux) and chmod the mktemp before mv, so exec bits survive rewrites. - Clean up temp file on awk failure to avoid leaking it. - Restore 100755 on install-openmp.sh (was wrongly stripped to 100644). - Add regression test in tests/test-edit.sh: replace_block must return non-zero and leave file unchanged when END marker is missing.
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.
Two related additions for keeping the macOS OpenMP runtime correct and current.
1. Upstream sync mechanism
Keeps the pinned OpenMP versions in sync with https://mac.r-project.org/openmp/ and applies the first update it produces.
sync-openmp.sh— parses the upstream page and regenerates the pinned version + SHA1 table ininstall-openmp.sh(the clangcaseblock and--helplist) andREADME.md, between sentinel markers. SHA1s are computed by downloading the changed tarball (the page's value is only a cross-check), it fails closed on a bad fetch or empty parse, and--checkreports drift without writing..github/workflows/check-upstream.yml— runs the sync weekly (and on demand) and opens a PR when upstream changes. It never auto-merges.19.1.0 → 19.1.5for Apple clang 1700 (SHA15b44175bcbaa334b0c57391482e068ea185c95a2), across the case block, help text, and README.2. OpenMP correctness CI test
Verifies the installed runtime actually runs in parallel and computes correct results — not just that the library is present.
test-openmp.sh— compiles and runs an OpenMP program in C and in a minimal R package (ompcheck, built with the documentedPKG_CPPFLAGS='-Xclang -fopenmp'/PKG_LIBS='-lomp') against the installed runtime, asserting real multithreading and a deterministic parallel-reduction result (sum(1..1e6) == 500000500000). Distinct exit codes make failures unambiguous..github/workflows/test-openmp.yml— runs it onmacos-14/macos-15, path-filtered to the runtime-affecting files (install-openmp.sh,test-openmp.sh, the workflow), plusworkflow_dispatch.Notes
install-openmp.shis unchanged — it remains a static, pinned-table installer.install-openmp.shwas simplified to point at--helpinstead of duplicating the version list.