Skip to content

fix: drop no-op install script that triggers Yarn build warning - #180

Merged
BridgeAR merged 4 commits into
mainfrom
BridgeAR/2026-06-27-drop-install-build-script
Jul 28, 2026
Merged

BridgeAR merged 4 commits into
mainfrom
BridgeAR/2026-06-27-drop-install-build-script

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Summary

Yarn Berry (Plug'n'Play) prints YN0007: @datadog/native-appsec must be built for any dependency that declares an install/preinstall/postinstall script, including the no-op "install": "exit 0". The package ships prebuilt binaries and excludes binding.gyp from the published tarball, so a consumer has nothing to build.

The script also suppressed npm's implicit node-gyp rebuild in the dev tree. The static-checks job ran a bare npm ci without the libddwaf artifact, so it now installs with --ignore-scripts; the build job already uses action-prebuildify (--ignore-scripts), so prebuilds are unaffected.

A regression test asserts the manifest declares no build lifecycle scripts.

Test plan

  • CI green (build, static-checks, cpp-lint)
  • yarn add @datadog/native-appsec under Yarn Berry no longer prints YN0007

Refs: DataDog/dd-trace-js#5432

Yarn Berry (Plug'n'Play) prints "YN0007: @datadog/native-appsec must be
built" for any dependency that declares an install/preinstall/postinstall
script, even the no-op "exit 0". The package ships prebuilt binaries and
excludes binding.gyp from the published tarball, so a consumer has nothing
to build; the script only suppressed npm's implicit node-gyp rebuild in the
dev tree. Removing it stops the spurious warning for Yarn Berry consumers.

The static-checks job ran a bare `npm ci`. Without the install script npm
would implicitly run node-gyp there, but that job lacks the libddwaf
artifact, so it now installs with --ignore-scripts. The build job already
uses action-prebuildify with --ignore-scripts, so prebuilds are unaffected.

Refs: DataDog/dd-trace-js#5432
@datadog-datadog-prod-us1

This comment has been minimized.

BridgeAR added 2 commits July 22, 2026 20:31
Without an install script, npm's publish-time normalization synthesizes node-gyp rebuild when binding.gyp is present. Consumers then try to build against a binding.gyp excluded from the tarball instead of loading the shipped prebuild.

Setting gypfile:false suppresses npm's implicit hook without restoring the lifecycle script that triggers Yarn Berry's YN0007 warning.

Refs: DataDog/dd-trace-js#5432
actions/download-artifact@v7 flattens libddwaf when it is the run's only artifact, so binding.gyp cannot find libddwaf/include/ddwaf.h.

Name the input artifact explicitly so action-prebuildify restores the layout used by local builds and releases.
Comment thread .github/workflows/build.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
@BridgeAR
BridgeAR marked this pull request as ready for review July 28, 2026 10:10
@BridgeAR
BridgeAR requested a review from a team as a code owner July 28, 2026 10:10
@BridgeAR
BridgeAR merged commit 3a5cc60 into main Jul 28, 2026
50 checks passed
@BridgeAR
BridgeAR deleted the BridgeAR/2026-06-27-drop-install-build-script branch July 28, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants