Message ID | 20241227-b4-pks-meson-docs-v2-11-f61e63edbfa1@pks.im (mailing list archive) |
---|---|
State | Accepted |
Commit | d8af27d309c3637d05bd6b4957b3667c04dc861e |
Headers | show |
Series | meson: wire up missing HTML documentation | expand |
Hi, Patrick Steinhardt wrote: > The "check-meson" target uses process substitution to check whether > extracted contents from "meson.build" match expected contents. Process > substitution is unportable though and thus the target will fail when > using for example Dash. > > Fix this by writing data into a temporary directory. > > Signed-off-by: Patrick Steinhardt <ps@pks.im> > --- > t/.gitignore | 1 + > t/Makefile | 12 +++++++----- > 2 files changed, 8 insertions(+), 5 deletions(-) Without this, I get the error described in https://lore.kernel.org/git/CAHWeT-boK3x6mup11boEinNDQiAxxf0vwvZkxsGRc_GRvXYA8g@mail.gmail.com/ ('/bin/sh: 10: Syntax error: "(" unexpected'), and with this, the build in the Debian buildd environment succeeds. Tested-by: Jonathan Nieder <jrnieder@gmail.com> Thanks for fixing it. Sincerely, Jonathan
Jonathan Nieder <jrnieder@gmail.com> writes: > Without this, I get the error described in > https://lore.kernel.org/git/CAHWeT-boK3x6mup11boEinNDQiAxxf0vwvZkxsGRc_GRvXYA8g@mail.gmail.com/ > ('/bin/sh: 10: Syntax error: "(" unexpected'), and with this, the > build in the Debian buildd environment succeeds. > > Tested-by: Jonathan Nieder <jrnieder@gmail.com> > > Thanks for fixing it. Thanks.
Junio C Hamano <gitster@pobox.com> writes: > Jonathan Nieder <jrnieder@gmail.com> writes: > >> Without this, I get the error described in >> https://lore.kernel.org/git/CAHWeT-boK3x6mup11boEinNDQiAxxf0vwvZkxsGRc_GRvXYA8g@mail.gmail.com/ >> ('/bin/sh: 10: Syntax error: "(" unexpected'), and with this, the >> build in the Debian buildd environment succeeds. >> >> Tested-by: Jonathan Nieder <jrnieder@gmail.com> >> >> Thanks for fixing it. > > Thanks. Now the fix is in 'master'. Thanks, all.
diff --git a/t/.gitignore b/t/.gitignore index 91cf5772fe5643dbe075da98ed5166e1899b9a54..3e6b0f2cc57ffed0394d1cd2efc1e374f1c2169b 100644 --- a/t/.gitignore +++ b/t/.gitignore @@ -2,4 +2,5 @@ /test-results /.prove /chainlinttmp +/mesontmp /out/ diff --git a/t/Makefile b/t/Makefile index 290fb03ff011d39c31c5073c796aa6f4dc966283..daa5fcae86f3480079b8c9743dd28e3fd304c27b 100644 --- a/t/Makefile +++ b/t/Makefile @@ -103,6 +103,7 @@ clean-except-prove-cache: clean-chainlint clean: clean-except-prove-cache $(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)' + $(RM) -r mesontmp $(RM) .prove clean-chainlint: @@ -116,16 +117,17 @@ check-chainlint: check-meson: @# awk acts up when trying to match single quotes, so we use \047 instead. - @printf "%s\n" \ + @mkdir -p mesontmp && \ + printf "%s\n" \ "integration_tests t[0-9][0-9][0-9][0-9]-*.sh" \ "unit_test_programs unit-tests/t-*.c" \ "clar_test_suites unit-tests/u-*.c" | \ while read -r variable pattern; do \ - meson_tests=$$(awk "/^$$variable = \[\$$/ {flag=1 ; next } /^]$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047,\$$/, \"\"); print }" meson.build) && \ - actual_tests=$$(ls $$pattern) && \ - if test "$$meson_tests" != "$$actual_tests"; then \ + awk "/^$$variable = \[\$$/ {flag=1 ; next } /^]$$/ { flag=0 } flag { gsub(/^ \047/, \"\"); gsub(/\047,\$$/, \"\"); print }" meson.build >mesontmp/meson.txt && \ + ls $$pattern >mesontmp/actual.txt && \ + if ! cmp mesontmp/meson.txt mesontmp/actual.txt; then \ echo "Meson tests differ from actual tests:"; \ - diff -u <(echo "$$meson_tests") <(echo "$$actual_tests"); \ + diff -u mesontmp/meson.txt mesontmp/actual.txt; \ exit 1; \ fi; \ done
The "check-meson" target uses process substitution to check whether extracted contents from "meson.build" match expected contents. Process substitution is unportable though and thus the target will fail when using for example Dash. Fix this by writing data into a temporary directory. Signed-off-by: Patrick Steinhardt <ps@pks.im> --- t/.gitignore | 1 + t/Makefile | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-)