Repository navigation
generate-patch-files.sh: check inputs; fail on errors - #99
Merged
Merged
Conversation
- Fail if INV is unset ("cd $INV" went to $HOME) or if valgrind-old,
valgrind-new, or fjalar/valgrind is missing.
- Fail if valgrind-old or valgrind-new is not a pristine clone. Build
products there would end up in coregrind.patch and then be added to
Fjalar by "make git-update".
- Add set -e, treating diff's exit status 1 (files differ) as success
but 2 (trouble) as failure.
- Add a shebang.
…oc: build baseline in a copy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…doc: rerunnable regtest copy
…e CDPATH; report truncated status; doc: reset valgrind-old
…ine check, prune .git in find
mernst
added a commit
to mernst/fjalar
that referenced
this pull request
Oct 17, 2026
…regtest-ordering text codespecs#98 rewrites the "Remove files that have been removed upstream" section, so this pull request no longer changes it. The regtest baseline text no longer names make git-update, which codespecs#103 removes.
…odespecs#103 codespecs#101 documents building the regtest baseline in a copy, and codespecs#103 removes the find commands.
This was referenced Oct 17, 2026
Member
Author
|
@coderabbitai review |
|
mernst
added a commit
to mernst/fjalar
that referenced
this pull request
Oct 17, 2026
- Valgrind plan: build before the baselines, because check-regtest.sh needs a built tree; save the build log with pipefail. - Readelf plan: drop "make clean", which fails in a fresh clone before valgrind/Makefile exists; use pipefail so that a failed build stops. - 3-way merge: require that "git status --porcelain --ignored valgrind" prints nothing, because "git add -A -f" adds ignored files. - Valgrind plan: note that steps 3-6 and 10 still describe patch and make git-update until codespecs#99 and codespecs#103 land. - plan-pre-upgrade.md: codespecs#102 depends on nothing (land it before codespecs#96); item 6 is done. - Readelf plan: record ldd and nm -u output in the baseline, for the later comparison. - Use "land", not "merge", for pull requests. - Readelf plan: combine the two harvest_* bullets. - Valgrind plan: say to install gdb and glibc debuginfo before the regtest baseline commands, not after them. - Rewrap long lines.
mernst
added a commit
to mernst/fjalar
that referenced
this pull request
Oct 17, 2026
Also leave the .gitignore bullet and the baseline-in-a-copy wording to codespecs#101, and drop the note that steps 3-6 and 10 are out of date, because codespecs#99 and codespecs#103 update those steps.
Member
Author
|
@coderabbitai review |
|
…s files tar --ignore-failed-read also silently skipped unreadable files, which produced an incomplete Fjalar diff.
mernst
added a commit
to mernst/fjalar
that referenced
this pull request
Oct 18, 2026
…ts of pull requests; remove the 3-way-merge alternative The text that codespecs#98, codespecs#99, codespecs#101, codespecs#103, and codespecs#113 change in the plans is left as in codespecs#96, so that those pull requests' versions apply when they land. plan-pre-upgrade.md points to those pull requests rather than restating them. The "Alternative: a 3-way merge for Coregrind" section is removed, because codespecs#103's apply-patch-files.sh performs the same 3-way merge with git apply --3way.
Member
Author
|
@coderabbitai review |
✅ Action performedReview finished.
|
markro49
approved these changes
Oct 18, 2026
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.
(There is no need to review file
plan-upgrade-valgrind.mdin this PR.)generate-patch-files.shcreates the patch files for a Valgrind merge. It ran even when its inputs were wrong, and wrong output is easy to miss in a multi-megabyte patch:$INVunset,cd $INVwent to$HOME, and the script wrote patch files there from whatever it found.valgrind-oldorvalgrind-new(*.o,Makefile.in,configure,config.h, test binaries, ...) ended up incoregrind.patch, andmake git-updatewould thengit addit to Fjalar. That's easy to hit by building the upstream regtest baseline invalgrind-new.This PR is based on
masterand doesn't depend on any other open PR. #103 depends on it and contains its commits. #101 documents building the regtest baseline in a copy ofvalgrind-new(including removing an old copy first); this PR documents only the script's checks and resettingvalgrind-old.Changes
generate-patch-files.sh:$INVis unset, or if$INV/valgrind-old,$INV/valgrind-new, or$INV/fjalar/valgrinddoesn't exist.valgrind-oldorvalgrind-newis not the top level of a git clone, or has any change or file not in its git repository (git status --porcelain --ignoredis non-empty). The error lists the first 20 offending files and the number of others, and gives thegit reset --hard && git clean -fdxcommand that makes the tree pristine.check_version: if$VOLDVERor$VNEWVERis set, fail unlessvalgrind-oldorvalgrind-new, respectively, is at that tag. This catches forgetting to movevalgrind-newtovalgrind-old, or cloning the wrong tag.unset CDPATH, so thatcdwith a relative directory resolves it against the current directory.set -eandpipefail, with arun_diffhelper that treatsdiff's exit status 1 (files differ, the normal case) as success and 2 (trouble) as failure, and that creates its output file only ifdiffsucceeds.coregrind-Fjalar.diff,memcheck-Fjalar.diff) compare a temporary copy of the files infjalar/valgrindthat git does not ignore (git ls-files --cached --others --exclude-standard | tar), instead offjalar/valgrinditself with-xinst -xMakefile.in -xfjalar/html.fjalar/valgrindis usually built in place, and the exclusions missed most build products. The copy omits tracked files that have been deleted from the work tree; any other unreadable file stops the script, rather than producing an incomplete diff.#!/bin/bashshebang.Documentation:
doc/valgrind-merge.texinfo: when the previous merge'svalgrind-newbecomesvalgrind-old, reset it withgit reset --hardandgit clean -fdx, because the script requires a pristine clone.plan-upgrade-valgrind.md: steps 3 and 4 describe the script's checks instead of a manual check for build products; step 10 resetsvalgrind-old.Testing
In a scratch
$INVwithVALGRIND_3_23_0asvalgrind-old,VALGRIND_3_24_0asvalgrind-new, andfjalarlinking to this repository:INVunset, or set to a directory without the trees: error, exit 1.config.h/*.oin either tree, or a modified file: error listing the files, exit 1.run_diffon its own: exit status 0 and 1 continue; a missing file (status 2) stops the script.$INV: a tracked file deleted fromfjalar/valgrindis omitted from the Fjalar diffs, with exit 0; an unreadable file infjalar/valgrindstops the script (exit 2) and leaves no Fjalar diffs.shellcheckis clean.