[Pkg-javascript-devel] pkg-js-tools, nodejs and modules build ordering
Roland Mas
lolando at debian.org
Sat Feb 19 00:33:55 GMT 2022
Hi all,
I'm still working on packaging ipywidgets and jupyterlab, each with its
share of Node modules. I'm in the process of replacing the imperative
parts of debian/rules with declarative files used by the nodejs
buildsystem for debhelper, and I'm encountering a strange behaviour.
Since I'm rather new to node module packaging in general and
pkg-js-tools in particular, I'd rather discuss it here before filing a bug.
In short: when I specify dependencies between modules, the build order
does not necessarily take them into account.
For instance, my current debian/nodejs/component_links reads as follows:
packages/coreutils packages/ui-components
packages/ui-components packages/apputils
packages/apputils packages/outputarea
packages/rendermime-interfaces packages/mathjax2
packages/rendermime packages/outputarea
Yet the build log shows that dh_auto_build tries to build
packages/apputils first, although it should at least be built later than
packages/ui-components. My suspicion is that the cmp_ordered_list
function in /usr/share/perl5/Debian/Debhelper/Buildsystem/nodejs.pm is a
bit optimistic in that it hopes that every pair of packages will be
compared during the sorting of the list, which means not all
dependencies are taken into account. Instrumenting the sort {} seems to
confirm this hypothesis, since the apputils and ui-components items are
not compared. As a result, the build ordering is not necessarily
compliant with the requirements. It's quite possible that this behaviour
only pops up when the list is large enough that the comparisons are
sparse; in the case of jupyterlab, there are 91 modules, which are
sorted using only 160 comparisons.
For reference and reproducibility, see the
python-team/packages/jupyterlab repo on salsa; commit 2d334d40d8
exhibits the "bug" for me using gbp buildpackage.
Am I missing something? I'd love to use the declarative approach and let
the tools do the actual ordering :-)
Roland.
More information about the Pkg-javascript-devel
mailing list