Skip to content

Demonstration of odd behavior with deps#2804

Draft
tyler-breisacher-zipline wants to merge 2 commits into
aspect-build:mainfrom
tyler-breisacher-zipline:sentry
Draft

Demonstration of odd behavior with deps#2804
tyler-breisacher-zipline wants to merge 2 commits into
aspect-build:mainfrom
tyler-breisacher-zipline:sentry

Conversation

@tyler-breisacher-zipline
Copy link
Copy Markdown
Contributor

@tyler-breisacher-zipline tyler-breisacher-zipline commented Apr 15, 2026

At tyler-breisacher-zipline@4e59a57 (first commit in this branch) I added @sentry/nextjs as a dependency. The bazel target for that package does not depend on esbuild: bazel query "deps(//examples/nextjs:node_modules/@sentry/nextjs)" | grep esbuild returns no results.

But then in tyler-breisacher-zipline@98c5145 (second commit) I also added storybook, and then the same bazel query shows that we do depend on esbuild.

@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented Apr 15, 2026

Bazel 7 (Test)

⚠️ Buildkite build #12535 failed.

@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//:defs.bzl failed to build

no such package '@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//': The repository
'@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]' could not be resolved: No
repository visible as '@npm__next__15.2.6_1642820312__links' from main repository
no such package '@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//': The repository
'@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]' could not be resolved: No
repository visible as '@npm__next__15.2.6_1642820312__links' from main repository
Failed tests (3)
//npm/private/test:write_npm_translate_lock_0_test [k8-fastbuild] 🔗
//npm/private/test:write_npm_translate_lock_1_test [k8-fastbuild] 🔗
//npm/private/test:write_npm_translate_lock_2_test [k8-fastbuild] 🔗

💡 To reproduce the build failures, run

bazel build @@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//:defs.bzl

💡 To reproduce the test failures, run

bazel test //npm/private/test:write_npm_translate_lock_2_test //npm/private/test:write_npm_translate_lock_1_test //npm/private/test:write_npm_translate_lock_0_test

Bazel 8 (Test)

⚠️ Buildkite build #12535 failed.

@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//:defs.bzl failed to build

no such package '@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//': The repository
'@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]' could not be resolved: No
repository visible as '@npm__next__15.2.6_1642820312__links' from main repository
no such package '@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//': The repository
'@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]' could not be resolved: No
repository visible as '@npm__next__15.2.6_1642820312__links' from main repository

💡 To reproduce the build failures, run

bazel build @@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//:defs.bzl

Bazel 9 (Test)

⚠️ Buildkite build #12535 failed.

@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//:defs.bzl failed to build

no such package '@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//': The repository
'@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]' could not be resolved: No
repository visible as '@npm__next__15.2.6_1642820312__links' from main repository
no such package '@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//': The repository
'@@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]' could not be resolved: No
repository visible as '@npm__next__15.2.6_1642820312__links' from main repository

💡 To reproduce the build failures, run

bazel build @@[unknown repo 'npm__next__15.2.6_1642820312__links' requested from @@]//:defs.bzl

Bazel 7 (Test)

e2e/bzlmod

All tests were cache hits

7 tests (100.0%) were fully cached saving 664ms.


Bazel 8 (Test)

e2e/bzlmod

All tests were cache hits

7 tests (100.0%) were fully cached saving 642ms.


Bazel 9 (Test)

e2e/bzlmod

All tests were cache hits

7 tests (100.0%) were fully cached saving 596ms.


Bazel 7 (Test)

e2e/git_dep_metadata

All tests were cache hits

1 test (100.0%) was fully cached saving 30ms.


Bazel 8 (Test)

e2e/git_dep_metadata

All tests were cache hits

1 test (100.0%) was fully cached saving 26ms.


Bazel 9 (Test)

e2e/git_dep_metadata

All tests were cache hits

1 test (100.0%) was fully cached saving 30ms.


Bazel 7 (Test)

e2e/gyp_no_install_script

All tests were cache hits

