Repository navigation
build: Keep system headers out of the generated .dd files on gcc's continuation lines - #853
Conversation
…continuation lines gcc wraps long dependency lists with a single leading space on continuation lines. The filter in `src/Makevars.deps` only dropped lines starting with two spaces, which is clang's style, so absolute paths survived. Join continuation lines of any indentation before splitting, so that every entry is normalised to the two-space form. The absolute, Windows drive, `vendor` and `..` filters then apply on every line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
|
Review of this pull request at e71d033, by a Claude Code reviewer with clean context that read the description, the diff against What was run
What holds
HighNone. MediumNone. Low
Generated by Claude Code |
`LOCALE=C sort` sets a variable that `sort` ignores, so the order followed the caller's locale. Under `en_US.UTF-8` a rebuild reordered the entries of 19 checked-in `.dd` files. Use `LC_ALL=C`, so that the output is the same in every locale. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
Accepted limitationsThe clean review found nothing above Low; its one Low,
Generated by Claude Code |
|
Make the |
A `.d` file with CRLF line endings, as a compiler on Windows may write, left a `\r` before each line end, so the continuation-line join did not fire, the filter kept system headers, and the `\r` ended up in the generated `.dd` file. The rule now pipes the `.d` file through `tr -d '\r'` first, which POSIX `tr`, BSD `tr` and GNU `tr` all accept, so CRLF and LF input give the same `.dd` file with LF line endings. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd432Aef98ibnZSSsYn
|
Review of the CRLF commit of this pull request, 71d9fb8, by a Claude Code reviewer with clean context that read the description of #853 and What was run
What holds
HighNone. MediumNone. Low
Generated by Claude Code |
Question: should the
|
Accepted limitationsThe first clean review found nothing above Low; its Low (
Generated by Claude Code |
|
Accepting macOS >= 11. Any changes needed for that? |
|
No changes needed. The Generated by Claude Code |
Bring in #853 (gcc continuation lines in the generated `.dd` files) and #869 (no query text or SQLite message as a `printf()` format, `fetch_blob()` guarded against `NULL`). The conflict in `SqliteResultImpl::raise_sqlite_exception()` keeps this branch's `throw std::runtime_error(sqlite3_errmsg(conn))`: a failed prepare reaches R at cpp11's entry point like every other step error here, and cpp11 passes the message through `"%s"`, so it is not a format string either. The `.dd` files regenerated with the new `src/Makevars.deps` are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd432Aef98ibnZSSsYn
The filter that turns the compiler's dependency output into the checked-in
src/*.ddfiles drops system headers only from lines indented by two spaces, which is how clang writes continuation lines. gcc indents them by one space, so a build with gcc kept absolute system header paths (andvendor/and..paths) in every regenerated.ddfile, and the CI step "Auto-update from GitHub Actions" then committed that bloat. The rule insrc/Makevars.depsnow first joins continuation lines of any indentation into one line, and the existing splitting and filtering run on the result, so both compilers give the same files. It is the same fix as commit 95de00b of the old Arrow stack, without the regenerated.ddfiles, because onmainthe checked-in files are already clean.This fixes only part of #836, so it does not close it. The issue also asks to keep
vendor/extensions/dependencies in the.ddfiles so that an incremental build notices edits to the bundled extensions, and the filter still drops everyvendorpath by design. That needs a decision on whichvendorpaths to keep and a regeneration of the.ddfiles, and is left for a separate pull request. This one is the second checkbox of the issue.Tested at
main(3b7bea3) with gcc 13.3.0: touching allsrc/*.candsrc/*.cppfiles and runningpkgbuild::compile_dll()regenerates the.ddfiles. Without the change,git statusshows 26 modified.ddfiles, with about 13,500 added lines, 4,606 of them absolute/usror/optpaths. With the change, the same rebuild leaves no.ddfile modified. With clang (CC=clang,CXX=clang++) the same rebuild also leaves the.ddfiles unchanged.R CMD check --no-manual(without vignettes) passes with one NOTE about a hidden.gitentry, which comes from building in a git worktree.A second commit changes
LOCALE=C sortin the same rule toLC_ALL=C sort, becausesortignoresLOCALE, so under a locale such asen_US.UTF-8a rebuild reordered the entries of 19.ddfiles (39 lines); with it, rebuilds underen_US.UTF-8,de_CH.UTF-8andC.UTF-8all leave the.ddfiles unchanged.A third commit, asked for by the maintainer, makes the rule resilient against CRLF line endings. A
.dfile with CRLF endings, as a compiler on Windows may write, left a\rbefore each line end, so the continuation-line join did not fire, the filter kept system headers, and stray\rbytes ended up in the generated.ddfile. The rule now pipes the.dfile throughtr -d '\r'before thesedcalls;\ris a POSIX escape fortr, so this works with GNU, BSD/macOS and Rtools'tralike, whereas\rin asedregular expression is a GNU extension that BSDsedreads as a literalr. Tested by running the rule (makeon a wrapper Makefile includingsrc/Makevars.deps) on hand-written gcc-style (one-space continuation lines) and clang-style (two-space).dfiles with absolute system headers,vendorand..paths, each with LF and with CRLF endings: with the change, CRLF and LF give byte-identical.ddfiles with LF endings, no\rand no absolute paths, and the LF output is byte-identical to that of the previous rule; before it, the CRLF output differed, carried\rbytes and kept a/usrpath. A fullR CMD INSTALLwith gcc after touching all sources regenerated all 27.ddfiles and left none modified.The full CI matrix, dispatched by hand for 71d9fb8 (run 43414159767), passes on every job: Ubuntu x86 and ARM with R 4.2 to devel, macOS with R 4.5 and 4.6, and Windows x86 and ARM with R 4.5, 4.6 and devel. A dispatched run fails when the build changes a tracked file, so this also shows that no
.ddfile changes on any of these platforms.The fix comes from the old Arrow stack (95de00b in #795); the plan to rework that stack splits it out as a separate pull request from
main, since nothing else depends on it. Reviewed in a clean review, which found nothing above Low; see the accepted limitations.https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
https://claude.ai/code/session_01Hr1rd432Aef98ibnZSSsYn
Generated by Claude Code