gitlab-ci-local: remove unused dependencies (#397276)

This commit is contained in:
Peder Bergebakken Sundt
2025-04-25 01:44:35 +02:00
committed by GitHub
@@ -34,6 +34,29 @@ buildNpmPackage rec {
'';
postInstall = ''
NODE_MODULES=$out/lib/node_modules/gitlab-ci-local/node_modules
# Remove intermediate build files for re2 to reduce dependencies.
#
# This does not affect the behavior. On npm `re2` does not ship
# the build directory and downloads a prebuilt version of the
# `re2.node` binary. This method produces the same result.
find $NODE_MODULES/re2/build -type f ! -path "*/Release/re2.node" -delete
strip -x $NODE_MODULES/re2/build/Release/re2.node
# Remove files that depend on python3
#
# The node-gyp package is only used for building re2, so it is
# not needed at runtime. I did not remove the whole directory
# because of some dangling links to the node-gyp directory which
# is not required. It is possible to remove the directory and all
# the files that link to it, but I figured it was not worth
# tracking down the files.
#
# The re2/vendor directory is used for building the re2.node
# binary, so it is not needed at runtime.
rm -rf $NODE_MODULES/{node-gyp/gyp,re2/vendor}
wrapProgram $out/bin/gitlab-ci-local \
--prefix PATH : "${
lib.makeBinPath [