Skip to content

fix: revert buggy chdir simplification#2829

Merged
jbedard merged 4 commits intoaspect-build:mainfrom
acozzette:chdir-fix
May 6, 2026
Merged

fix: revert buggy chdir simplification#2829
jbedard merged 4 commits intoaspect-build:mainfrom
acozzette:chdir-fix

Conversation

@acozzette
Copy link
Copy Markdown
Contributor

Commit 19955f0 tried to simplify the chdir logic in the launcher script, but this introduced a bug in js_test. I believe the logic was correct for js_binary and js_run_binary, since those execute in the target bin directory, but it did not work for js_test, which executes in the runfiles directory. I added a new test case to cover this situation.

Fixes #2827.


Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: yes

Fixes #2827, a bug with chdir on js_test introduced in v3.1.0.

Test plan

  • Covered by existing test cases
  • New test cases added

@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented May 6, 2026

Bazel 7 (Test)

255 test targets passed

Targets
//js/private/devserver:watch_checked_test [k8-fastbuild]                                              62ms
//js/private/test/coverage:pass [k8-fastbuild]                                                        133ms
//js/private/test/data:extract-js_library-srcs2 [k8-fastbuild]                                        79ms
//js/private/test/data:extract-js_run_binary-srcs [k8-fastbuild]                                      33ms
//js/private/test/data:extract-write-js_library-srcs [k8-fastbuild]                                   56ms
//js/private/test/data:from-data [k8-fastbuild]                                                       73ms
//js/private/test/data:from-filegroup-srcs [k8-fastbuild]                                             78ms
//js/private/test/data:from-genrule [k8-fastbuild]                                                    104ms
//js/private/test/data:from-js_library-data [k8-fastbuild]                                            106ms
//js/private/test/data:from-js_run_binary-srcs [k8-fastbuild]                                         97ms
//js/private/test/data:from-parent-genrule [k8-fastbuild]                                             110ms
//js/private/test/data:from-parent-js_library-data [k8-fastbuild]                                     76ms
//js/private/test/data:source-data-execpath [k8-fastbuild]                                            80ms
//js/private/test/data:source-data-rootpath [k8-fastbuild]                                            81ms
//js/private/test/fixed_args:args_test [k8-fastbuild]                                                 117ms
//js/private/test/image/non_ascii:assert_custom_layer_groups_test_app_test [k8-fastbuild]             50ms
//js/private/test/image:assert_custom_layers_nomatch_test_app_test [k8-fastbuild]                     45ms
//js/private/test/image:assert_default_test_app_test [k8-fastbuild]                                   56ms
//js/private/test/image:assert_default_test_node_test [k8-fastbuild]                                  54ms
//js/private/test/image:assert_regex_edge_cases_test_node_modules_test [k8-fastbuild]                 39ms
//js/private/test/image:assert_regex_edge_cases_test_package_store_1p_test [k8-fastbuild]             52ms
//js/private/test/js_binary_sh:BAZEL_BINDIR_test [k8-fastbuild]                                       78ms
//js/private/test/js_binary_sh:BAZEL_BUILD_FILE_PATH_test [k8-fastbuild]                              71ms
//js/private/test/js_binary_sh:BAZEL_TARGET_test [k8-fastbuild]                                       93ms
//js/private/test/js_binary_sh:BAZEL_WORKSPACE_test [k8-fastbuild]                                    95ms
//js/private/test/js_binary_sh:env_json_obj_launcher_escaped [k8-fastbuild]                           83ms
//js/private/test/js_binary_sh:env_json_obj_value [k8-fastbuild]                                      132ms
//js/private/test/js_binary_sh:env_json_str_launcher_escaped [k8-fastbuild]                           97ms
//js/private/test/js_binary_sh:env_json_str_value [k8-fastbuild]                                      67ms
//js/private/test/js_binary_sh:regexy-args-1 [k8-fastbuild]                                           112ms
//js/private/test/js_binary_sh:regexy-args-2 [k8-fastbuild]                                           71ms
//js/private/test/js_run_devserver:js_run_devserver_test [k8-fastbuild]                               139ms
//js/private/test/node-patches:escape_nodejs_test [k8-fastbuild]                                      104ms
//js/private/test/node-patches:lstat_node20_cjs_test [k8-fastbuild]                                   144ms
//js/private/test/node-patches:lstat_node24_cjs_test [k8-fastbuild]                                   187ms
//js/private/test/node-patches:lstat_nodejs_test [k8-fastbuild]                                       173ms
//js/private/test/node-patches:opendir_node20_cjs_test [k8-fastbuild]                                 188ms
//js/private/test/node-patches:opendir_node20_test [k8-fastbuild]                                     151ms
//js/private/test/node-patches:opendir_node22_cjs_test [k8-fastbuild]                                 159ms
//js/private/test/node-patches:opendir_node22_test [k8-fastbuild]                                     194ms
//js/private/test/node-patches:opendir_nodejs_cjs_test [k8-fastbuild]                                 183ms
//js/private/test/node-patches:readdir_node22_test [k8-fastbuild]                                     200ms
//js/private/test/node-patches:readdir_node24_test [k8-fastbuild]                                     196ms
//js/private/test/node-patches:readlink_node20_test [k8-fastbuild]                                    205ms
//js/private/test/node-patches:readlink_node22_test [k8-fastbuild]                                    167ms
//js/private/test/node-patches:readlink_node24_cjs_test [k8-fastbuild]                                180ms
//js/private/test/node-patches:readlink_nodejs_test [k8-fastbuild]                                    169ms
//js/private/test/node-patches:realpath_node20_cjs_test [k8-fastbuild]                                175ms
//js/private/test/node-patches:realpath_nodejs_cjs_test [k8-fastbuild]                                191ms
//js/private/test/node-patches:spawn_test_node22 [k8-fastbuild]                                       724ms
//js/private/test/node-patches:spawn_test_node24 [k8-fastbuild]                                       712ms
//js/private/test/node-patches:spawn_test_nodejs [k8-fastbuild]                                       698ms
//js/private/test/proto:cross_package_dep_fail_test [k8-fastbuild]                                    45ms
//js/private/test:main_toolchain_20 [k8-fastbuild]                                                    80ms
//js/private/test:main_toolchain_22 [k8-fastbuild]                                                    76ms
//js/private/test:main_toolchain_24 [k8-fastbuild]                                                    202ms
//js/private/test:run_environment_info_tests_binary_no_env_test [k8-fastbuild]                        53ms
//js/private/test:run_environment_info_tests_test_both_subject [k8-fastbuild]                         108ms
//js/private/watch:watch_checked_1_test [k8-fastbuild]                                                29ms
//npm/private/lifecycle/min:write_min_test [k8-fastbuild]                                             49ms
//npm/private/test/npm_package:test_pkg_2 [k8-fastbuild]                                              37ms
//npm/private/test/npm_package:test_pkg_5 [k8-fastbuild]                                              96ms
//npm/private/test/npm_package:test_pkg_6 [k8-fastbuild]                                              52ms
//npm/private/test/npm_package:test_pkg_with_node_modules [k8-fastbuild]                              35ms
//npm/private/test/npm_package_publish:test [k8-fastbuild]                                            2s
//npm/private/test:npm_auth_tests_test_1 [k8-fastbuild]                                               34ms
//npm/private/test:npm_auth_tests_test_5 [k8-fastbuild]                                               70ms
//npm/private/test:test_generated_pkg_json___rollup-target__entry_point_tagged_manual [k8-fastbuild]  41ms
//npm/private/test:test_generated_pkg_json___rollup-target__js_binary_tagged_manual [k8-fastbuild]    62ms
//npm/private/test:test_generated_pkg_json___rollup-target_js_info_files_tagged_manual [k8-fastbuild] 32ms
//npm/private/test:test_generated_pkg_json_only_expected_properties [k8-fastbuild]                    32ms
//npm/private/test:test_npm_package_visibility_test_2 [k8-fastbuild]                                  63ms
//npm/private/test:test_npm_package_visibility_test_4 [k8-fastbuild]                                  35ms
//npm/private/test:test_npm_package_visibility_test_8 [k8-fastbuild]                                  36ms
//npm/private/test:test_npmrc_test_0 [k8-fastbuild]                                                   84ms
//npm/private/test:test_npmrc_test_2 [k8-fastbuild]                                                   34ms
//npm/private/test:test_npmrc_test_3 [k8-fastbuild]                                                   29ms
//npm/private/test:test_npmrc_test_4 [k8-fastbuild]                                                   55ms
//npm/private/test:test_npmrc_test_5 [k8-fastbuild]                                                   31ms
//npm/private/test:test_npmrc_test_6 [k8-fastbuild]                                                   59ms
//npm/private/test:test_npmrc_test_7 [k8-fastbuild]                                                   107ms
//npm/private/test:test_pnpm_test_0 [k8-fastbuild]                                                    34ms
//npm/private/test:test_pnpm_test_1 [k8-fastbuild]                                                    46ms
//npm/private/test:test_pnpm_test_6 [k8-fastbuild]                                                    56ms
//npm/private/test:test_pnpm_test_8 [k8-fastbuild]                                                    84ms
//npm/private/test:test_pnpm_test_9 [k8-fastbuild]                                                    27ms
//npm/private/test:test_transitive_closure_test_0 [k8-fastbuild]                                      46ms
//npm/private/test:test_translate_lock_test_0 [k8-fastbuild]                                          67ms
//npm/private/test:test_translate_lock_test_1 [k8-fastbuild]                                          54ms
//npm/private/test:test_utils_test_0 [k8-fastbuild]                                                   104ms
//npm/private/test:test_utils_test_1 [k8-fastbuild]                                                   35ms
//npm/private/test:test_utils_test_2 [k8-fastbuild]                                                   58ms
//npm/private/test:write_npm_translate_lock_0_test [k8-fastbuild]                                     77ms
//npm/private/test:write_npm_translate_lock_1_test [k8-fastbuild]                                     140ms
//npm/private/test:write_npm_translate_lock_4_test [k8-fastbuild]                                     101ms
//npm/private/test:write_npm_translate_lock_5_test [k8-fastbuild]                                     117ms
//npm/private/test:write_npm_translate_lock_6_test [k8-fastbuild]                                     95ms
//npm/private/test:write_npm_translate_lock_7_test [k8-fastbuild]                                     108ms
//npm/private/test:write_npm_translate_lock_8_test [k8-fastbuild]                                     91ms
//npm/private/test:write_npm_translate_lock_9_test [k8-fastbuild]                                     87ms
+ 155 other targets

