Re: [RFC PATCH v3 00/15] Modernize the build system
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Oct 24, 2024, 01:43 UTC
- Message-ID
- <b1ab6c1a-54ce-4adb-8977-ef376fdb48f1@ramsayjones.plus.com>
- In-Reply-To
- <6883a8d4-7e2e-4988-b57f-89b7c0aacadc@gentoo.org>
On 23/10/2024 16:58, Eli Schwartz wrote:
Show 12 quoted lines
> 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).
Show 14 quoted lines
>> 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/ramsayFound 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/localFound ninja-1.12.0 at /usr/bin/ninja Cleaning... 0 files. $
Show 5 quoted lines
> 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