Hi all,
I've been a Fedora packager for years, but haven't really forayed into Node.js packaging before.
Looking at packaging Bitwarden CLI, and any missing dependencies -- any advice appreciated.
Best regards,
On Wed, Jul 29, 2020 at 3:05 PM Michel Alexandre Salim michel@michel-slm.name wrote:
Hi all,
I've been a Fedora packager for years, but haven't really forayed into Node.js packaging before.
Looking at packaging Bitwarden CLI, and any missing dependencies -- any advice appreciated.
Hi Michel, Welcome to nodejs packaging. :) I don't know if you saw my other emails, we (or at least I and one or two others) are leaning towards bundling the nodejs library dependencies. Nodejs is one of the Fedora languages that allows bundling, and if we make it easy to do, I think that will make the nodejs packaging and maintaining process easier.
As to how you bundle your dependencies, for both runtime and build/testing, I plan on posting what I tend to do. And I think it would be good if we all had a discussion on which way is best and easiest.
Troy
Hi Troy,
On Thu, 2020-07-30 at 09:41 -0700, Troy Dawson wrote:
Hi Michel, Welcome to nodejs packaging. :) I don't know if you saw my other emails, we (or at least I and one or two others) are leaning towards bundling the nodejs library dependencies. Nodejs is one of the Fedora languages that allows bundling, and if we make it easy to do, I think that will make the nodejs packaging and maintaining process easier.
As to how you bundle your dependencies, for both runtime and build/testing, I plan on posting what I tend to do. And I think it would be good if we all had a discussion on which way is best and easiest.
Yup, I saw that. Been following the discussion in devel@ too over the difficulties in keeping up with dependencies, so I'm looking forward to see the proposal.
I am involved in packaging for Rust as well, and it also suffers from the proliferation of dependencies too to some extent. Would be interested to see if any bundling policy can be shared between language stacks that have similar issues.
Regards,
Hi Troy,
On Thu, 2020-07-30 at 09:41 -0700, Troy Dawson wrote:
On Wed, Jul 29, 2020 at 3:05 PM Michel Alexandre Salim michel@michel-slm.name wrote:
Hi all,
I've been a Fedora packager for years, but haven't really forayed into Node.js packaging before.
Looking at packaging Bitwarden CLI, and any missing dependencies -- any advice appreciated.
Hi Michel, Welcome to nodejs packaging. :) I don't know if you saw my other emails, we (or at least I and one or two others) are leaning towards bundling the nodejs library dependencies. Nodejs is one of the Fedora languages that allows bundling, and if we make it easy to do, I think that will make the nodejs packaging and maintaining process easier.
As to how you bundle your dependencies, for both runtime and build/testing, I plan on posting what I tend to do. And I think it would be good if we all had a discussion on which way is best and easiest.
While I await your post on how to bundle dependencies, some questions:
Spec: https://salimma.fedorapeople.org/specs/nodejs/bitwarden-cli.spec SRPM: https://salimma.fedorapeople.org/specs/nodejs/bitwarden-cli-1.11.0-1.fc32.sr...
(this is not ready to be reviewed, as dependencies are still missing and I need to either also package them or figure out how to bundle)
- the upstream module name is @bitwarden/cli; the / in the name breaks both nodejs_find_provides_and_requires and nodejs_symlink_deps - if I install this to /usr/lib/node-modules/bitwarden-cli instead of to /usr/lib/node-modules/@bitwarden/cli those two scripts work fine, and the generated RPM does contain the right requires - to fix the provides I also need to patch package.json
Is this fine? This is more of a binary than a library that will be imported anyway, so I guess renaming is not that big a deal. As an alternative we can fix the scripts to handle module names that contain slashes, but... I'm new to NodeJS so I don't know if that's even supposed to be valid.
- the new packaging guidelines says to BuildRequires nodejs: https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/ - the old packaging guidelines, meanwhile, says to BuildRequires nodejs-packaging: https://fedoraproject.org/wiki/Packaging:Node.js?rd=Node.js/Packagers#BuildR...
The latter seems to be correct, as if I just BR nodejs I get this error:
+ %nodejs_symlink_deps /var/tmp/rpm-tmp.EFAOft: line 47: fg: no job control
RPM build errors: error: Bad exit status from /var/tmp/rpm-tmp.EFAOft (%install) Bad exit status from /var/tmp/rpm-tmp.EFAOft (%install)
Best regards,
On Fri, Jul 31, 2020 at 2:00 AM Michel Alexandre Salim michel@michel-slm.name wrote: ...
- the new packaging guidelines says to BuildRequires nodejs:
https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/
- the old packaging guidelines, meanwhile, says to BuildRequires
nodejs-packaging: https://fedoraproject.org/wiki/Packaging:Node.js?rd=Node.js/Packagers#BuildR...
The latter seems to be correct, as if I just BR nodejs I get this error:
- %nodejs_symlink_deps
/var/tmp/rpm-tmp.EFAOft: line 47: fg: no job control
RPM build errors: error: Bad exit status from /var/tmp/rpm-tmp.EFAOft (%install) Bad exit status from /var/tmp/rpm-tmp.EFAOft (%install)
The `nodejs-packaging` package is *supposed* to be part of the default buildroot in Koji, but I think it may be missing. We need to track that down
nodejs@lists.fedoraproject.org