Bazel 8 (Test)

Buildkite build #12642 is running...


Bazel 9 (Test)

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/bzlmod

7 test targets passed

Targets
//:check_styles [k8-fastbuild]                                                                        85ms
//:jasmine_test [k8-fastbuild]                                                                        138ms
//:node_modules_test [k8-fastbuild]                                                                   27ms
//:other_module_binary_test [k8-fastbuild]                                                            41ms
//:other_module_linked_packages [k8-fastbuild]                                                        36ms
//:other_module_run_binary_test [k8-fastbuild]                                                        27ms
//:test [k8-fastbuild]                                                                                80ms

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

1 test target passed

Targets
//:no_git_metadata_test                                                                               21ms

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

2 test targets passed

Targets
//:test [k8-fastbuild]                                                                                51ms
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]                                                40ms

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

4 test targets passed

Targets
//:js_run_binary_chdir_test [k8-fastbuild]                                                            40ms
//:test [k8-fastbuild]                                                                                36ms
@@workspace~//:js_binary_chdir_test [k8-fastbuild]                                                    48ms
@@workspace~//:js_test_chdir_test [k8-fastbuild]                                                      112ms

Bazel 8 (Test)

e2e/js_binary_workspace

All tests were cache hits

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


Bazel 9 (Test)

e2e/js_binary_workspace

