Обсуждение: What is the build strategy between make and meson?
It is my first time trying meson build, and I got a bunch of warnings on my MacBook with macOS Sequoia 15.6.1:
```
chaol@ChaodeMacBook-Air build % ninja
[231/1835] Compiling C object src/interfaces/libpq/libpq.5.dylib.p/fe-connect.c.o
../src/interfaces/libpq/fe-connect.c:5622:12: warning: 'ldap_init' is deprecated: first deprecated in macOS 10.10 - use ldap_initialize [-Wdeprecated-declarations]
5622 | if ((ld = ldap_init(hostname, port)) == NULL)
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.5.sdk/usr/include/ldap.h:1526:1: note: 'ldap_init' has been explicitly marked deprecated here
1526 | ldap_init LDAP_P(( /* deprecated, use ldap_create or ldap_initialize */
| ^
<too long, so omitting the rest>
```
Should those warnings be fixed?
But “make” won’t generate those warnings.
The other problem I encountered is that, when unicode map files are regenerated, “make” won’t auto rebuild corresponding .o and lib files, but ninja does. That means “Makefile” has something to fix. But given ninja works, should “Makefile” still be fixed?
So, I want to clarify that:
* Is it free for developers to choose make or meson?
* If something works with one but the other, should that be fixed?
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
HighGo Software Co., Ltd.
https://www.highgo.com/
Chao Li <li.evan.chao@gmail.com> writes: > It is my first time trying meson build, and I got a bunch of warnings on my MacBook with macOS Sequoia 15.6.1: > ... > ../src/interfaces/libpq/fe-connect.c:5622:12: warning: 'ldap_init' is deprecated: first deprecated in macOS 10.10 - useldap_initialize [-Wdeprecated-declarations] You would get those same warnings with configure/make too, if you specified --with-ldap. The relevant difference here is that configure will not try to build with LDAP unless you tell it --with-ldap, whereas meson's default behavior is to try to build with every option that it can find supporting headers/libraries for. That's a philosophical difference between the build systems that we can't really paper over. > The other problem I encountered is that, when unicode map files are regenerated, “make” won’t auto rebuild corresponding.o and lib files, but ninja does. That means “Makefile” has something to fix. But given ninja works, should“Makefile” still be fixed? Probably. > So, I want to clarify that: > * Is it free for developers to choose make or meson? > * If something works with one but the other, should that be fixed? I believe the long-term plan is to abandon autoconf/make in favor of meson, but the emphasis is on "long" --- any such decision is still years away, I think. In the meantime it's probably still worth repairing deficiencies in the makefiles. It's definitely worth repairing deficiencies in the meson files, of which there are plenty. regards, tom lane
I wrote: > Chao Li <li.evan.chao@gmail.com> writes: >> The other problem I encountered is that, when unicode map files are regenerated, “make” won’t auto rebuild corresponding.o and lib files, but ninja does. That means “Makefile” has something to fix. But given ninja works, should“Makefile” still be fixed? > Probably. BTW, did you use --enable-depend with configure? If that fixes the problem then there is no bug. This is another philosophical difference: autoconf lets you say whether to spend the overhead to track build dependencies, meson/ninja does it always. It might be that --enable-depend isn't enough to capture this dependency, in which case that's a bug worth fixing. regards, tom lane
Hi Tom,
Thanks for your guidance.
Yes, with “—with-ldap”, I got the same warnings with make.
Best regards,
On Oct 9, 2025, at 12:20, Tom Lane <tgl@sss.pgh.pa.us> wrote:I wrote:Chao Li <li.evan.chao@gmail.com> writes:The other problem I encountered is that, when unicode map files are regenerated, “make” won’t auto rebuild corresponding .o and lib files, but ninja does. That means “Makefile” has something to fix. But given ninja works, should “Makefile” still be fixed?Probably.
BTW, did you use --enable-depend with configure? If that fixes
the problem then there is no bug. This is another philosophical
difference: autoconf lets you say whether to spend the overhead
to track build dependencies, meson/ninja does it always. It might
be that --enable-depend isn't enough to capture this dependency,
in which case that's a bug worth fixing.
For the issue I encountered, I just tried “—enable-depend”, the option doesn’t resolve the issue:
```
chaol@ChaodeMacBook-Air mb % touch Unicode/euc_cn_to_utf8.map
chaol@ChaodeMacBook-Air mb % make
/Library/Developer/CommandLineTools/usr/bin/make -C ../../../../src/backend generated-headers
/Library/Developer/CommandLineTools/usr/bin/make -C ../include/catalog generated-headers
make[2]: Nothing to be done for `generated-headers'.
/Library/Developer/CommandLineTools/usr/bin/make -C nodes generated-header-symlinks
make[2]: Nothing to be done for `generated-header-symlinks'.
/Library/Developer/CommandLineTools/usr/bin/make -C utils generated-header-symlinks
/Library/Developer/CommandLineTools/usr/bin/make -C adt jsonpath_gram.h
make[3]: `jsonpath_gram.h' is up to date.
```
As you can see, I touched a map file and nothing got rebuilt. But with meson, if I touch the same map file, the corresponding lib will be rebuilt. I am trying to fix this issue with https://commitfest.postgresql.org/patch/5953/.
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
HighGo Software Co., Ltd.
https://www.highgo.com/