Message ID | cover.1729254070.git.ps@pks.im (mailing list archive) |
---|---|
Headers | show |
Series | Modernize the build system | expand |
On 18/10/2024 13:23, Patrick Steinhardt wrote: > Hi, > > this is the third version of my patch series that aims to modernize our > build system infrastructure. It refactors our existing build infra to be > ready for out-of-tree builds and then wires up Meson. > > Changes compared to v2: > > - I have split out semi-related changes like the platform > compatibility fixes into separate series. More on that further down > below, where I explain the current base. > > - I have polished the CMake-related changes I've been doing as prereqs > while refactoring our build system. Some of the changes weren't > tested before, but now CMake works as expected. Just curious, does the cmake build system work on Linux now? (cmake is another system that I don't really know, except in a 'monkey-see monkey-do' kinda way) > > - Fixed up some dependencies in our Makefile, as I didn't amend them > to depend on the new generator scripts. > > - I have extracted some more scripts to massage our Perl library code, > shells cripts and gitweb.cgi such that they can be used by Make, > CMake and Meson. This also fixes generation of "gitweb.cgi" on > Meson as reported by Ramsay. I haven't had time to test this yet (I haven't even properly read the patches), but from a quick squint, this looks similar to my attempts to do the same thing the other night (minus the cmake stuff, of course). However, I didn't notice anything in the commit message about changing the format of the GITWEB-BUILD-OPTIONS file, which already exists before that commit. I did the same, btw, but it seems that file was only used to 'notice' when the configuration changed to enable the re-build of gitweb.cgi. In which case, the change in format (rather than content) was not an issue. > > - I have fixed the cyclic dependency in our Makefile that I have > introduced with v2. > > - I have addressed some feedback regarding "build-systems.txt". > > - I have made things work with OpenBSD 7.6. > > - Things now work on Cygwin and MinGW64 as expected, no more test > failures except for t9700, which also fails with our Makefile. This caused me some concern for a little while, since I don't recall that the t9700 test has ever failed for me on cygwin. I have the test output files for all versions of git (each rc and rel) from v2.12.0-rc0 (5th Feb 2017) to today (all 143 of them) and none of them show that test failing. (I remove files from that directory on occasion when it takes up too much disk space). However, you qualify that statement in the commit message to make clear that it works on cygwin, but fails on other windows 'targets'. phew! :) > - I have improved how we set up the required tooling on Windows such > that we detect Git for Windows-provided tools as we do with CMake. > Like this, VS Code can now trivially import the Meson project and > configure it. Furthermore, generation of the Visual Studio solution > is trivial as well. So overall, things work fine now on all the > important Windows environments that I'm aware of. > > - Several smaller fixes all over the place. > > I've included a range-diff, but it's quite crowded overall. > > In general I think that this is in a pretty good shape now. I have > tested things on NixOS, macOS 10.15, OpenBSD 7.6, FreeBSD 14.1, Windows > 10 with MSVC, VS Code, MinGW and Cygwin, and things are generally smooth > and just work. I'm sure there's still going to be weirdnesses on some > platforms regardless of that. I had a very quick attempt on cygwin the other night, and it behaved differently at the 'ninja test' stage. It printed something like '[0/1] all tests' and then seemed to do nothing, except 'python3.9' was hovering up all cycles (well over 75% anyway) with no indication of any progress. This was nothing like the behaviour on Linux (which also looked a bit strange, but at least showed progress on each test as it ran). I ^C-ed it, since I didn't want to wait 6 hours before it (hopefully) finished running. Thanks! ATB, Ramsay Jones
On Fri, Oct 18, 2024 at 02:23:47PM +0200, Patrick Steinhardt wrote: > This series is based on 15030f9556 (The second batch, 2024-10-15) and > has the following dependencies: > > - ps/cmake-clar at c6d3e52c91 (cmake: set up proper > dependencies for generated clar headers, 2024-10-15). > > - ps/upgrade-clar at f3501edb0e (Makefile: adjust sed command for > generating "clar-decls.h", 2024-10-14). > > - ps/platform-compat-fixes at 80ebd91b83 (http: fix build error on > FreeBSD, 2024-10-16). > > These deps are mostly just there to make tests pass on all platforms, > but I wouldn't want folks to go test things and discover breakage that > is not caused by Meson itself :) You can also find this version of the > patch series at [1], branch "pks-meson-v3". @Taylor, I'm fine with > keeping this out of "seen" if you prefer to wait for those dependencies > to land first. Of the three, only the last one is marked as "Will merge to 'next'?" in the next integration round[^1]. All three are in 'seen', so this should apply cleanly on top of those. What is the state of those first two topics? Are they ready to go, or are we expecting a new round for any of them? Thanks, Taylor [^1]: I think I will do another full integration cycle on Tuesday of next week, but I am not entirely sure yet.
On 10/18/24 12:08 PM, Ramsay Jones wrote: > I had a very quick attempt on cygwin the other night, and it behaved > differently at the 'ninja test' stage. It printed something like > '[0/1] all tests' and then seemed to do nothing, except 'python3.9' > was hovering up all cycles (well over 75% anyway) with no indication > of any progress. This was nothing like the behaviour on Linux (which > also looked a bit strange, but at least showed progress on each test > as it ran). > > I ^C-ed it, since I didn't want to wait 6 hours before it (hopefully) > finished running. Running "ninja test" can be thought of as a convenience target to make all commands available via the Makefile equivalent. What it actually does, though, is first depend on "all" + any explicit test dependencies, and then dispatch to the separate "meson test" tool with some tastefully chosen arguments such as "--no-rebuild" (to prevent rerunning ninja) as well as --print-errorlogs. Running "meson test" directly is still possible, and maybe required if you want to do things such as --interactive, or running a specific testcase rather than all of them, or --maxfail, or well, all kinds of fiddly and specific fine-tuning. :) But in particular, I am wondering if maybe your cygwin issue is somehow due to ninja deciding that it really really wanted to buffer all output and wait until it completes before showing anything. It's not supposed to do that, since we wire it up to the "console" pool: https://ninja-build.org/manual.html#_the_literal_console_literal_pool The other possibility is that the python installation has decided to buffer itself: https://docs.python.org/3/using/cmdline.html#cmdoption-u possibly because due to ninja's juggling of pseudo ttys, the python runtime for "meson test" thinks it is *not* running in a tty. I know that ninja messes around with this in counterintuitive ways in general, but I am not sure exactly how that interacts with the console pool. But regardless of the reason -- if it is happening at the python level, then exporting PYTHONUNBUFFERED=1 may help. It's something I've had to do before for programs other than meson, at least.
On Fri, Oct 18, 2024 at 02:23:47PM +0200, Patrick Steinhardt wrote: > This series is based on 15030f9556 (The second batch, 2024-10-15) and > has the following dependencies: > > - ps/cmake-clar at c6d3e52c91 (cmake: set up proper > dependencies for generated clar headers, 2024-10-15). > > - ps/upgrade-clar at f3501edb0e (Makefile: adjust sed command for > generating "clar-decls.h", 2024-10-14). > > - ps/platform-compat-fixes at 80ebd91b83 (http: fix build error on > FreeBSD, 2024-10-16). While this is still sitting on my review queue, I rebuilt this topic based on the above (extremely helpful) information, but it seems to produce some conflicts when I try to merge it in at the end of 'seen': --- 8< --- diff --cc Makefile index 2c1afd08cb,a93aeb3bc8..0000000000 --- a/Makefile +++ b/Makefile @@@ -3932,10 -3859,9 +3886,18 @@@ GIT-TEST-SUITES: FORC fi $(UNIT_TEST_DIR)/clar-decls.h: $(patsubst %,$(UNIT_TEST_DIR)/%.c,$(CLAR_TEST_SUITES)) GIT-TEST-SUITES ++<<<<<<< HEAD + $(QUIET_GEN)$(SHELL_PATH) $(UNIT_TEST_DIR)/generate-clar-decls.sh "$@" $(filter %.c,$^) ++||||||| merged common ancestors ++ $(QUIET_GEN)for suite in $(CLAR_TEST_SUITES); do \ ++ sed -ne "s/^\(void test_$${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)$$\)/extern \1;/p" $(UNIT_TEST_DIR)/$$suite.c; \ ++ done >$@ ++======= + $(QUIET_GEN)$(SHELL_PATH) $(UNIT_TEST_DIR)/generate-clar-decls.sh "$@" $(patsubst %,$(UNIT_TEST_DIR)/%.c,$(CLAR_TEST_SUITES)) ++>>>>>>> ps/build $(UNIT_TEST_DIR)/clar.suite: $(UNIT_TEST_DIR)/clar-decls.h $(QUIET_GEN)awk -f $(UNIT_TEST_DIR)/clar-generate.awk $< >$(UNIT_TEST_DIR)/clar.suite +$(UNIT_TEST_DIR)/clar/clar.o: $(UNIT_TEST_DIR)/clar.suite $(CLAR_TEST_OBJS): $(UNIT_TEST_DIR)/clar-decls.h $(CLAR_TEST_OBJS): EXTRA_CPPFLAGS = -I$(UNIT_TEST_DIR) $(CLAR_TEST_PROG): $(UNIT_TEST_DIR)/clar.suite $(CLAR_TEST_OBJS) $(GITLIBS) GIT-LDFLAGS diff --cc t/unit-tests/clar/clar.c index d54e455367,64879cf2bd..0000000000 --- a/t/unit-tests/clar/clar.c +++ b/t/unit-tests/clar/clar.c @@@ -812,9 -801,8 +812,17 @@@ void clar__assert_equal } } } ++<<<<<<< HEAD +#endif /* CLAR_HAVE_WCHAR */ else if (!strcmp("%"PRIuMAX, fmt) || !strcmp("%"PRIxMAX, fmt)) { uintmax_t sz1 = va_arg(args, uintmax_t), sz2 = va_arg(args, uintmax_t); ++||||||| merged common ancestors ++ else if (!strcmp("%"PRIuZ, fmt) || !strcmp("%"PRIxZ, fmt)) { ++ size_t sz1 = va_arg(args, size_t), sz2 = va_arg(args, size_t); ++======= ++ else if (!strcmp("%"PRIuMAX, fmt) || !strcmp("%"PRIxMAX, fmt)) { ++ uintmax_t sz1 = va_arg(args, uintmax_t), sz2 = va_arg(args, uintmax_t); ++>>>>>>> ps/build is_equal = (sz1 == sz2); if (!is_equal) { int offset = p_snprintf(buf, sizeof(buf), fmt, sz1); diff --cc t/unit-tests/generate-clar-decls.sh index 688e0885f4,81da732917..0000000000 --- a/t/unit-tests/generate-clar-decls.sh +++ b/t/unit-tests/generate-clar-decls.sh @@@ -1,16 -1,16 +1,36 @@@ ++<<<<<<< HEAD +#!/bin/sh + +if test $# -lt 2 +then + echo "USAGE: $0 <OUTPUT> <SUITE>..." 2>&1 + exit 1 +fi + +OUTPUT="$1" +shift + +for suite in "$@" +do + sed -ne "s/^\(void test_$(basename "${suite%.c}")__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$/extern \1;/p" "$suite" || + exit 1 +done >"$OUTPUT" ++||||||| merged common ancestors ++======= + #!/bin/sh + + if test $# -lt 2 + then + echo "USAGE: $0 <OUTPUT> <SUITE>..." 2>&1 + exit 1 + fi + + OUTPUT="$1" + shift + + for suite in "$@" + do + sed -ne "s/^\(void test_$suite__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)$\)/extern \1;/p" "$suite" || + exit 1 + done >"$OUTPUT" ++>>>>>>> ps/build --- >8 --- Thanks, Taylor
On 20/10/2024 09:51, Eli Schwartz wrote: > On 10/18/24 12:08 PM, Ramsay Jones wrote: [snip] > possibly because due to ninja's juggling of pseudo ttys, the python > runtime for "meson test" thinks it is *not* running in a tty. I know > that ninja messes around with this in counterintuitive ways in general, > but I am not sure exactly how that interacts with the console pool. But > regardless of the reason -- if it is happening at the python level, then > exporting PYTHONUNBUFFERED=1 may help. It's something I've had to do > before for programs other than meson, at least. Unfortunately, the 'PYTHONUNBUFFERED=1' idea didn't work. In fact nothing I have tried on cygwin has worked. For example, if I use meson to run just few tests, like so on Linux: $ meson test --no-rebuild --print-errorlogs 't000*' 1/9 t0000-basic OK 7.52s 2/9 t0001-init OK 1.88s 3/9 t0002-gitfile OK 0.37s 4/9 t0003-attributes OK 1.35s 5/9 t0004-unwritable OK 0.23s 6/9 t0005-signals OK 0.16s 7/9 t0006-date OK 0.73s 8/9 t0007-git-var OK 0.40s 9/9 t0008-ignores OK 3.09s Ok: 9 Expected Fail: 0 Fail: 0 Unexpected Pass: 0 Skipped: 0 Timeout: 0 Full log written to /home/ramsay/git/build/meson-logs/testlog.txt $ On cygwin it looks like: $ meson test --no-rebuild --print-errorlogs 't000*' 1/9 t0002-gitfile OK 12.32s [2-4/9]
On Fri, Oct 18, 2024 at 05:08:41PM +0100, Ramsay Jones wrote: > On 18/10/2024 13:23, Patrick Steinhardt wrote: > > Hi, > > > > this is the third version of my patch series that aims to modernize our > > build system infrastructure. It refactors our existing build infra to be > > ready for out-of-tree builds and then wires up Meson. > > > > Changes compared to v2: > > > > - I have split out semi-related changes like the platform > > compatibility fixes into separate series. More on that further down > > below, where I explain the current base. > > > > - I have polished the CMake-related changes I've been doing as prereqs > > while refactoring our build system. Some of the changes weren't > > tested before, but now CMake works as expected. > > Just curious, does the cmake build system work on Linux now? > > (cmake is another system that I don't really know, except in a > 'monkey-see monkey-do' kinda way) To some extent. Some issues have been fixed and/or improved by this series, but we're not fully there for CMake: - It builds, but the build leaks outside of the build directory into the source tree. In theory we now have all parts together to fix that, as demonstrated by the Meson build support, but I didn't wire this up. - The tests do not run at all for me, might be I'm holding it wrong. But with the patch that allows us to override the GIT-BUILD-DIR we should be able to get out-of-tree tests running, as well. Again, I didn't wire this up. - Some things simply haven't been wired up at all, like building "gitweb.cgi". Any gitweb-tests would thus fail. But in any case, this patch series doesn't regress support for CMake anymore like previous versions did. > > - Fixed up some dependencies in our Makefile, as I didn't amend them > > to depend on the new generator scripts. > > > > - I have extracted some more scripts to massage our Perl library code, > > shells cripts and gitweb.cgi such that they can be used by Make, > > CMake and Meson. This also fixes generation of "gitweb.cgi" on > > Meson as reported by Ramsay. > > I haven't had time to test this yet (I haven't even properly read the > patches), but from a quick squint, this looks similar to my attempts > to do the same thing the other night (minus the cmake stuff, of course). > > However, I didn't notice anything in the commit message about changing > the format of the GITWEB-BUILD-OPTIONS file, which already exists before > that commit. I did the same, btw, but it seems that file was only used to > 'notice' when the configuration changed to enable the re-build of gitweb.cgi. > In which case, the change in format (rather than content) was not an issue. Yeah, it's been a bit weird before. It contained sed commands to execute, but also some other relevant build options. Made this whole thing a bit weird to use. In any case, it works the same way that GIT-BUILD-OPTIONS work now, which I think is a good thing. The plumbing around it is a bit verbose, but other than that I think it's straight-forward. > > > > - I have fixed the cyclic dependency in our Makefile that I have > > introduced with v2. > > > > - I have addressed some feedback regarding "build-systems.txt". > > > > - I have made things work with OpenBSD 7.6. > > > > - Things now work on Cygwin and MinGW64 as expected, no more test > > failures except for t9700, which also fails with our Makefile. > > This caused me some concern for a little while, since I don't recall > that the t9700 test has ever failed for me on cygwin. I have the test > output files for all versions of git (each rc and rel) from v2.12.0-rc0 > (5th Feb 2017) to today (all 143 of them) and none of them show that > test failing. (I remove files from that directory on occasion when it > takes up too much disk space). > > However, you qualify that statement in the commit message to make clear > that it works on cygwin, but fails on other windows 'targets'. phew! :) Oh, yeah, that one seems misleading indeed. > > - I have improved how we set up the required tooling on Windows such > > that we detect Git for Windows-provided tools as we do with CMake. > > Like this, VS Code can now trivially import the Meson project and > > configure it. Furthermore, generation of the Visual Studio solution > > is trivial as well. So overall, things work fine now on all the > > important Windows environments that I'm aware of. > > > > - Several smaller fixes all over the place. > > > > I've included a range-diff, but it's quite crowded overall. > > > > In general I think that this is in a pretty good shape now. I have > > tested things on NixOS, macOS 10.15, OpenBSD 7.6, FreeBSD 14.1, Windows > > 10 with MSVC, VS Code, MinGW and Cygwin, and things are generally smooth > > and just work. I'm sure there's still going to be weirdnesses on some > > platforms regardless of that. > > I had a very quick attempt on cygwin the other night, and it behaved > differently at the 'ninja test' stage. It printed something like > '[0/1] all tests' and then seemed to do nothing, except 'python3.9' > was hovering up all cycles (well over 75% anyway) with no indication > of any progress. This was nothing like the behaviour on Linux (which > also looked a bit strange, but at least showed progress on each test > as it ran). > > I ^C-ed it, since I didn't want to wait 6 hours before it (hopefully) > finished running. Interesting, that's something I didn't experience yet. I'll chime in further down in this thread. Patrick
On Fri, Oct 18, 2024 at 05:09:43PM -0400, Taylor Blau wrote: > On Fri, Oct 18, 2024 at 02:23:47PM +0200, Patrick Steinhardt wrote: > > This series is based on 15030f9556 (The second batch, 2024-10-15) and > > has the following dependencies: > > > > - ps/cmake-clar at c6d3e52c91 (cmake: set up proper > > dependencies for generated clar headers, 2024-10-15). > > > > - ps/upgrade-clar at f3501edb0e (Makefile: adjust sed command for > > generating "clar-decls.h", 2024-10-14). > > > > - ps/platform-compat-fixes at 80ebd91b83 (http: fix build error on > > FreeBSD, 2024-10-16). > > > > These deps are mostly just there to make tests pass on all platforms, > > but I wouldn't want folks to go test things and discover breakage that > > is not caused by Meson itself :) You can also find this version of the > > patch series at [1], branch "pks-meson-v3". @Taylor, I'm fine with > > keeping this out of "seen" if you prefer to wait for those dependencies > > to land first. > > Of the three, only the last one is marked as "Will merge to 'next'?" in > the next integration round[^1]. All three are in 'seen', so this should > apply cleanly on top of those. > > What is the state of those first two topics? Are they ready to go, or > are we expecting a new round for any of them? These have been merged into a single topic now and should be ready to go from my point of view. But they still require reviews. Patrick
On Mon, Oct 21, 2024 at 06:10:10PM -0400, Taylor Blau wrote: > On Fri, Oct 18, 2024 at 02:23:47PM +0200, Patrick Steinhardt wrote: > > This series is based on 15030f9556 (The second batch, 2024-10-15) and > > has the following dependencies: > > > > - ps/cmake-clar at c6d3e52c91 (cmake: set up proper > > dependencies for generated clar headers, 2024-10-15). > > > > - ps/upgrade-clar at f3501edb0e (Makefile: adjust sed command for > > generating "clar-decls.h", 2024-10-14). > > > > - ps/platform-compat-fixes at 80ebd91b83 (http: fix build error on > > FreeBSD, 2024-10-16). > > While this is still sitting on my review queue, I rebuilt this topic > based on the above (extremely helpful) information, but it seems to > produce some conflicts when I try to merge it in at the end of 'seen': Huh, interesting. The first two series had conflicts with each other, so I wouldn't be surprised if what you see comes from that. Those two topics have been merged into a single topic now. I'll send an updated version of this series at the end of this week that also aims to fix conflicts with 'seen'. Patrick
On Mon, Oct 21, 2024 at 11:56:42PM +0100, Ramsay Jones wrote: > On 20/10/2024 09:51, Eli Schwartz wrote: > > On 10/18/24 12:08 PM, Ramsay Jones wrote: > [snip] > > possibly because due to ninja's juggling of pseudo ttys, the python > > runtime for "meson test" thinks it is *not* running in a tty. I know > > that ninja messes around with this in counterintuitive ways in general, > > but I am not sure exactly how that interacts with the console pool. But > > regardless of the reason -- if it is happening at the python level, then > > exporting PYTHONUNBUFFERED=1 may help. It's something I've had to do > > before for programs other than meson, at least. > > Unfortunately, the 'PYTHONUNBUFFERED=1' idea didn't work. In fact nothing > I have tried on cygwin has worked. For example, if I use meson to run just > few tests, like so on Linux: > > $ meson test --no-rebuild --print-errorlogs 't000*' > 1/9 t0000-basic OK 7.52s > 2/9 t0001-init OK 1.88s > 3/9 t0002-gitfile OK 0.37s > 4/9 t0003-attributes OK 1.35s > 5/9 t0004-unwritable OK 0.23s > 6/9 t0005-signals OK 0.16s > 7/9 t0006-date OK 0.73s > 8/9 t0007-git-var OK 0.40s > 9/9 t0008-ignores OK 3.09s > > Ok: 9 > Expected Fail: 0 > Fail: 0 > Unexpected Pass: 0 > Skipped: 0 > Timeout: 0 > > Full log written to /home/ramsay/git/build/meson-logs/testlog.txt > $ > > On cygwin it looks like: > > $ meson test --no-rebuild --print-errorlogs 't000*' > 1/9 t0002-gitfile OK 12.32s > [2-4/9]
On 23/10/2024 13:04, Patrick Steinhardt wrote: > On Mon, Oct 21, 2024 at 11:56:42PM +0100, Ramsay Jones wrote: >> On 20/10/2024 09:51, Eli Schwartz wrote: >>> On 10/18/24 12:08 PM, Ramsay Jones wrote: >> [snip] >> Patrick, how do you run the tests on cygwin? > > I didn't have to do anything special here, so this is quite puzzling. In > a fully-updated Cygwin installation: > > $ which meson > /usr/bin/meson > $ meson --version > 1.3.2 > $ python --version > 3.9.16 > $ mkdir build > $ meson setup .. > ... autoconfiguration logs ... > $ meson test 't000*' Hmm, I could have sworn that this caused a complete rebuild for me (even when having just built), hence the '--no-rebuild --print-errorlogs' parameters to meson test. (Oh, maybe that was just 'meson test' - so how do you run *all* tests with meson - rather than 'ninja test'). > ninja: Entering directory `/home/Patrick Steinhardt/git/build' > [582/582] Linking target git-receive-pack.exe > 1/9 t0005-signals OK 4.17s > 2/9 t0004-unwritable OK 4.58s > 3/9 t0002-gitfile OK 6.95s > 4/9 t0007-git-var OK 8.15s > 5/9 t0006-date OK 15.42s > 6/9 t0003-attributes OK 26.84s > 7/9 t0001-init OK 29.09s > 8/9 t0008-ignores OK 57.17s > 9/9 t0000-basic OK 83.82s > > Ok: 9 > Expected Fail: 0 > Fail: 0 > Unexpected Pass: 0 > Skipped: 0 > Timeout: 0 > > Full log written to /home/Patrick Steinhardt/git/build/meson-logs/testlog.txt > > This is starting with a fresh repo, I executed `git clean -dfx` > beforehand. Hmm, I have far to many 'precious' files to use 'git clean'! (perhaps I should clone the repo to get a totally clean slate). > > Do any of the versions used maybe differ? Ah, yes, I should have noted the versions: $ uname -a CYGWIN_NT-10.0-19045 satellite 3.5.4-1.x86_64 2024-08-25 16:52 UTC x86_64 Cygwin $ $ which meson ninja python /usr/bin/meson /usr/bin/ninja /usr/bin/python $ $ meson --version 1.3.2 $ $ ninja --version 1.12.0 $ $ python --version Python 3.9.18 $ So, a slightly newer python - what versions of ninja and the cygwin '.dll' are you using? (the latter is more likely to cause an issue). BTW, I have been doing: $ meson setup .. -Dprefix=$HOME so that it matches the default prefix from the Makefile (not that I have attempted to actually install yet!;) ). Can the default be set in the meson.build file (with command-line override, of course)? ATB, Ramsay Jones
On 10/23/24 10:38 AM, Ramsay Jones wrote: > Hmm, I could have sworn that this caused a complete rebuild for me > (even when having just built), hence the '--no-rebuild --print-errorlogs' > parameters to meson test. (Oh, maybe that was just 'meson test' - so > how do you run *all* tests with meson - rather than 'ninja test'). "meson test" without --no-rebuild will first run "ninja" to verify that everything has been built, and build it if it hasn't been. When passing specific test names, it will filter for dependencies of that specific testcase, and only ensure *those* are up to date. Assuming those dependencies are accurate, of course. :D What do you mean by "complete rebuild"? Do you mean all binaries that were already built and up to date get marked stale and recreated? > BTW, I have been doing: > > $ meson setup .. -Dprefix=$HOME > > so that it matches the default prefix from the Makefile (not that I > have attempted to actually install yet!;) ). Can the default be set > in the meson.build file (with command-line override, of course)? project('git', 'c', meson_version: '>=1.3.0', # MSVC does not support GNU99, and C99 does not define __STDC_VERSION__ # on MSVC. So we instead fall back to C11 there. default_options: ['c_std=gnu99,c11'], You can pass any command-line options in as default_options, including prefix. Defaulting to $HOME is somewhat unconventional regardless of whether it's done in a Makefile or a configure.ac or a meson.build or a CMakeLists.txt, but given the Makefile does indeed do that I suppose it's not incredibly bizarre to do it in meson.build as well. :)
On Wed, Oct 23, 2024 at 02:04:21PM +0200, Patrick Steinhardt wrote: > On Mon, Oct 21, 2024 at 06:10:10PM -0400, Taylor Blau wrote: > > On Fri, Oct 18, 2024 at 02:23:47PM +0200, Patrick Steinhardt wrote: > > > This series is based on 15030f9556 (The second batch, 2024-10-15) and > > > has the following dependencies: > > > > > > - ps/cmake-clar at c6d3e52c91 (cmake: set up proper > > > dependencies for generated clar headers, 2024-10-15). > > > > > > - ps/upgrade-clar at f3501edb0e (Makefile: adjust sed command for > > > generating "clar-decls.h", 2024-10-14). > > > > > > - ps/platform-compat-fixes at 80ebd91b83 (http: fix build error on > > > FreeBSD, 2024-10-16). > > > > While this is still sitting on my review queue, I rebuilt this topic > > based on the above (extremely helpful) information, but it seems to > > produce some conflicts when I try to merge it in at the end of 'seen': > > Huh, interesting. The first two series had conflicts with each other, so > I wouldn't be surprised if what you see comes from that. Those two > topics have been merged into a single topic now. > > I'll send an updated version of this series at the end of this week that > also aims to fix conflicts with 'seen'. Great, thanks! Thanks, Taylor
On Wed, Oct 23, 2024 at 02:04:17PM +0200, Patrick Steinhardt wrote: > On Fri, Oct 18, 2024 at 05:09:43PM -0400, Taylor Blau wrote: > > On Fri, Oct 18, 2024 at 02:23:47PM +0200, Patrick Steinhardt wrote: > > > This series is based on 15030f9556 (The second batch, 2024-10-15) and > > > has the following dependencies: > > > > > > - ps/cmake-clar at c6d3e52c91 (cmake: set up proper > > > dependencies for generated clar headers, 2024-10-15). > > > > > > - ps/upgrade-clar at f3501edb0e (Makefile: adjust sed command for > > > generating "clar-decls.h", 2024-10-14). > > > > > > - ps/platform-compat-fixes at 80ebd91b83 (http: fix build error on > > > FreeBSD, 2024-10-16). > > > > > > These deps are mostly just there to make tests pass on all platforms, > > > but I wouldn't want folks to go test things and discover breakage that > > > is not caused by Meson itself :) You can also find this version of the > > > patch series at [1], branch "pks-meson-v3". @Taylor, I'm fine with > > > keeping this out of "seen" if you prefer to wait for those dependencies > > > to land first. > > > > Of the three, only the last one is marked as "Will merge to 'next'?" in > > the next integration round[^1]. All three are in 'seen', so this should > > apply cleanly on top of those. > > > > What is the state of those first two topics? Are they ready to go, or > > are we expecting a new round for any of them? > > These have been merged into a single topic now and should be ready to go > from my point of view. But they still require reviews. OK, so: ps/platform-compat-fixes is in 'next', and ps/cmake-clar has been folded into ps/upgrade-clar. Have all three have been combined into ps/build? If so, should this topic be rebuilt on ps/upgrade-clar so that we don't see the same patches twice, perhaps? Or am I still missing something here? Thanks, Taylor
On 23/10/2024 16:58, Eli Schwartz wrote: > On 10/23/24 10:38 AM, Ramsay Jones wrote: >> Hmm, I could have sworn that this caused a complete rebuild for me >> (even when having just built), hence the '--no-rebuild --print-errorlogs' >> parameters to meson test. (Oh, maybe that was just 'meson test' - so >> how do you run *all* tests with meson - rather than 'ninja test'). > > > "meson test" without --no-rebuild will first run "ninja" to verify that > everything has been built, and build it if it hasn't been. When passing > specific test names, it will filter for dependencies of that specific > testcase, and only ensure *those* are up to date. Assuming those > dependencies are accurate, of course. :D Heh, yes, I just tried it tonight, and it did just as you describe: $ meson test ninja: Entering directory `/home/ramsay/new-git/build' ninja: no work to do. $ > What do you mean by "complete rebuild"? Do you mean all binaries that > were already built and up to date get marked stale and recreated? My bad, I was a little loose in my language. Whatever it was that I typed (and I obviously can't remember what it was!), resulted in meson going through the configuration step again followed by compilation/linking of all binaries (or at least, that's what it looked like). >> BTW, I have been doing: >> >> $ meson setup .. -Dprefix=$HOME >> >> so that it matches the default prefix from the Makefile (not that I >> have attempted to actually install yet!;) ). Can the default be set >> in the meson.build file (with command-line override, of course)? > > > project('git', 'c', > meson_version: '>=1.3.0', > # MSVC does not support GNU99, and C99 does not define __STDC_VERSION__ > # on MSVC. So we instead fall back to C11 there. > default_options: ['c_std=gnu99,c11'], Ah yes, this seems to work: $ git diff diff --git a/meson.build b/meson.build index 7c7a59d7fb..23b6f0baa2 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project('git', 'c', meson_version: '>=1.3.0', # MSVC does not support GNU99, and C99 does not define __STDC_VERSION__ # on MSVC. So we instead fall back to C11 there. - default_options: ['c_std=gnu99,c11'], + default_options: ['c_std=gnu99,c11', 'prefix=$HOME'], version: 'v2.47.GIT', ) $ $ meson setup .. --reconfigure ... User defined options prefix: /home/ramsay Found ninja-1.12.0 at /usr/bin/ninja Cleaning... 0 files. $ Using the command-line to override also works: $ meson setup .. --reconfigure -Dprefix=/usr/local ... User defined options prefix: /usr/local Found ninja-1.12.0 at /usr/bin/ninja Cleaning... 0 files. $ > You can pass any command-line options in as default_options, including > prefix. Defaulting to $HOME is somewhat unconventional regardless of > whether it's done in a Makefile or a configure.ac or a meson.build or a > CMakeLists.txt, but given the Makefile does indeed do that I suppose > it's not incredibly bizarre to do it in meson.build as well. :) I don't have any strong feelings either way, it's just that people are used to doing a 'make install' and having the git build installed in their home directory (including me). But it is not a huge effort to add the '-Dprefix=$HOME', it simply needs to be documented. I think I need to go away and RTFM at this point and not annoy you (and others) with such noob questions! :) [For me ATM, meson works fine on Linux, but it simply doesn't work at all on cygwin as far as the tests are concerned (and I haven't tried installing yet). Patrick is not seeing any problems, so I would like to understand why we have such different results.] Thanks! ATB, Ramsay Jones
On Thu, Oct 24, 2024 at 02:43:40AM +0100, Ramsay Jones wrote: > > You can pass any command-line options in as default_options, including > > prefix. Defaulting to $HOME is somewhat unconventional regardless of > > whether it's done in a Makefile or a configure.ac or a meson.build or a > > CMakeLists.txt, but given the Makefile does indeed do that I suppose > > it's not incredibly bizarre to do it in meson.build as well. :) > > I don't have any strong feelings either way, it's just that people are > used to doing a 'make install' and having the git build installed in > their home directory (including me). But it is not a huge effort to > add the '-Dprefix=$HOME', it simply needs to be documented. For now I'll leave it as-is, but if people feel strongly about it I don't mind changing the default value. > I think I need to go away and RTFM at this point and not annoy you (and > others) with such noob questions! :) I find your input to be highly valuable, so thanks for testing things! Patrick
On Wed, Oct 23, 2024 at 03:38:18PM +0100, Ramsay Jones wrote: > > Do any of the versions used maybe differ? > > Ah, yes, I should have noted the versions: > > $ uname -a > CYGWIN_NT-10.0-19045 satellite 3.5.4-1.x86_64 2024-08-25 16:52 UTC x86_64 Cygwin I'm on basically the same system: CYGWIN_NT-10.0-19045 DESKTOP-OLQRBOP 3.5.4-1.x86_64 2024-08-25 16:52 UTC x86_64 Cygwin Which makes this even weirder. > $ > > $ which meson ninja python > /usr/bin/meson > /usr/bin/ninja > /usr/bin/python > $ > > $ meson --version > 1.3.2 > $ > > $ ninja --version > 1.12.0 > $ > > $ python --version > Python 3.9.18 > $ Let me try to update Cygwin to the latest versions... huh. Why is your Python version newer than mine? I cannot seem to find this version of Python in any of the mirrors. Oh, wait! I can see that there's a "python3" 3.9.18 available as a testing version. I don't quite understand how this works though, because when I install it I still have Python 3.9.16. Seems like there are two Python packages: "python3", which has the 3.9.18 test version, and then there's "python39", which only has 3.9.16. The first one just seems to be a meta package, so it doesn't contain anything. So... where did you get Python 3.9.18 from? You mentioned that it also hogs all CPU, so could it be that this is basically a broken Python installation? Patrick
On Wed, Oct 23, 2024 at 04:15:12PM -0400, Taylor Blau wrote: > On Wed, Oct 23, 2024 at 02:04:17PM +0200, Patrick Steinhardt wrote: > > On Fri, Oct 18, 2024 at 05:09:43PM -0400, Taylor Blau wrote: > > > On Fri, Oct 18, 2024 at 02:23:47PM +0200, Patrick Steinhardt wrote: > > > > This series is based on 15030f9556 (The second batch, 2024-10-15) and > > > > has the following dependencies: > > > > > > > > - ps/cmake-clar at c6d3e52c91 (cmake: set up proper > > > > dependencies for generated clar headers, 2024-10-15). > > > > > > > > - ps/upgrade-clar at f3501edb0e (Makefile: adjust sed command for > > > > generating "clar-decls.h", 2024-10-14). > > > > > > > > - ps/platform-compat-fixes at 80ebd91b83 (http: fix build error on > > > > FreeBSD, 2024-10-16). > > > > > > > > These deps are mostly just there to make tests pass on all platforms, > > > > but I wouldn't want folks to go test things and discover breakage that > > > > is not caused by Meson itself :) You can also find this version of the > > > > patch series at [1], branch "pks-meson-v3". @Taylor, I'm fine with > > > > keeping this out of "seen" if you prefer to wait for those dependencies > > > > to land first. > > > > > > Of the three, only the last one is marked as "Will merge to 'next'?" in > > > the next integration round[^1]. All three are in 'seen', so this should > > > apply cleanly on top of those. > > > > > > What is the state of those first two topics? Are they ready to go, or > > > are we expecting a new round for any of them? > > > > These have been merged into a single topic now and should be ready to go > > from my point of view. But they still require reviews. > > OK, so: ps/platform-compat-fixes is in 'next', and ps/cmake-clar has > been folded into ps/upgrade-clar. Have all three have been combined into > ps/build? > > If so, should this topic be rebuilt on ps/upgrade-clar so that we don't > see the same patches twice, perhaps? Or am I still missing something > here? No, you don't miss anything here, rebuilding this on top of ps/upgrade-clar plus ps/platform-compat-fixes is exactly the right thing to do. Patrick
On 24/10/2024 08:19, Patrick Steinhardt wrote: > On Wed, Oct 23, 2024 at 03:38:18PM +0100, Ramsay Jones wrote: >>> Do any of the versions used maybe differ? [snip] > Oh, wait! I can see that there's a "python3" 3.9.18 available as a > testing version. I don't quite understand how this works though, because > when I install it I still have Python 3.9.16. Seems like there are two > Python packages: "python3", which has the 3.9.18 test version, and then > there's "python39", which only has 3.9.16. The first one just seems to > be a meta package, so it doesn't contain anything. > > So... where did you get Python 3.9.18 from? You mentioned that it also > hogs all CPU, so could it be that this is basically a broken Python > installation? Hmm I have no idea how my python installation got messed up (I never try to install TEST packages, but I do just install anything that is in the 'pending' page without even thinking!). Last night I remembered that when installing something recently on windows it also (without even asking) installed a windows python as well, but that is hidden due to my path ... $ /cygdrive/c/Users/ramsay/AppData/Local/Programs/Python/Python312/python --version Python 3.12.4 $ My current python packages (which include many obsolete python2 packages) looks like: $ cygcheck -c python Cygwin Package Information Package Version Status python 3.0.0-1 OK $ cygcheck -c python3 Cygwin Package Information Package Version Status python3 3.9.18-1 OK $ which python python3 /usr/bin/python /usr/bin/python3 $ python --version Python 3.9.18 $ python3 --version Python 3.9.18 $ Go away and wrangle with setup.exe ... $ python --version Python 3.9.16 $ python3 --version Python 3.9.16 $ which python python3 /usr/bin/python /usr/bin/python3 $ cd git $ mkdir build $ cd build $ meson setup .. -Dprefix=$HOME ... git v2.47.GIT User defined options prefix: /home/ramsay Found ninja-1.12.0 at /usr/bin/ninja $ ninja [699/699] Linking target t/helper/test-tool.exe $ meson test 't000*' ninja: Entering directory `/home/ramsay/git/build' ninja: no work to do. 1/9 t0002-gitfile OK 10.52s 2/9 t0004-unwritable OK 6.78s 3/9 t0005-signals OK 5.96s 4/9 t0003-attributes OK 54.40s 5/9 t0006-date OK 31.39s 6/9 t0001-init OK 61.68s 7/9 t0007-git-var OK 12.93s 8/9 t0008-ignores FAIL 106.29s exit status 1 >>> PATH='/home/ramsay/git:/usr/bin:/usr/bin:/usr/bin:/usr/bin:/home/ramsay/bin:/usr/bin:/usr/bin:/home/ramsay/bin:/home/ramsay/bin:/usr/local/bin:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Users/ramsay/AppData/Local/Programs/Python/Python312/Scripts:/cygdrive/c/Users/ramsay/AppData/Local/Programs/Python/Python312:/cygdrive/c/Users/ramsay/AppData/Local/Programs/Python/Launcher:/cygdrive/c/Users/ramsay/AppData/Local/Microsoft/WindowsApps:/usr/lib/lapack' MALLOC_PERTURB_=105 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 GIT_BUILD_DIR=/home/ramsay/git/build /usr/bin/sh t0008-ignores.sh 9/9 t0000-basic OK 193.52s Ok: 8 Expected Fail: 0 Fail: 1 Unexpected Pass: 0 Skipped: 0 Timeout: 0 Full log written to /home/ramsay/git/build/meson-logs/testlog.txt $ So, a big improvement! :) Having a quick squint at the failure, it '# failed 1 among 397 test(s)' which was 'not ok 391 - correct handling of backslashes', which is the only test marked with a '!CYGWIN' prerequisite! ;) So it seems that I am doing something wrong, which results in the prerequisite not being set. I haven't debugged that yet, but I wanted to note the above improvement having 'fixed' my python installation. (It doesn't look good for the TEST package! :) ). Thanks! ATB, Ramsay Jones `
On Thu, Oct 24, 2024 at 06:34:24PM +0100, Ramsay Jones wrote: > On 24/10/2024 08:19, Patrick Steinhardt wrote: > Having a quick squint at the failure, it '# failed 1 among 397 test(s)' > which was 'not ok 391 - correct handling of backslashes', which is the > only test marked with a '!CYGWIN' prerequisite! ;) So it seems that I > am doing something wrong, which results in the prerequisite not being > set. The CYGWIN prerequisite is set depending on whether or not `uname -s` contains "*CYGWIN*". Does your system maybe pick up the wrong uname(1) binary somehow? > I haven't debugged that yet, but I wanted to note the above improvement > having 'fixed' my python installation. (It doesn't look good for the > TEST package! :) ). Great, happy to hear that this is resolved now. Patrick
On 25/10/2024 06:20, Patrick Steinhardt wrote: > On Thu, Oct 24, 2024 at 06:34:24PM +0100, Ramsay Jones wrote: >> On 24/10/2024 08:19, Patrick Steinhardt wrote: >> Having a quick squint at the failure, it '# failed 1 among 397 test(s)' >> which was 'not ok 391 - correct handling of backslashes', which is the >> only test marked with a '!CYGWIN' prerequisite! ;) So it seems that I >> am doing something wrong, which results in the prerequisite not being >> set. > > The CYGWIN prerequisite is set depending on whether or not `uname -s` > contains "*CYGWIN*". Does your system maybe pick up the wrong uname(1) > binary somehow? Yep, I suspected that I knew what the problem was, I just had not looked to see if my hunch was correct yet! :) And indeed: $ pwd /home/ramsay/git $ ls -l uname* -rw-r--r-- 1 ramsay None 11K Jun 28 2019 uname.c -rwxr-xr-x 1 ramsay None 167K Jun 28 2019 uname.exe* $ ./uname -s Windows $ ./uname -a Windows satellite 10.0 19045() AMD-64 Windows 10 Home $ uname -a CYGWIN_NT-10.0-19045 satellite 3.5.4-1.x86_64 2024-08-25 16:52 UTC x86_64 Cygwin $ As you can see, many many moons ago (28 Jun 2019 was just the last time it was updated/built - I suspect it was first written in 2006), I had written my own version of uname. If memory serves, it was actually for the 'msys' version, not cygwin! ;) Anyway, when the test executes my PATH starts: /home/ramsay/git/build/bin-wrappers:/home/ramsay/git:/usr/bin ... It is not immediately obvious why '/home/ramsay/git' is in there, but if I move my uname out of the way: $ mv uname* ../src $ ls -l uname* ls: cannot access 'uname*': No such file or directory $ then everything works: $ cd build $ meson test 't000*' ninja: Entering directory `/home/ramsay/git/build' ninja: no work to do. 1/9 t0002-gitfile OK 10.28s 2/9 t0004-unwritable OK 6.70s 3/9 t0005-signals OK 6.13s 4/9 t0003-attributes OK 52.56s 5/9 t0006-date OK 30.16s 6/9 t0001-init OK 60.24s 7/9 t0007-git-var OK 12.93s 8/9 t0008-ignores OK 106.42s 9/9 t0000-basic OK 192.99s Ok: 9 Expected Fail: 0 Fail: 0 Unexpected Pass: 0 Skipped: 0 Timeout: 0 Full log written to /home/ramsay/git/build/meson-logs/testlog.txt $ So, I just need to build the v4 version and test again (at some point I have to do a full (6 hour+) test run on cygwin!). Thanks! ATB, Ramsay Jones
On Fri, Oct 25, 2024 at 05:36:00PM +0100, Ramsay Jones wrote: > > > On 25/10/2024 06:20, Patrick Steinhardt wrote: > > On Thu, Oct 24, 2024 at 06:34:24PM +0100, Ramsay Jones wrote: > >> On 24/10/2024 08:19, Patrick Steinhardt wrote: > >> Having a quick squint at the failure, it '# failed 1 among 397 test(s)' > >> which was 'not ok 391 - correct handling of backslashes', which is the > >> only test marked with a '!CYGWIN' prerequisite! ;) So it seems that I > >> am doing something wrong, which results in the prerequisite not being > >> set. > > > > The CYGWIN prerequisite is set depending on whether or not `uname -s` > > contains "*CYGWIN*". Does your system maybe pick up the wrong uname(1) > > binary somehow? > > > Yep, I suspected that I knew what the problem was, I just had not looked > to see if my hunch was correct yet! :) And indeed: > > $ pwd > /home/ramsay/git > $ ls -l uname* > -rw-r--r-- 1 ramsay None 11K Jun 28 2019 uname.c > -rwxr-xr-x 1 ramsay None 167K Jun 28 2019 uname.exe* > $ ./uname -s > Windows > $ ./uname -a > Windows satellite 10.0 19045() AMD-64 Windows 10 Home > $ uname -a > CYGWIN_NT-10.0-19045 satellite 3.5.4-1.x86_64 2024-08-25 16:52 UTC x86_64 Cygwin > $ > > As you can see, many many moons ago (28 Jun 2019 was just the last time > it was updated/built - I suspect it was first written in 2006), I had > written my own version of uname. If memory serves, it was actually for > the 'msys' version, not cygwin! ;) > > Anyway, when the test executes my PATH starts: > > /home/ramsay/git/build/bin-wrappers:/home/ramsay/git:/usr/bin ... > > It is not immediately obvious why '/home/ramsay/git' is in there, but > if I move my uname out of the way: > > $ mv uname* ../src > $ ls -l uname* > ls: cannot access 'uname*': No such file or directory > $ Interesting. I guess that `find_program()` finds some of the required binaries in the Git directory itself, which sounds wrong to me. I'll have a look at this. Patrick