2 tests (100.0%) were fully cached saving 112ms.


Bazel 8 (Test)

e2e/gyp_no_install_script

All tests were cache hits

1 test (100.0%) was fully cached saving 50ms.


Bazel 9 (Test)

e2e/gyp_no_install_script

All tests were cache hits

1 test (100.0%) was fully cached saving 46ms.


Bazel 7 (Test)

e2e/js_binary_workspace

All tests were cache hits

1 test (100.0%) was fully cached saving 44ms.


Bazel 8 (Test)

e2e/js_binary_workspace

All tests were cache hits

1 test (100.0%) was fully cached saving 30ms.


Bazel 9 (Test)

e2e/js_binary_workspace

All tests were cache hits

1 test (100.0%) was fully cached saving 35ms.


Bazel 7 (Test)

e2e/js_image_oci

All tests were cache hits

1 test (100.0%) was fully cached saving 3s.


Bazel 7 (Test)

e2e/nextjs

All tests were cache hits

3 tests (100.0%) were fully cached saving 165ms.


Bazel 8 (Test)

e2e/nextjs

All tests were cache hits

3 tests (100.0%) were fully cached saving 94ms.


Bazel 9 (Test)

e2e/nextjs

All tests were cache hits

3 tests (100.0%) were fully cached saving 112ms.


Bazel 7 (Test)

e2e/npm_link_package

All tests were cache hits

2 tests (100.0%) were fully cached saving 172ms.


Bazel 8 (Test)

e2e/npm_link_package

All tests were cache hits

2 tests (100.0%) were fully cached saving 137ms.


Bazel 9 (Test)

e2e/npm_link_package

All tests were cache hits

2 tests (100.0%) were fully cached saving 170ms.


Bazel 7 (Test)

e2e/npm_link_package-esm

All tests were cache hits

2 tests (100.0%) were fully cached saving 189ms.


Bazel 8 (Test)

e2e/npm_link_package-esm

All tests were cache hits

2 tests (100.0%) were fully cached saving 138ms.


Bazel 9 (Test)

e2e/npm_link_package-esm

All tests were cache hits

2 tests (100.0%) were fully cached saving 173ms.


Bazel 7 (Test)

e2e/npm_link_package-rerooted

All tests were cache hits

2 tests (100.0%) were fully cached saving 207ms.


Bazel 8 (Test)

e2e/npm_link_package-rerooted

All tests were cache hits

2 tests (100.0%) were fully cached saving 139ms.


Bazel 9 (Test)

e2e/npm_link_package-rerooted

All tests were cache hits

2 tests (100.0%) were fully cached saving 186ms.


Bazel 7 (Test)

e2e/npm_translate_lock

All tests were cache hits

3 tests (100.0%) were fully cached saving 383ms.


Bazel 8 (Test)

e2e/npm_translate_lock

All tests were cache hits

3 tests (100.0%) were fully cached saving 287ms.


Bazel 9 (Test)

e2e/npm_translate_lock

All tests were cache hits

3 tests (100.0%) were fully cached saving 289ms.


Bazel 7 (Test)

e2e/npm_translate_lock_disable_hooks

All tests were cache hits

3 tests (100.0%) were fully cached saving 268ms.


Bazel 8 (Test)

e2e/npm_translate_lock_disable_hooks

All tests were cache hits

1 test (100.0%) was fully cached saving 62ms.


Bazel 9 (Test)

e2e/npm_translate_lock_disable_hooks

All tests were cache hits

1 test (100.0%) was fully cached saving 32ms.


Bazel 7 (Test)

e2e/npm_translate_lock_empty

All tests were cache hits

2 tests (100.0%) were fully cached saving 132ms.


Bazel 8 (Test)

e2e/npm_translate_lock_empty

All tests were cache hits

2 tests (100.0%) were fully cached saving 114ms.


Bazel 9 (Test)

e2e/npm_translate_lock_empty

All tests were cache hits

2 tests (100.0%) were fully cached saving 105ms.


Bazel 7 (Test)

