#1 Remove executable bits from bundled dependency tests
Merged 5 years ago by jsmith. Opened 5 years ago by jstanek.
rpms/ jstanek/nodejs-yarn fix/bundled-executable-tests  into  master

file modified
+11 -2
@@ -12,7 +12,7 @@ 

  

  Name:           nodejs-yarn

  Version:        1.13.0

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        Fast, reliable, and secure dependency management.

  Url:            https://github.com/yarnpkg/yarn

  # we need tarball with node_modules
@@ -48,12 +48,17 @@ 

  mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}

  

  cp -pr package.json lib bin node_modules \

- 	%{buildroot}%{nodejs_sitelib}/%{npm_name}

+     %{buildroot}%{nodejs_sitelib}/%{npm_name}

  

  mkdir -p %{buildroot}%{_bindir}

  ln -sf ../lib/node_modules/yarn/bin/yarn.js %{buildroot}%{_bindir}/nodejs-yarn

  ln -sf ../lib/node_modules/yarn/bin/yarn.js %{buildroot}%{_bindir}/yarnpkg

  

+ # Remove executable bits from bundled dependency tests

+ find %{buildroot}%{nodejs_sitelib}/%{npm_name}/node_modules \

+     -ipath '*/test/*' -type f -executable \

+     -exec chmod -x '{}' +

+ 

  #%{nodejs_symlink_deps}

  

  %if 0%{?enable_tests}
@@ -72,6 +77,10 @@ 

  %license LICENSE

  

  %changelog

+ * Wed Feb 13 2019 Jan Staněk <jstanek@redhat.com> - 1.13.0-2

+ - Remove executable bits from bundled tests

+ - Related: rhbz#1674073

+ 

  * Thu Feb 07 2019 Zuzana Svetlikova <zsvetlik@redhat.com> - 1.13.0-1

  - Update

  

The executable bit on the tests from bundled dependency triggers shebang mangling.
As the original shebangs are not valid to begin with, the mangling fails.
Removing the executable bit disables this process.

The other option is to point the shebang to /usr/bin/coffee and add a dependency on coffee-script.
Since these test are for bundled dependencies and not for the package itself (which has its own tests),
I feel that this would add an unnecessary maintenance burden.

+ /usr/lib/rpm/redhat/brp-mangle-shebangs
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/mkdirp-promise/lib/index.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/mkdirp-promise/LICENSE is executable but has empty or no shebang, removing executable bit
mangling shebang in /usr/lib/node_modules/yarn/node_modules/ajv/scripts/prepare-tests from /usr/bin/env sh to #!/usr/bin/sh
mangling shebang in /usr/lib/node_modules/yarn/node_modules/ajv/scripts/travis-gh-pages from /usr/bin/env bash to #!/usr/bin/bash
mangling shebang in /usr/lib/node_modules/yarn/node_modules/ajv/scripts/publish-built-version from /usr/bin/env bash to #!/usr/bin/bash
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/object-path/.npmignore is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/object-path/.travis.yml is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/ecc-jsbn/lib/LICENSE-jsbn is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/ecc-jsbn/lib/ec.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/ecc-jsbn/lib/sec.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/ecc-jsbn/README.md is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/ecc-jsbn/index.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/ecc-jsbn/test.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/ecc-jsbn/package.json is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/ecc-jsbn/LICENSE is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/dnscache/examples/sample.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/micromatch/index.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/micromatch/LICENSE is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/emojis-list/README.md is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/emojis-list/LICENSE.md is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/arr-diff/LICENSE is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/request/index.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/array-unique/README.md is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/array-unique/index.js is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/array-unique/package.json is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/array-unique/LICENSE is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/arr-flatten/README.md is executable but has empty or no shebang, removing executable bit
BUILDSTDERR: *** WARNING: ./usr/lib/node_modules/yarn/node_modules/arr-flatten/LICENSE is executable but has empty or no shebang, removing executable bit

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1674073

Optionally, check out the other warnings as well.

Pull-Request has been merged by jsmith

5 years ago