-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: remove NPM from builder #27163
Comments
ProtobufJS's CLI attempts to install its own dependencies by invoking NPM. This breaks our dependency pinning and vendoring, so we pre-install its dependencies ourselves. Unfortunately, the CLI maintains two different dependency lists: the cliDependencies field in package.json, and the dependencies field in cli/package.standalone.json. We were looking at the latter when pre-installing the CLI's dependencies, but only the former is maintained. This patch adds a script to extract a package.json that encodes up-to-date dependency information. The Makefile then invokes `yarn install` on this synthesized package. This guarantees that the ProtobufJS CLI will see that the correct versions of its dependencies are pre-installed and will not invoke NPM. The resulting diff in pkg/ui/yarn.protobuf-cli.lock reveals that ProtobufJS was installing newer versions of its dependencies without us realizing it. Note that it is now safe to use new versions of jsdoc; the issue mentioned in the Makefile was fixed in jsdoc 3.5.4 (jsdoc/jsdoc#1408). To prevent accidents in the future, a forthcoming commit will remove NPM from the builder image so that CI will fail if ProtobufJS attempts to invoke NPM behind our back. See cockroachdb#27163. Release note: None
27164: ui: get smarter about pinning protobufjs's dependency set r=knz a=benesch ProtobufJS's CLI attempts to install its own dependencies by invoking NPM. This breaks our dependency pinning and vendoring, so we pre-install its dependencies ourselves. Unfortunately, the CLI maintains two different dependency lists: the cliDependencies field in package.json, and the dependencies field in cli/package.standalone.json. We were looking at the latter when pre-installing the CLI's dependencies, but only the former is maintained. This patch adds a script to extract a package.json that encodes up-to-date dependency information. The Makefile then invokes `yarn install` on this synthesized package. This guarantees that the ProtobufJS CLI will see that the correct versions of its dependencies are pre-installed and will not invoke NPM. The resulting diff in pkg/ui/yarn.protobuf-cli.lock reveals that ProtobufJS was installing newer versions of its dependencies without us realizing it. Note that it is now safe to use new versions of jsdoc; the issue mentioned in the Makefile was fixed in jsdoc 3.5.4 (jsdoc/jsdoc#1408). To prevent accidents in the future, a forthcoming commit will remove NPM from the builder image so that CI will fail if ProtobufJS attempts to invoke NPM behind our back. See #27163. Release note: None Co-authored-by: Nikhil Benesch <[email protected]>
We have marked this issue as stale because it has been inactive for |
We have marked this issue as stale because it has been inactive for |
NPM is not a dependency, but PBJS sometimes makes it one: protobufjs/protobuf.js#716
Remove NPM from the builder so it's clear when PBJS is misbehaving and invoking NPM behind our backs.
Epic CRDB-10447
Jira issue: CRDB-4963
The text was updated successfully, but these errors were encountered: