Skip to content

Conversation

@sallustfire
Copy link

@sallustfire sallustfire commented Nov 8, 2025

The bazel-sandbox plugin throws errors when esbuild resolves external paths (marked via the external attribute), even though these paths are intentionally excluded from bundling and don't need to exist in the Bazel sandbox.

This change adds a check for result.external (https://esbuild.github.io/api/#external) before path validation, allowing external modules to bypass sandbox checks while maintaining security for bundled modules.

Fixes #245

Changes are visible to end-users: yes

  • Suggested release notes appear below:

A bug is fixed where files that are marked as external by esbuild are subjected to the bazel sandbox plugin path rules and rejected.

Test plan

  • Covered by existing test cases that verify no regressions

…ugin

The bazel-sandbox plugin throws errors when esbuild resolves external
paths (marked via the external attribute), even though these paths are
intentionally excluded from bundling and don't need to exist in the Bazel
sandbox.

This change adds a check for result.external (https://esbuild.github.io/api/#external)
before path validation, allowing external modules to bypass sandbox checks
while maintaining security for bundled modules.
@aspect-workflows
Copy link

aspect-workflows bot commented Nov 8, 2025

Test (Bazel 7) (Test)

All tests were cache hits

18 tests (100.0%) were fully cached saving 1s.


Test (Bazel 8) (Test)

All tests were cache hits

18 tests (100.0%) were fully cached saving 849ms.


Test (Bazel 7) (Test)

e2e/bundle

All tests were cache hits

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


Test (Bazel 8) (Test)

e2e/bundle

All tests were cache hits

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


Test (Bazel 7) (Test)

e2e/custom_version

All tests were cache hits

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


Test (Bazel 8) (Test)

e2e/custom_version

All tests were cache hits

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


Test (Bazel 7) (Test)

e2e/npm-links

All tests were cache hits

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


Test (Bazel 8) (Test)

e2e/npm-links

All tests were cache hits

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


Test (Bazel 7) (Test)

e2e/smoke

All tests were cache hits

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


Test (Bazel 8) (Test)

e2e/smoke

All tests were cache hits

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


Test (Bazel 7) (Test)

e2e/sourcemaps

All tests were cache hits

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


Test (Bazel 8) (Test)

e2e/sourcemaps

All tests were cache hits

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


Test (Bazel 7) (Test)

e2e/toolchain_from_source

All tests were cache hits


Test (Bazel 8) (Test)

e2e/toolchain_from_source

All tests were cache hits


Test (Bazel 7) (Test)

e2e/tsconfig

All tests were cache hits

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


Test (Bazel 8) (Test)

e2e/tsconfig

All tests were cache hits

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


Buildifier

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.

[Bug]: Explicit external paths are marked as outside the sandbox

1 participant