[Pkg-javascript-devel] `Build-Depends` parsing problem for node-* packages

David Kalnischkies david at kalnischkies.de
Wed Mar 17 18:22:01 GMT 2021


Hi,

On Wed, Mar 17, 2021 at 04:52:38PM +0100, Arnaud Ferraris wrote:
> I've been confronted with an issue affecting a number of node-* packages
> (and maybe others): apt is unable to parse the Build-Depends field,
> making `apt build-dep` effectively unusable with those packages.
> 
> One good example is node-ramda[1]: as the first non-space character apt
> encounters when parsing Build-Depends is a comma, it considers this a
> syntax error and errors out.

While that particular style is odd for my taste¹, apt is not the arbiter
of the allowed style here. You would need to make a case for dpkg to
refuse this style and that seems even more odd [bad pun intended].

Also, being reminded of #875363 I think the ship has sailed on
"that is odd, lets not support this in apt" even if we would like to be
the arbiters (we don't).


> My personal opinion is that apt's current behavior is sane and the 2nd

Thanks for giving apt so much credit, but this is just another instance
of "apt developers are lazy and unimaginative" as they reused the parser
which was once written for well-defined machine-written and trusted data
and let it loose on all sorts of crazy handcrafted files with comments,
spaces, newlines and empty fields all over the place. Its a mystery how
that isn't crashing all the time even through it isn't written in Rust.
(SCNR)


So please move this thread to a (wishlist) bug against apt and I will see
how I can mangle the input string we pass to good old parser to accept
commas ,all, over ,the, , place, too (currently it accepts only a single
trailing comma, optionally surrounded by white space) ,

As `apt build-dep .` is (to my knowledge) not used in any critical infra
but only by some humans this isn't fixable for bullseye though as such
a change would likely not get a freeze exception.


Best regards

David Kalnischkies


¹ ; char const * const name = "World"
  ; printf("Hello %s!", name)

(that style reminds me of some other language I have seen but can't
 quite remember at the moment; I just haven't seen it in a control file
 so far. As said later, some apt developers are so unimaginative…)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20210317/afe6257a/attachment.sig>


More information about the Pkg-javascript-devel mailing list