Fixes bitcoin/bitcoin#24261.
A demo CI build with an added assert(false): https://cirrus-ci.com/build/6165030604374016
Fixes bitcoin/bitcoin#24261.
A demo CI build with an added assert(false): https://cirrus-ci.com/build/6165030604374016
12 | @@ -13,7 +13,13 @@ for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/minisketch/test{, 13 | echo "Wrap $b ..." 14 | mv "$b" "${b}_orig" 15 | echo '#!/usr/bin/env bash' > "$b" 16 | - echo "( wine \"${b}_orig\" \"\$@\" ) || ( sleep 1 && wine \"${b}_orig\" \"\$@\" )" >> "$b" 17 | + if test "$(basename "$b")" = "test_bitcoin.exe"; then
any need for this condition?
Yes. Without it python tests in test/util got crazy. Did not investigate further though.
In commit "ci: Catch assertion error message into logs for test_bitcoin.exe" (c72462eecdecf606f5bc5f7f90b7f732f404607b)
One problem with using script here is that it combines stdout and stderr into the same stream. This works for how we call test_bitcoin, but not surprising it would be broken for other binaries.
Probably it would be more ideal to fix this by using script in src/Makefile.test.include instead of the less reliable > $<.log 2>&1 || (cat $<.log && false) which could cause buffered output to be lost on other platforms, not just windows. If script were used there, the changes here could be reverted.
Probably it would be more ideal to fix this by using script in
src/Makefile.test.includeinstead of the less reliable> $<.log 2>&1 || (cat $<.log && false)which could cause buffered output to be lost on other platforms, not just windows. If script were used there, the changes here could be reverted.
Great idea, but BSD version of script on macOS is incompatible with Linux version, e.g., it lacks the --return option.
Great idea, but BSD version of script on macOS is incompatible with Linux version, e.g., it lacks the --return option.
Candidate for python port? :sweat_smile:
12 | @@ -13,7 +13,13 @@ for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/minisketch/test{, 13 | echo "Wrap $b ..." 14 | mv "$b" "${b}_orig" 15 | echo '#!/usr/bin/env bash' > "$b" 16 | - echo "( wine \"${b}_orig\" \"\$@\" ) || ( sleep 1 && wine \"${b}_orig\" \"\$@\" )" >> "$b" 17 | + if test "$(basename "$b")" = "test_bitcoin.exe"; then 18 | + # Using `script` allows to catch assertion error messages into logs. 19 | + echo "COMMAND=\"wine ${b}_orig \$@\"" >> "$b"
In commit "ci: Catch assertion error message into logs for test_bitcoin.exe" (c72462eecdecf606f5bc5f7f90b7f732f404607b)
If arguments contain whitespace or shell characters they won't be escaped here correctly. It's probably not important to fix this, but you could probably do with with
echo "COMMAND=\"wine ${b}_orig\$(printf \" %q\" \"\$@\")\"" >> "$b"
But still better would be to follow earlier comment and revert this
Code review ACK c72462eecdecf606f5bc5f7f90b7f732f404607b. This fix isn't the most ideal (see suggested alternative below) but it fixes a real problem and is definitely an improvement
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | ryanofsky |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
No conflicts as of last run.
What's the status of this? I can't see a reason to not use the better fixes as outlined in the comments.