You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rpmbuild rewrites shebangs in the prebuilt Node.js payload, so RPMs ship different bytes than DEBs #218
The rpm branch of the shared OBS spec (packaging/builder/opentelemetry.spec.tmpl) turns off stripping, debuginfo, and build-id links for the prebuilt payload.
It leaves brp-mangle-shebangs on, so rpmbuild changes files in the payload after %install.
The RPMs then ship different bytes from the DEB and nfpm packages built from the same source archive.
Evidence
In the rpm-source-rebuild CI jobs of #202, both on Fedora 44 and on AlmaLinux 9, rpmbuild logs:
mangling shebang in /usr/lib/opentelemetry/nodejs/node_modules/@grpc/proto-loader/build/bin/proto-loader-gen-types.js from /usr/bin/env node to #!/usr/bin/node
mangling shebang in /usr/lib/opentelemetry/nodejs/node_modules/yaml/bin.mjs from /usr/bin/env node to #!/usr/bin/node
mangling shebang in /usr/lib/opentelemetry/nodejs/node_modules/rimraf/dist/esm/bin.mjs from /usr/bin/env node to #!/usr/bin/node
mangling shebang in /usr/lib/opentelemetry/nodejs/node_modules/systeminformation/lib/cli.js from /usr/bin/env node to #!/usr/bin/node
mangling shebang in /usr/lib/opentelemetry/nodejs/node_modules/which/bin/node-which from /usr/bin/env node to #!/usr/bin/node
mangling shebang in /usr/lib/opentelemetry/nodejs/node_modules/glob/dist/esm/bin.mjs from /usr/bin/env node to #!/usr/bin/node
Impact
The impact is small, as the agent does not run these CLI entry points itself.
The RPM and DEB payloads of the same version are no longer byte-identical, which defeats the point of staging one tree for both builders.
On a host whose node is not /usr/bin/node (nvm, /usr/local/bin, a container image), the rewritten scripts no longer start.
The rewritten shebang is also why the spec has to filter %{_bindir}/node out of the automatic Requires.
brp-python-bytecompile runs too, but is currently a no-op for this payload.
It is invoked as brp-python-bytecompile '' 1 0 on both distributions: no interpreter in the buildroot, and _python_bytecompile_extra set to 0.
It would start writing unpackaged __pycache__/*.pyc files if either of those changed.
Proposed fix
Add the following next to the existing debug_package and __strip overrides in the rpm branch:
Activity