Thread: Re: --enable-{debug,cassert} should also activate --enable-depend
Hi Dimitris, > I just spent 2 miserable days tracking down a very weird issue. I ended up > stepping through the code in the debugger. As it turned out, the very same > moment of execution, one datastructure (struct _restoreOptions defined in > pg_backup.h) contained different fields on one data frame than another! > This was the result of one object file *not* being re-compiled as needed, > after applying my patch that added that extra field to the datastructure > in pg_backup.h. > > This caused weird and completely irrelevant failures, as unexpected fields > of the struct were changing value. > > I then found that I need to compile with --enable-depend to have Makefiles > with proper dependency tracking. Shouldn't it be the default, at least for > non-release builds? I sympathize but realistically I doubt that someone is going to do something about it. Autotools slowly approaches its end of life and for Meson we don't seem to have an equivalent of --enable-depend. On top of that I imagine how one could argue that these options should be independent. -- Best regards, Aleksander Alekseev
On Tue, 17 Jun 2025, Aleksander Alekseev wrote: > Hi Dimitris, > >> I just spent 2 miserable days tracking down a very weird issue. I ended up >> stepping through the code in the debugger. As it turned out, the very same >> moment of execution, one datastructure (struct _restoreOptions defined in >> pg_backup.h) contained different fields on one data frame than another! >> This was the result of one object file *not* being re-compiled as needed, >> after applying my patch that added that extra field to the datastructure >> in pg_backup.h. >> >> This caused weird and completely irrelevant failures, as unexpected fields >> of the struct were changing value. >> >> I then found that I need to compile with --enable-depend to have Makefiles >> with proper dependency tracking. Shouldn't it be the default, at least for >> non-release builds? > > I sympathize but realistically I doubt that someone is going to do > something about it. Autotools slowly approaches its end of life and Do you mean autotools are being deprecated in postgres? So people should better choose meson? Because in other autotools projects, dependency tracking is handled by automake and is on by default. https://www.gnu.org/software/automake/manual/html_node/Dependencies.html Regards, Dimitris
Hi Dimitris, > Do you mean autotools are being deprecated in postgres? So people should > better choose meson? Yes, Meson support was added in PostgreSQL 16 and it will eventually replace Autotools [1]. Meson is more convenient and works faster so I encourage you to give it a try. Here is a quick start: ``` sudo apt install ninja-build pip3 install meson # or: sudo apt install meson meson setup --buildtype debug -Dcassert=true -Dtap_tests=enabled -Dlz4=enabled -Dldap=disabled -Dprefix=/Users/eax/pginstall build ninja -C build meson test -C build ``` [1]: https://www.postgresql.org/docs/release/16.0/ -- Best regards, Aleksander Alekseev