- Package:
- dh-nodejs
- Source:
- pkg-js-tools
- Submitter:
- Julian Gilbey
- Date:
- 2022-12-26 09:00:06 UTC
- Severity:
- normal
I am working on a package (node-webfont) which requires a non-node component. The dh-nodejs tools keeps complaining, for example debclean reports: Found debian/nodejs/additional_components /!\ woff2/package.json not found Unable to load woff2 /!\ brotli/package.json not found Unable to load brotli My additional_components reads: --- !brotli !woff2 --- following the guidance in pkg-js-tools(7), if I've understood it correctly. But it seems that this syntax doesn't help; list-node-components reports: [...] varstream woff2 brotli !brotli !woff2 with the first occurrence being picked up from debian/watch and the ! occurrences being those in additional_components. But component_list in /usr/share/perl5/Debian/PkgJs/Utils.pm has a different behaviour, and it would seem that that should work. Unfortunately, though, it doesn't appear to do so, and I don't understand why not. Best wishes, Julian
Hi Julian, These are some excerpts from pkg-js-tools manpage: debian/nodejs/additional_components is used to set some subdirectories that should be considered as components even if they are not listed in debian/watch. Starting from pkg-js-tools version 0.12.0 and 0.12.7, the packages field in lerna.conf and workspaces field in package.json are used to automatically detect additional components. If a component should not be considered i.e, not automatically detected, insert its name preceded by a "!" in debian/nodejs/additional_components. From the above, I don't think "!" in debian/nodejs/additional_components is used to exclude a component listed in debian/watch.
Can I ask what you're trying to achieve by excluding the component listed in debian/watch? There could be a dh command or some pkg-js-tools functionality that can be used to achieve it. On Sun, 25 Dec 2022 at 20:36, Israel Galadima <izzygaladima@gmail.com> wrote:
Hi Israel,
That is exactly the behaviour I would expect from both a reading of
that manpage and the code in /usr/share/perl5/Debian/PkgJs/Utils.pm,
lines 153-217, excerpted here:
sub component_list {
my $lerna = $OPTS->{lerna};
my ( @components, %packages, @toDelete );
[...]
if ( -e 'debian/watch' ) {
map { push @components, $1 if (/^[^#]*component=([\w\-\.]+)/) }
open_file('debian/watch');
}
[...]
if ( -e 'debian/nodejs/additional_components' ) {
debug "Found debian/nodejs/additional_components";
map {
if (s/^!//) {
push @toDelete, $_;
}
else {
debug 'Adding component(s): ' . join( ', ', glob($_) );
push @components, glob($_);
}
} open_file('debian/nodejs/additional_components');
}
[...]
foreach (@toDelete) {
my $ref = $_;
@components = grep { $_ ne $ref } @components;
delete $packages{$ref};
}
return \%packages;
}
So if I understand this function correctly, the intended behaviour is
exactly as I described in the bug report: writing "!brotli" in
additional_components should cause the dh-nodejs scripts to ignore
this component. But it's possible that some of the bits I commented
out cause the function to do something else that I don't understand.
Best wishes,
Julian
Yes, these components are C++ code, not Javascript, so I want the dh-nodejs scripts to completely ignore them. Best wishes, Julian
Then it may be better to package these two separately. Currently I think the components are designed work with nodejs only modules I think.
separately for my purposes (and they are both already packaged in Debian): node-wawoff2 requires an emscripten/WASM build of these two C++ libraries, so it needs the source code. Best wishes, Julian
Quoting Julian Gilbey (2022-12-25 22:43:05) It is sensible to expect debhelper scripts to support ignoring some parts of a project - either because those other parts need different tools (like here) or because those parts need custom handling for other reasons. Please a bugreport against dh-nodejs. - Jonas
reassign 1026974 dh-nodejs thanks OK; I'm reassigning this bug there, then. (They're part of the same source package anyway.) Julian
Hi, I'm moving this week, will take a look at this later ;-) Cheers, Yadd Le Lundi, Décembre 26, 2022 08:36 CET, Julian Gilbey <jdg@debian.org> a écrit:
Thanks Yadd, and it isn't breaking the build, so no particular rush! Best wishes, Julian