log mingw cpuid guard application during install#265
Merged
Conversation
patchTbbMachineHeader() previously exited silently in all cases: header missing, guard already present, unexpected header form, and even success. The unexpected-form case is dangerous -- it means the guard is absent and mingw builds may fail (the same way the #248 fix was silently incomplete, caught only by diffing a real Rtools45 build in #253). Log the normal outcomes in the style of the provenance logging added in #256, and emit a warning when the header does not have the expected form, so a reformatted Rtools/oneTBB header surfaces at install time instead of as a downstream build failure. Also add unit tests covering application, idempotency, and the malformed-header path.
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.
Summary
patchTbbMachineHeader()previously exited silently in every case: header missing, guard already present, unexpected header form, and even on success. The unexpected-form case is the dangerous one -- it means the mingw cpuid guard is silently absent, which is exactly how the #248 fix turned out to be incomplete (only caught by manually diffing a real Rtools45 build; see #253).This PR:
applied,already present,header not found) in the style of the provenance logging added in log tbb header and library provenance during install #256#include <intrin.h>line, so a reformatted Rtools/oneTBB header surfaces at install time rather than as a downstream mingw build failuretests/test-install-libs.Rcovering guard application, idempotency, and the malformed-header path (warning emitted, file left unmodified)Testing
tests/test-install-libs.Rpasses (all 17 checks)R CMD INSTALLon Linux; the install log now shows** mingw cpuid guard already present in '../inst/include/oneapi/tbb/detail/_machine.h'(the bundled copy is patched at the source level)