All tests were cache hits

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


Bazel 7 (Test)

e2e/js_image_oci

1 test target passed

Targets
//src:image_test [k8-fastbuild]                                                                       4s

Bazel 7 (Test)

e2e/nextjs

3 test targets passed

Targets
//v15/cjs:test [k8-fastbuild]                                                                         28ms
//v15/esm:test [k8-fastbuild]                                                                         32ms
//v15/mjs:test [k8-fastbuild]                                                                         46ms

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

4 test targets passed

Targets
//cjs/src:test [k8-fastbuild]                                                                         175ms
//cjs:package_store_targets_test [k8-fastbuild]                                                       29ms
//esm/src:test [k8-fastbuild]                                                                         187ms
//esm:package_store_targets_test [k8-fastbuild]                                                       37ms

Bazel 8 (Test)

e2e/npm_link_package

All tests were cache hits

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


Bazel 9 (Test)

e2e/npm_link_package

All tests were cache hits

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


Bazel 7 (Test)

e2e/npm_link_package-rerooted

2 test targets passed

Targets
//root/src:test [k8-fastbuild]                                                                        112ms
//root:package_store_targets_test [k8-fastbuild]                                                      64ms

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

3 test targets passed

Targets
//:test                                                                                               40ms
//:test_dev_filtering                                                                                 132ms
//:test_prod_filtering                                                                                141ms

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

