Helge Deller:
On 1/4/25 10:27, Niels Thykier wrote:dpkg-buildpackage has become incredible slow. This seems to have started around end of 2024.Please show us the package source. A pstree can also be helpful in case the `dpkg-buildflags` are called from a tool rather than `debian/rules`.This happens for me with the "neomutt" or "vim" source packages from sid. Helge
The `neomutt` package has two calls to `dpkg-buildflags` that looks like they could definitely be optimized. Though, I cannot see those two being introduced recently. In fact, `git blame` dates those two lines as 6 years old. For `neomutt`, assuming those two are only needed for `dh_auto_configure` (which is likely but untested) we could move them to the override_dh_auto_configure. Something like
override_dh_auto_configure: EXTRA_CFLAGS_FOR_BUILD=$$(dpkg-buildflags --get CFLAGS) \ EXTRA_LDFLAGS_FOR_BUILD=$$(dpkg-buildflags --get LDFLAGS) \ dh_auto_configure -- \ ...Alternatively, perhaps including the dpkg makfile and use the relevant variables from it with lazy evaluation `EXTRA_CFLAGS_FOR_BUILD=...` (instead of `EXTRA_CFLAGS_FOR_BUILD:=...`) might help.
For `vim`, I cannot spot anything obvious with the `dpkg-buildflags` (it uses the include). But it does have several hook targets plus self recursion into `debian/rules`, which tends to amplify the problem considerably. I suspect that inlining the `$(MAKE) -f debian/rules ...` would help here. Perhaps a "DPKG_EXPORT_BUILDFLAGS=1" might work as a work around, since it should make recursion a bit less costly.
Sadly, the "conventional" knowledge for makefiles does not apply `debian/rules` when it comes to optimization, which does not help the problem.
Best regards, Niels
OpenPGP_signature.asc
Description: OpenPGP digital signature