On 2026-06-20 1:21 AM, Gordon Messmer wrote:
In theory, these things can be stripped of binaries before uploading
source to the lookaside cache, and the build process can run "npm
rebuild" to regenerate some binaries, but in practice it definitely
isn't that simple.
I thought this would be simple to fix for at least some of the packages
that contain pre-built content, but now I'm not so sure.
https://docs.fedoraproject.org/en-US/packaging-guidelines/Node.js/
I think that the expected process for packaging Node.js software is that
the runtime dependencies can be unpacked from an archive in %prep and
installed in %install. The development dependencies can be unpacked from
an archive during %check and used to run tests.
If we remove pre-built binaries including WASM, then we need to re-build
them.
I tried adding "npm rebuild" to the %build section (and to the %check
section, after unpacking the dev dependencies). In that case, npm
appears to try rebuilding all modules recursively, which is what we
would need to happen. But that process fails because rebuilding
recursively requires the devDependencies for every module recursively,
and "npm install" doesn't appear to install that.
(I'm further confused by the finding that running "npm install",
removing binaries from the resulting "node_modules" directory, and then
running "npm rebuild" does not appear to attempt to rebuild modules.
It's only when node_modules is renamed to node_modules_prod and its
contents are symlinked into a new node_modules directory (normal for the
nodejs-packaging-bundler process) that "npm rebuild" will try to rebuild
them.)
We might be able to instead remove binaries and record the modules from
which they are removed. Every module that has content removed would need
to be packaged individually, and every package that uses those modules
would need to use a "system" install of that module. That would be
complex in the cases where a specific version of the module is needed,
which is a common case in npm. I'm not sure how many additional packages
that would require, but that would avoid the need to run "npm rebuild",
which doesn't seem to work.
--
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it:
https://forge.fedoraproject.org/infra/tickets/issues/new