3 test targets passed

Targets
//:test [k8-fastbuild]                                                                                26ms
//:write_npm_translate_lock_defs_0_test [k8-fastbuild]                                                63ms
//:write_npm_translate_lock_defs_1_test [k8-fastbuild]                                                71ms

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

2 test targets passed

Targets
//:test [k8-fastbuild]                                                                                28ms
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]                                                42ms

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

1 test target passed

Targets
//:test_sh                                                                                            29ms

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

2 test targets passed

Targets
//app1:test                                                                                           35ms
//app2:test                                                                                           38ms

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

1 test target passed

Targets
//root:test                                                                                           21ms

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

4 test targets passed

Targets
//:node_modules_test [k8-fastbuild]                                                                   64ms
//:test [k8-fastbuild]                                                                                85ms
//:utils_test [k8-fastbuild]                                                                          65ms
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]                                                38ms

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

1 test target passed

Targets
//subdir:test                                                                                         61ms

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

1 test target passed

Targets
//:test                                                                                               17ms

Bazel 8 (Test)

e2e/npm_translate_package_lock

All tests were cache hits

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


Bazel 9 (Test)

e2e/npm_translate_package_lock

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/npm_translate_yarn_lock

Buildkite build #12642 is running...


Bazel 8 (Test)

e2e/npm_translate_yarn_lock

Buildkite build #12642 is running...


Bazel 9 (Test)

e2e/npm_translate_yarn_lock

All tests were cache hits

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


Bazel 7 (Test)

e2e/output_paths

Waiting for runner...


Bazel 8 (Test)

e2e/output_paths

Waiting for runner...


Bazel 9 (Test)

e2e/output_paths

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/patch_from_repo

1 test target passed

Targets
//:test                                                                                               22ms

Bazel 7 (Test)

e2e/pnpm_lockfiles

Buildkite build #12642 is running...


Bazel 8 (Test)

e2e/pnpm_lockfiles

Buildkite build #12642 is running...


Bazel 9 (Test)

e2e/pnpm_lockfiles

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/pnpm_repo_install

Buildkite build #12642 is running...


Bazel 8 (Test)

e2e/pnpm_repo_install

All tests were cache hits

3 tests (100.0%) were fully cached saving 5s.


Bazel 9 (Test)

e2e/pnpm_repo_install

All tests were cache hits

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


Bazel 7 (Test)

e2e/pnpm_version

Buildkite build #12642 is running...


Bazel 8 (Test)

e2e/pnpm_version

Buildkite build #12642 is running...


Bazel 9 (Test)

e2e/pnpm_version

All tests were cache hits

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


Bazel 7 (Test)

e2e/pnpm_workspace

Buildkite build #12642 is running...


Bazel 8 (Test)

e2e/pnpm_workspace

Buildkite build #12642 is running...


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 #12642 is running...


Bazel 8 (Test)

e2e/pnpm_workspace_deps

Buildkite build #12642 is running...


Bazel 9 (Test)

e2e/pnpm_workspace_deps

All tests were cache hits

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


Bazel 7 (Test)

e2e/pnpm_workspace_rerooted

All tests were cache hits

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


Bazel 8 (Test)

e2e/pnpm_workspace_rerooted

Buildkite build #12642 is running...


Bazel 9 (Test)

e2e/pnpm_workspace_rerooted

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/protobuf-es

Buildkite build #12642 is running...


Bazel 8 (Test)

e2e/protobuf-es

Buildkite build #12642 is running...


Bazel 9 (Test)

e2e/protobuf-es

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/protobuf-google

2 test targets passed

Targets
//:test [k8-fastbuild]                                                                                88ms
//:test_grpc [k8-fastbuild]                                                                           209ms

Bazel 8 (Test)

e2e/protobuf-google

All tests were cache hits

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


Bazel 9 (Test)

e2e/protobuf-google

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/repo_mapping

Buildkite build #12642 is running...


Bazel 8 (Test)

e2e/repo_mapping

Buildkite build #12642 is running...


Bazel 9 (Test)

e2e/repo_mapping

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/vendored_node