e2e/npm_translate_lock_exclude_package_contents

All tests were cache hits

1 test (100.0%) was fully cached saving 33ms.


Bazel 8 (Test)

e2e/npm_translate_lock_exclude_package_contents

All tests were cache hits

1 test (100.0%) was fully cached saving 21ms.


Bazel 9 (Test)

e2e/npm_translate_lock_exclude_package_contents

All tests were cache hits

1 test (100.0%) was fully cached saving 86ms.


Bazel 7 (Test)

e2e/npm_translate_lock_multi

All tests were cache hits

2 tests (100.0%) were fully cached saving 106ms.


Bazel 8 (Test)

e2e/npm_translate_lock_multi

All tests were cache hits

2 tests (100.0%) were fully cached saving 54ms.


Bazel 9 (Test)

e2e/npm_translate_lock_multi

All tests were cache hits

2 tests (100.0%) were fully cached saving 113ms.


Bazel 7 (Test)

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 26ms.


Bazel 8 (Test)

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 30ms.


Bazel 9 (Test)

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 38ms.


Bazel 7 (Test)

e2e/npm_translate_lock_replace_packages

All tests were cache hits

4 tests (100.0%) were fully cached saving 321ms.


Bazel 8 (Test)

e2e/npm_translate_lock_replace_packages

All tests were cache hits

4 tests (100.0%) were fully cached saving 249ms.


Bazel 9 (Test)

e2e/npm_translate_lock_replace_packages

All tests were cache hits

4 tests (100.0%) were fully cached saving 320ms.


Bazel 7 (Test)

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 50ms.


Bazel 8 (Test)

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 67ms.


Bazel 9 (Test)

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 50ms.


Bazel 7 (Test)

e2e/npm_translate_package_lock

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/npm_translate_package_lock

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/npm_translate_package_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 32ms.


Bazel 7 (Test)

e2e/npm_translate_yarn_lock

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/npm_translate_yarn_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 62ms.


Bazel 9 (Test)

e2e/npm_translate_yarn_lock

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/output_paths

All tests were cache hits

2 tests (100.0%) were fully cached saving 213ms.


Bazel 8 (Test)

e2e/output_paths

All tests were cache hits

2 tests (100.0%) were fully cached saving 252ms.


Bazel 9 (Test)

e2e/output_paths

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/package_json_module

All tests were cache hits

1 test (100.0%) was fully cached saving 195ms.


Bazel 8 (Test)

e2e/package_json_module

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/package_json_module

All tests were cache hits

1 test (100.0%) was fully cached saving 190ms.


Bazel 7 (Test)

e2e/patch_from_repo

All tests were cache hits

1 test (100.0%) was fully cached saving 25ms.


Bazel 7 (Test)

e2e/pnpm_lockfiles

All tests were cache hits

41 tests (100.0%) were fully cached saving 4s.


Bazel 8 (Test)

e2e/pnpm_lockfiles

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/pnpm_lockfiles

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/pnpm_repo_install

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/pnpm_repo_install

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/pnpm_repo_install

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/pnpm_version

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/pnpm_version

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/pnpm_version

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/pnpm_workspace

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/pnpm_workspace

All tests were cache hits

14 tests (100.0%) were fully cached saving 2s.


Bazel 9 (Test)

e2e/pnpm_workspace

All tests were cache hits

14 tests (100.0%) were fully cached saving 2s.


Bazel 7 (Test)

e2e/pnpm_workspace_deps

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/pnpm_workspace_deps

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/pnpm_workspace_deps

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/pnpm_workspace_rerooted

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/pnpm_workspace_rerooted

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/pnpm_workspace_rerooted

All tests were cache hits

14 tests (100.0%) were fully cached saving 2s.


Bazel 7 (Test)

e2e/repo_mapping

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/repo_mapping

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/repo_mapping

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/runfiles

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/runfiles

Buildkite build #12535 is running...


Bazel 9 (Test)

e2e/runfiles

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/stamped_package_json