Waiting for runner...


Bazel 8 (Test)

e2e/vendored_node

Waiting for runner...


Bazel 9 (Test)

e2e/vendored_node

Buildkite build #12642 is running...


Bazel 7 (Test)

e2e/vendored_tarfile

1 test target passed

Targets
//:test                                                                                               20ms

Bazel 8 (Test)

e2e/vendored_tarfile

Waiting for runner...


Bazel 9 (Test)

e2e/vendored_tarfile

Waiting for runner...


Bazel 7 (Test)

e2e/verify_patches

Waiting for runner...


Bazel 8 (Test)

e2e/verify_patches

Waiting for runner...


Bazel 9 (Test)

e2e/verify_patches

Buildkite build #12642 is running...


Bazel 7 (Test)

examples

83 test targets passed

Targets
//:linked_packages_build_test [k8-fastbuild]                                                          59ms
//coverage:coverage [k8-fastbuild]                                                                    83ms
//genrule:test_acorn [k8-fastbuild]                                                                   52ms
//genrule:test_require_acorn [k8-fastbuild]                                                           42ms
//js_binary:aspect_bin_a_test [k8-fastbuild]                                                          106ms
//js_binary:case7_test [k8-fastbuild]                                                                 128ms
//js_binary:npm_version_test [k8-fastbuild]                                                           362ms
//js_binary:test13-1_cjs [k8-fastbuild]                                                               39ms
//js_binary:test13-1_mjs [k8-fastbuild]                                                               94ms
//js_binary:test13-2_cjs [k8-fastbuild]                                                               42ms
//js_binary:test13-2_mjs [k8-fastbuild]                                                               95ms
//js_binary:test4-b_cjs [k8-fastbuild]                                                                41ms
//js_binary:test4-b_mjs [k8-fastbuild]                                                                59ms
//js_binary:test4-cjs-a [k8-fastbuild]                                                                38ms
//js_binary:test4-mjs-a [k8-fastbuild]                                                                54ms
//js_binary:test5_cjs [k8-fastbuild]                                                                  42ms
//js_binary:test5_mjs [k8-fastbuild]                                                                  36ms
//js_binary:test6 [k8-fastbuild]                                                                      49ms
//js_binary:test6_alt [k8-fastbuild]                                                                  55ms
//js_binary:test8 [k8-fastbuild]                                                                      66ms
//js_binary:test_cjs [k8-fastbuild]                                                                   99ms
//js_binary:test_exitcode [k8-fastbuild]                                                              60ms
//js_binary:test_js_binary_under_custom_rule [k8-fastbuild]                                           55ms
//js_binary:test_js_binary_under_custom_rule_local [k8-fastbuild]                                     49ms
//js_binary:test_js_binary_under_genrule_cjs [k8-fastbuild]                                           48ms
//js_binary:test_js_binary_under_genrule_mjs [k8-fastbuild]                                           50ms
//js_binary:test_js_binary_under_js_run_binary_cjs [k8-fastbuild]                                     61ms
//js_binary:test_js_binary_under_js_run_binary_local_cjs [k8-fastbuild]                               51ms
//js_binary:test_js_binary_under_js_run_binary_local_mjs [k8-fastbuild]                               37ms
//js_binary:test_js_binary_under_js_run_binary_mjs [k8-fastbuild]                                     54ms
//js_binary:test_js_binary_under_js_run_binary_no_copy_data_to_bin [k8-fastbuild]                     41ms
//js_binary:test_mjs [k8-fastbuild]                                                                   106ms
//js_binary:test_stderr [k8-fastbuild]                                                                49ms
//js_binary:test_stdout [k8-fastbuild]                                                                52ms
//js_lib_pkg/b:test_each_target [k8-fastbuild]                                                        121ms
//js_lib_pkg/b:test_parent_target [k8-fastbuild]                                                      108ms
//js_library/two:two_test [k8-fastbuild]                                                              103ms
//linked_consumer:direct [k8-fastbuild]                                                               133ms
//linked_consumer:pkg [k8-fastbuild]                                                                  108ms
//linked_consumer:sources_test [k8-fastbuild]                                                         41ms
//linked_consumer:types_test [k8-fastbuild]                                                           59ms
//linked_empty_node_modules:test [k8-fastbuild]                                                       48ms
//macro:test_all [k8-fastbuild]                                                                       461ms
//macro:test_cjs [k8-fastbuild]                                                                       869ms
//macro:test_esm [k8-fastbuild]                                                                       473ms
//macro:test_js [k8-fastbuild]                                                                        463ms
//nextjs:next_build_test [k8-fastbuild]                                                               43ms
//nextjs:write_next_links_defs_test [k8-fastbuild]                                                    97ms
//npm_deps/patches:patches_update_test [k8-fastbuild]                                                 90ms
//npm_deps:circular_deps_build_test [k8-fastbuild]                                                    92ms
//npm_deps:rollup_version_test [k8-fastbuild]                                                         200ms
//npm_deps:test1 [k8-fastbuild]                                                                       63ms
//npm_deps:test10_cjs [k8-fastbuild]                                                                  137ms
//npm_deps:test10_mjs [k8-fastbuild]                                                                  166ms
//npm_deps:test11_cjs [k8-fastbuild]                                                                  153ms
//npm_deps:test11_mjs [k8-fastbuild]                                                                  141ms
//npm_deps:test3 [k8-fastbuild]                                                                       144ms
//npm_deps:test4 [k8-fastbuild]                                                                       102ms
//npm_deps:test5 [k8-fastbuild]                                                                       43ms
//npm_deps:test5_alt [k8-fastbuild]                                                                   53ms
//npm_deps:test6 [k8-fastbuild]                                                                       98ms
//npm_deps:test7_a [k8-fastbuild]                                                                     159ms
//npm_deps:test7_b_cjs [k8-fastbuild]                                                                 136ms
//npm_deps:test7_b_mjs [k8-fastbuild]                                                                 141ms
//npm_deps:test8 [k8-fastbuild]                                                                       90ms
//npm_deps:test9_cjs [k8-fastbuild]                                                                   163ms
//npm_deps:test9_mjs [k8-fastbuild]                                                                   195ms
//npm_deps:test_peer [k8-fastbuild]                                                                   134ms
//npm_deps:test_uvu_version [k8-fastbuild]                                                            217ms
//package_json_module:test [k8-fastbuild]                                                             435ms
//runfiles:module_name_runfiles [k8-fastbuild]                                                        133ms
//runfiles:outer_runfiles [k8-fastbuild]                                                              228ms
//runfiles:run_outer_binary_asserts__direct_srcs [k8-fastbuild]                                       75ms
//runfiles:run_outer_binary_asserts__transitive_data [k8-fastbuild]                                   125ms
//runfiles:run_test_binary_asserts__direct_srcs [k8-fastbuild]                                        122ms
//runfiles:run_test_binary_asserts__transitive_data [k8-fastbuild]                                    74ms
//runfiles:runfiles [k8-fastbuild]                                                                    95ms
//stack_traces:stack_traces [k8-fastbuild]                                                            168ms
//stamped_package_json:stamp_test [k8-fastbuild]                                                      76ms
//vite3:build_test [k8-fastbuild]                                                                     30ms
//vite6:build_test [k8-fastbuild]                                                                     36ms
//webpack_cli:test [k8-fastbuild]                                                                     333ms
//worker:test_pi [k8-fastbuild]                                                                       101ms

Bazel 8 (Test)

examples

All tests were cache hits

81 tests (100.0%) were fully cached saving 11s.


Bazel 9 (Test)

examples

All tests were cache hits

81 tests (100.0%) were fully cached saving 12s.


Buildifier      Format

@acozzette acozzette marked this pull request as ready for review May 6, 2026 15:42
@acozzette acozzette requested a review from jbedard May 6, 2026 15:43
@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

*) cd "$JS_BINARY__CHDIR" ;;

P2 Badge Resolve package chdir from the child runfiles root

When a js_binary with chdir = package_name() is launched as a subprocess from another js_binary/js_test whose cwd has already been changed (for example the parent also uses chdir), this relative cd is evaluated against the inherited parent cwd, not against the child binary's runfiles workspace. The launcher only computes the child's RUNFILES from $0; it does not reset PWD before this point, so nested binaries with a package chdir can fail to start or run in the wrong package even though the path exists in the child's runfiles/bin tree.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@jbedard jbedard merged commit 9f3c410 into aspect-build:main May 6, 2026
16 checks passed
@acozzette acozzette deleted the chdir-fix branch May 6, 2026 16:42
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]: Upgrading from 3.0.3 to 3.1.0 breaks tests due to chdir changes

2 participants