Buildkite build #12535 is running...


Bazel 8 (Test)

e2e/stamped_package_json

All tests were cache hits

1 test (100.0%) was fully cached saving 24ms.


Bazel 9 (Test)

e2e/stamped_package_json

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/vendored_node

All tests were cache hits

1 test (100.0%) was fully cached saving 61ms.


Bazel 8 (Test)

e2e/vendored_node

Waiting for runner...


Bazel 9 (Test)

e2e/vendored_node

Waiting for runner...


Bazel 7 (Test)

e2e/vendored_tarfile

Waiting for runner...


Bazel 8 (Test)

e2e/vendored_tarfile

All tests were cache hits

1 test (100.0%) was fully cached saving 62ms.


Bazel 9 (Test)

e2e/vendored_tarfile

All tests were cache hits

1 test (100.0%) was fully cached saving 32ms.


Bazel 7 (Test)

e2e/verify_patches

All tests were cache hits

2 tests (100.0%) were fully cached saving 92ms.


Bazel 8 (Test)

e2e/verify_patches

All tests were cache hits

2 tests (100.0%) were fully cached saving 120ms.


Bazel 9 (Test)

e2e/verify_patches

Buildkite build #12535 is running...


Bazel 7 (Test)

e2e/worker

All tests were cache hits

1 test (100.0%) was fully cached saving 75ms.


Bazel 8 (Test)

e2e/worker

All tests were cache hits

1 test (100.0%) was fully cached saving 50ms.


Bazel 9 (Test)

e2e/worker

Buildkite build #12535 is running...


Bazel 7 (Test)

examples/protobuf/bufbuild-es

Buildkite build #12535 is running...


Bazel 8 (Test)

examples/protobuf/bufbuild-es

All tests were cache hits

1 test (100.0%) was fully cached saving 132ms.


Bazel 9 (Test)

examples/protobuf/bufbuild-es

All tests were cache hits

1 test (100.0%) was fully cached saving 116ms.


Bazel 7 (Test)

examples/protobuf/google-protobuf

All tests were cache hits

1 test (100.0%) was fully cached saving 97ms.


Bazel 8 (Test)

examples/protobuf/google-protobuf

All tests were cache hits

1 test (100.0%) was fully cached saving 64ms.


Bazel 9 (Test)

examples/protobuf/google-protobuf

Buildkite build #12535 is running...


Buildifier      Format

@jbedard
Copy link
Copy Markdown
Member

jbedard commented Apr 16, 2026

Can you create an isolated pnpm-lock that reproduces this with the absolute minimum deps? This seems like a pnpm issue (adding one package causes the deps of another package to change) really, but seeing it in isolation will make that easier to under.

@tyler-breisacher-zipline
Copy link
Copy Markdown
Contributor Author

Here's what I have so far but to understand what's happening you kind of have to trace through a bunch of packages (storybook, webpack, terser-webpack-plugin...) so I'm going to try to simplify it more. The crux of it seems to be that terser-webpack-plugin has an optional dep on esbuild, but pnpm decides to create two different snapshots of it, one without esbuild, and one with (lines 3488 and 3498 of the lock file)

@jbedard
Copy link
Copy Markdown
Member

jbedard commented Apr 18, 2026

That seems to confirm that this is mainly a npm/pnpm usability issue? When you reach this level of peer+optional deps it can get quite complicated, but I think rules_js is just respecting the lockfile?

@tyler-breisacher-zipline
Copy link
Copy Markdown
Contributor Author

I agree, I don't think this is a bug in rules_js, and maybe not really a bug in pnpm, but it's a surprising behavior in both that I would like to understand better, especially if it turns out to be the cause of some of our ts_project() targets being slow.

@jbedard
Copy link
Copy Markdown
Member

jbedard commented Apr 19, 2026

It might be worth putting into troubleshooting.md or something like that, if we can provide a simple example and solution of the problem(s). A section titled something such as "slow builds due to unnecessary (transitive) npm deps" with an explanation and possible workarounds...?

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