Skip to content

test: add an example of how to invoke Rspack#2846

Open
acozzette wants to merge 7 commits into
aspect-build:mainfrom
acozzette:rspack-example
Open

test: add an example of how to invoke Rspack#2846
acozzette wants to merge 7 commits into
aspect-build:mainfrom
acozzette:rspack-example

Conversation

@acozzette
Copy link
Copy Markdown
Contributor

This example started out as a test case by @jbedard and @nickschaap showing how js_run_binary can sometimes fail to work correctly when the execution and target platforms are different.

I was able to get it working, primarily by setting use_execroot_entry_point = False. The problem with the default behavior (use_execroot_entry_point = True) is that it runs target-platform sources during the build action, which can go haywire if the target platform is meaningfully different from the execution platform.

Getting all the sources in the right place and built for the right platform is not entirely straightforward, so I thought it would be good to have a simple example showing this. I added a lot of comments trying to explain why everything is set up the way it is.


Changes are visible to end-users: no

Test plan

  • New test cases added

@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented May 15, 2026

Bazel 7 (Test)

257 test targets passed

Targets
//:node_modules_build_test [k8-fastbuild]                                                                40ms
//:npm_link_targets_node_modules_build_test [k8-fastbuild]                                               52ms
//js/private/node-patches:checked_in_compile_test [k8-fastbuild]                                         53ms
//js/private/test/coverage:fail [k8-fastbuild]                                                           70ms
//js/private/test/data:chdir-source-data-relative [k8-fastbuild]                                         86ms
//js/private/test/data:extract-js_library-srcs-data [k8-fastbuild]                                       57ms
//js/private/test/data:from-data [k8-fastbuild]                                                          88ms
//js/private/test/data:from-filegroup-srcs [k8-fastbuild]                                                70ms
//js/private/test/data:from-genrule [k8-fastbuild]                                                       72ms
//js/private/test/data:from-js_library-data [k8-fastbuild]                                               74ms
//js/private/test/data:from-js_run_binary-genrule-copied [k8-fastbuild]                                  108ms
//js/private/test/fixed_args:args_test [k8-fastbuild]                                                    86ms
//js/private/test/fixed_args:fixed_args_test [k8-fastbuild]                                              136ms
//js/private/test/fixed_args:locations_test [k8-fastbuild]                                               98ms
//js/private/test/fixed_args:locations_test_no_expand [k8-fastbuild]                                     78ms
//js/private/test/image/non_ascii:assert_custom_layer_groups_test_app_test [k8-fastbuild]                39ms
//js/private/test/image:assert_custom_layers_nomatch_test_app_test [k8-fastbuild]                        32ms
//js/private/test/image:assert_custom_layers_nomatch_test_node_test [k8-fastbuild]                       44ms
//js/private/test/image:assert_custom_layers_nomatch_test_package_store_3p_test [k8-fastbuild]           47ms
//js/private/test/image:assert_custom_owner_test_app_test [k8-fastbuild]                                 38ms
//js/private/test/image:assert_custom_owner_test_node_test [k8-fastbuild]                                45ms
//js/private/test/image:assert_default_test_app_test [k8-fastbuild]                                      37ms
//js/private/test/image:assert_regex_edge_cases_test_app_test [k8-fastbuild]                             48ms
//js/private/test/image:assert_regex_edge_cases_test_node_modules_test [k8-fastbuild]                    52ms
//js/private/test/image:assert_regex_edge_cases_test_node_test [k8-fastbuild]                            36ms
//js/private/test/image:assert_regex_edge_cases_test_odd_characters_test [k8-fastbuild]                  50ms
//js/private/test/image:assert_regex_edge_cases_test_package_store_1p_test [k8-fastbuild]                50ms
//js/private/test/image:checksum_test_test_test [k8-fastbuild]                                           52ms
//js/private/test/js_binary_sh:BAZEL_BINDIR_change_directory_test [k8-fastbuild]                         89ms
//js/private/test/js_binary_sh:BAZEL_BINDIR_test [k8-fastbuild]                                          98ms
//js/private/test/js_binary_sh:BAZEL_WORKSPACE_test [k8-fastbuild]                                       151ms
//js/private/test/js_binary_sh:JS_BINARY__BINDIR_test [k8-fastbuild]                                     88ms
//js/private/test/js_binary_sh:env_json_encode_launcher_escaped [k8-fastbuild]                           75ms
//js/private/test/js_binary_sh:env_json_obj_launcher_escaped [k8-fastbuild]                              59ms
//js/private/test/js_binary_sh:env_json_str_launcher_escaped [k8-fastbuild]                              92ms
//js/private/test/js_binary_sh:env_json_str_value [k8-fastbuild]                                         87ms
//js/private/test/js_run_devserver:node_modules_symlink_to_execroot_test [k8-fastbuild]                  259ms
//js/private/test/node-patches:lstat_node20_cjs_test [k8-fastbuild]                                      151ms
//js/private/test/node-patches:lstat_node20_test [k8-fastbuild]                                          166ms
//js/private/test/node-patches:lstat_node24_cjs_test [k8-fastbuild]                                      174ms
//js/private/test/node-patches:lstat_node24_test [k8-fastbuild]                                          177ms
//js/private/test/node-patches:lstat_nodejs_cjs_test [k8-fastbuild]                                      148ms
//js/private/test/node-patches:lstat_nodejs_test [k8-fastbuild]                                          217ms
//js/private/test/node-patches:opendir_node20_cjs_test [k8-fastbuild]                                    193ms
//js/private/test/node-patches:opendir_node22_cjs_test [k8-fastbuild]                                    176ms
//js/private/test/node-patches:opendir_node24_cjs_test [k8-fastbuild]                                    131ms
//js/private/test/node-patches:opendir_node24_test [k8-fastbuild]                                        224ms
//js/private/test/node-patches:readdir_node22_cjs_test [k8-fastbuild]                                    117ms
//js/private/test/node-patches:readdir_node22_test [k8-fastbuild]                                        231ms
//js/private/test/node-patches:readdir_node24_cjs_test [k8-fastbuild]                                    172ms
//js/private/test/node-patches:readdir_nodejs_test [k8-fastbuild]                                        205ms
//js/private/test/node-patches:readlink_node20_test [k8-fastbuild]                                       156ms
//js/private/test/node-patches:readlink_node24_cjs_test [k8-fastbuild]                                   162ms
//js/private/test/node-patches:readlink_nodejs_cjs_test [k8-fastbuild]                                   171ms
//js/private/test/node-patches:realpath_node20_cjs_test [k8-fastbuild]                                   133ms
//js/private/test/node-patches:realpath_node20_test [k8-fastbuild]                                       141ms
//js/private/test/node-patches:realpath_node22_cjs_test [k8-fastbuild]                                   164ms
//js/private/test/node-patches:realpath_node24_cjs_test [k8-fastbuild]                                   242ms
//js/private/test/node-patches:realpath_node24_test [k8-fastbuild]                                       191ms
//js/private/test/node-patches:realpath_nodejs_cjs_test [k8-fastbuild]                                   123ms
//js/private/test/node-patches:spawn_test_node22 [k8-fastbuild]                                          731ms
//js/private/test/node-patches:spawn_test_nodejs [k8-fastbuild]                                          602ms
//js/private/test/proto:proto_rewrite_imports_test [k8-fastbuild]                                        36ms
//js/private/test:main_default_toolchain [k8-fastbuild]                                                  77ms
//js/private/test:run_environment_info_tests_binary_env_test [k8-fastbuild]                              80ms
//js/private/test:transitive_type_deps_empty_srcs_test [k8-fastbuild]                                    24ms
//js/private/watch:watch_checked_0_test [k8-fastbuild]                                                   35ms
//npm/private/test/npm_package:test_pkg_5 [k8-fastbuild]                                                 50ms
//npm/private/test/npm_package:test_pkg_6 [k8-fastbuild]                                                 33ms
//npm/private/test/npm_package_publish:test [k8-fastbuild]                                               2s
//npm/private/test/subs:subs_test [k8-fastbuild]                                                         43ms
//npm/private/test:__rollup-test [k8-fastbuild]                                                          183ms
//npm/private/test:bin_test [k8-fastbuild]                                                               637ms
//npm/private/test:node_modules_test [k8-fastbuild]                                                      24ms
//npm/private/test:npm_auth_tests_test_1 [k8-fastbuild]                                                  71ms
//npm/private/test:npm_auth_tests_test_2 [k8-fastbuild]                                                  59ms
//npm/private/test:test_generated_pkg_json___rollup-target__entry_point_tagged_manual [k8-fastbuild]     66ms
//npm/private/test:test_generated_pkg_json___rollup-target__js_binary_tagged_manual [k8-fastbuild]       63ms
//npm/private/test:test_generated_pkg_json___rollup-target_copy_srcs_to_bin_tagged_manual [k8-fastbuild] 62ms
//npm/private/test:test_npm_package_visibility_test_1 [k8-fastbuild]                                     54ms
//npm/private/test:test_npm_package_visibility_test_11 [k8-fastbuild]                                    56ms
//npm/private/test:test_npm_package_visibility_test_14 [k8-fastbuild]                                    66ms
//npm/private/test:test_npm_package_visibility_test_5 [k8-fastbuild]                                     40ms
//npm/private/test:test_npmrc_test_2 [k8-fastbuild]                                                      85ms
//npm/private/test:test_npmrc_test_3 [k8-fastbuild]                                                      64ms
//npm/private/test:test_npmrc_test_5 [k8-fastbuild]                                                      86ms
//npm/private/test:test_npmrc_test_6 [k8-fastbuild]                                                      46ms
//npm/private/test:test_npmrc_test_7 [k8-fastbuild]                                                      77ms
//npm/private/test:test_parse_pnpm_lock_test_0 [k8-fastbuild]                                            57ms
//npm/private/test:test_parse_pnpm_lock_test_2 [k8-fastbuild]                                            36ms
//npm/private/test:test_pnpm_test_11 [k8-fastbuild]                                                      109ms
//npm/private/test:test_pnpm_test_12 [k8-fastbuild]                                                      84ms
//npm/private/test:test_pnpm_test_2 [k8-fastbuild]                                                       51ms
//npm/private/test:test_pnpm_test_3 [k8-fastbuild]                                                       37ms
//npm/private/test:test_translate_lock_test_4 [k8-fastbuild]                                             62ms
//npm/private/test:test_utils_test_0 [k8-fastbuild]                                                      72ms
//npm/private/test:test_utils_test_4 [k8-fastbuild]                                                      29ms
//npm/private/test:write_npm_translate_lock_3_test [k8-fastbuild]                                        145ms
//npm/private/test:write_npm_translate_lock_8_test [k8-fastbuild]                                        166ms
//npm/private/test:write_npm_translate_lock_9_test [k8-fastbuild]                                        156ms
+ 157 other targets

Bazel 8 (Test)

All tests were cache hits

217 tests (100.0%) were fully cached saving 27s.


Bazel 9 (Test)

All tests were cache hits

217 tests (100.0%) were fully cached saving 30s.


Bazel 7 (Test)

e2e/bzlmod

7 test targets passed

Targets
//:check_styles [k8-fastbuild]                                                                           134ms
//:jasmine_test [k8-fastbuild]                                                                           193ms
//:node_modules_test [k8-fastbuild]                                                                      37ms
//:other_module_binary_test [k8-fastbuild]                                                               57ms
//:other_module_linked_packages [k8-fastbuild]                                                           28ms
//:other_module_run_binary_test [k8-fastbuild]                                                           66ms
//:test [k8-fastbuild]                                                                                   91ms

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                                                                                  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

2 test targets passed

Targets
//:test [k8-fastbuild]                                                                                   83ms
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]                                                   118ms

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]                                                               92ms
//:test [k8-fastbuild]                                                                                   75ms
@@workspace~//:js_binary_chdir_test [k8-fastbuild]                                                       97ms
@@workspace~//:js_test_chdir_test [k8-fastbuild]                                                         157ms

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 8 (Test)

e2e/js_image_oci

All tests were cache hits

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


Bazel 9 (Test)

e2e/js_image_oci

All tests were cache hits

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


Bazel 7 (Test)

e2e/nextjs

3 test targets passed

Targets
//v15/cjs:test [k8-fastbuild]                                                                            39ms
//v15/esm:test [k8-fastbuild]                                                                            25ms
//v15/mjs:test [k8-fastbuild]                                                                            58ms

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]                                                                            213ms
//cjs:package_store_targets_test [k8-fastbuild]                                                          45ms
//esm/src:test [k8-fastbuild]                                                                            206ms
//esm:package_store_targets_test [k8-fastbuild]                                                          45ms

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]                                                                           122ms
//root:package_store_targets_test [k8-fastbuild]                                                         48ms

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                                                                                                  41ms
//:test_dev_filtering                                                                                    144ms
//:test_prod_filtering                                                                                   172ms

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]                                                                                   29ms
//:write_npm_translate_lock_defs_0_test [k8-fastbuild]                                                   74ms
//:write_npm_translate_lock_defs_1_test [k8-fastbuild]                                                   76ms

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]                                                                                   29ms
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]                                                   121ms

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

Buildkite build #12724 is running...


Bazel 7 (Test)

e2e/npm_translate_lock_exclude_package_contents

1 test target passed

Targets
//:test_sh                                                                                               28ms

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

Buildkite build #12724 is running...


Bazel 7 (Test)

e2e/npm_translate_lock_multi

2 test targets passed

Targets
//app1:test                                                                                              36ms
//app2:test                                                                                              53ms

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                                                                                              29ms

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

Waiting for runner...


Bazel 7 (Test)

e2e/npm_translate_lock_replace_packages

4 test targets passed

Targets
//:node_modules_test [k8-fastbuild]                                                                      41ms
//:test [k8-fastbuild]                                                                                   104ms
//:utils_test [k8-fastbuild]                                                                             90ms
//:write_npm_translate_lock_bzlmod_test [k8-fastbuild]                                                   133ms

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

Buildkite build #12724 is running...


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                                                                                                  19ms

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


Bazel 7 (Test)

e2e/npm_translate_yarn_lock

1 test target passed

Targets
//:test                                                                                                  20ms

Bazel 8 (Test)

e2e/npm_translate_yarn_lock

Buildkite build #12724 is running...


Bazel 9 (Test)

e2e/npm_translate_yarn_lock

Buildkite build #12724 is running...


Bazel 7 (Test)

e2e/output_paths

Buildkite build #12724 is running...


Bazel 8 (Test)

e2e/output_paths

Buildkite build #12724 is running...


Bazel 9 (Test)

e2e/output_paths

Buildkite build #12724 is running...


Bazel 7 (Test)

e2e/patch_from_repo

1 test target passed

Targets
//:test                                                                                                  26ms

Bazel 7 (Test)

e2e/pnpm_lockfiles

Buildkite build #12724 is running...


Bazel 8 (Test)

e2e/pnpm_lockfiles

Buildkite build #12724 is running...


Bazel 9 (Test)

e2e/pnpm_lockfiles

Buildkite build #12724 is running...


Bazel 7 (Test)

e2e/pnpm_repo_install

Buildkite build #12724 is running...


Bazel 8 (Test)

e2e/pnpm_repo_install

Buildkite build #12724 is running...


Bazel 9 (Test)

e2e/pnpm_repo_install

All tests were cache hits

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


Bazel 7 (Test)

e2e/pnpm_workspace

Buildkite build #12724 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 #12724 is running...


Bazel 8 (Test)

e2e/pnpm_workspace_deps

All tests were cache hits

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


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

15 test targets passed

Targets
//:node_test [k8-fastbuild]                                                                              242ms
//:repos_test [k8-fastbuild]                                                                             63ms
//:vendored [k8-fastbuild]                                                                               55ms
//app/a:aspect_test_a_bin_test [k8-fastbuild]                                                            130ms
//app/a:npm_link_targets_node_modules_build_test [k8-fastbuild]                                          94ms
//app/a:npm_link_targets_test [k8-fastbuild]                                                             97ms
//app/a:test [k8-fastbuild]                                                                              180ms
//app/b:aliases [k8-fastbuild]                                                                           67ms
//app/b:test [k8-fastbuild]                                                                              123ms
//app/c:aspect_test_a_bin_test [k8-fastbuild]                                                            130ms
//app/c:test [k8-fastbuild]                                                                              198ms
//app/d:test [k8-fastbuild]                                                                              167ms
//lib/a:vendored [k8-fastbuild]                                                                          75ms
//lib/b:aliases [k8-fastbuild]                                                                           66ms
//lib/d:aliases [k8-fastbuild]                                                                           73ms

Bazel 8 (Test)

e2e/pnpm_workspace_rerooted

Buildkite build #12724 is running...


Bazel 9 (Test)

e2e/pnpm_workspace_rerooted

Buildkite build #12724 is running...


Bazel 7 (Test)

e2e/protobuf-es

3 test targets passed

Targets
//:test [k8-fastbuild]                                                                                   141ms
//:test_connect [k8-fastbuild]                                                                           246ms
//:test_connect_query [k8-fastbuild]                                                                     335ms

Bazel 8 (Test)

e2e/protobuf-es

All tests were cache hits

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


Bazel 9 (Test)

e2e/protobuf-es

Buildkite build #12724 is running...


Bazel 7 (Test)

e2e/protobuf-google

Buildkite build #12724 is running...


Bazel 8 (Test)

e2e/protobuf-google

Buildkite build #12724 is running...


Bazel 9 (Test)

e2e/protobuf-google

All tests were cache hits

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


Bazel 7 (Test)

e2e/repo_mapping

3 test targets passed

Targets
//:node_modules_test [k8-fastbuild]                                                                      41ms
//:package_store_targets_test [k8-fastbuild]                                                             49ms
//:test [k8-fastbuild]                                                                                   61ms

Bazel 8 (Test)

e2e/repo_mapping

All tests were cache hits

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


Bazel 9 (Test)

e2e/repo_mapping

Buildkite build #12724 is running...


Bazel 7 (Test)

e2e/vendored_node

Buildkite build #12724 is running...


Bazel 8 (Test)

e2e/vendored_node

All tests were cache hits

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


Bazel 9 (Test)

e2e/vendored_node

All tests were cache hits

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


Bazel 7 (Test)

e2e/vendored_tarfile

Buildkite build #12724 is running...


Bazel 8 (Test)

e2e/vendored_tarfile

Waiting for runner...


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

2 test targets passed

Targets
//:test [k8-fastbuild]                                                                                   17ms
//patches:patches_update_test [k8-fastbuild]                                                             59ms

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


Bazel 7 (Test)

examples

84 test targets passed

Targets
//:linked_packages_build_test [k8-fastbuild]                                                             59ms
//coverage:coverage [k8-fastbuild]                                                                       169ms
//genrule:test_acorn [k8-fastbuild]                                                                      48ms
//genrule:test_require_acorn [k8-fastbuild]                                                              55ms
//js_binary:aspect_bin_a_test [k8-fastbuild]                                                             92ms
//js_binary:case7_test [k8-fastbuild]                                                                    210ms
//js_binary:npm_version_test [k8-fastbuild]                                                              294ms
//js_binary:test13-1_cjs [k8-fastbuild]                                                                  72ms
//js_binary:test13-1_mjs [k8-fastbuild]                                                                  136ms
//js_binary:test13-2_cjs [k8-fastbuild]                                                                  53ms
//js_binary:test13-2_mjs [k8-fastbuild]                                                                  58ms
//js_binary:test4-b_cjs [k8-fastbuild]                                                                   45ms
//js_binary:test4-b_mjs [k8-fastbuild]                                                                   48ms
//js_binary:test4-cjs-a [k8-fastbuild]                                                                   69ms
//js_binary:test4-mjs-a [k8-fastbuild]                                                                   58ms
//js_binary:test5_cjs [k8-fastbuild]                                                                     49ms
//js_binary:test5_mjs [k8-fastbuild]                                                                     45ms
//js_binary:test6 [k8-fastbuild]                                                                         43ms
//js_binary:test6_alt [k8-fastbuild]                                                                     68ms
//js_binary:test8 [k8-fastbuild]                                                                         43ms
//js_binary:test_cjs [k8-fastbuild]                                                                      114ms
//js_binary:test_exitcode [k8-fastbuild]                                                                 42ms
//js_binary:test_js_binary_under_custom_rule [k8-fastbuild]                                              76ms
//js_binary:test_js_binary_under_custom_rule_local [k8-fastbuild]                                        52ms
//js_binary:test_js_binary_under_genrule_cjs [k8-fastbuild]                                              51ms
//js_binary:test_js_binary_under_genrule_mjs [k8-fastbuild]                                              48ms
//js_binary:test_js_binary_under_js_run_binary_cjs [k8-fastbuild]                                        66ms
//js_binary:test_js_binary_under_js_run_binary_local_cjs [k8-fastbuild]                                  68ms
//js_binary:test_js_binary_under_js_run_binary_local_mjs [k8-fastbuild]                                  80ms
//js_binary:test_js_binary_under_js_run_binary_mjs [k8-fastbuild]                                        44ms
//js_binary:test_js_binary_under_js_run_binary_no_copy_data_to_bin [k8-fastbuild]                        71ms
//js_binary:test_mjs [k8-fastbuild]                                                                      133ms
//js_binary:test_stderr [k8-fastbuild]                                                                   52ms
//js_binary:test_stdout [k8-fastbuild]                                                                   53ms
//js_lib_pkg/b:test_each_target [k8-fastbuild]                                                           165ms
//js_lib_pkg/b:test_parent_target [k8-fastbuild]                                                         178ms
//js_library/two:two_test [k8-fastbuild]                                                                 158ms
//linked_consumer:direct [k8-fastbuild]                                                                  103ms
//linked_consumer:pkg [k8-fastbuild]                                                                     165ms
//linked_consumer:sources_test [k8-fastbuild]                                                            42ms
//linked_consumer:types_test [k8-fastbuild]                                                              65ms
//linked_empty_node_modules:test [k8-fastbuild]                                                          31ms
//macro:test_all [k8-fastbuild]                                                                          615ms
//macro:test_cjs [k8-fastbuild]                                                                          565ms
//macro:test_esm [k8-fastbuild]                                                                          464ms
//macro:test_js [k8-fastbuild]                                                                           436ms
//nextjs:next_build_test [k8-fastbuild]                                                                  61ms
//nextjs:write_next_links_defs_test [k8-fastbuild]                                                       87ms
//npm_deps/patches:patches_update_test [k8-fastbuild]                                                    71ms
//npm_deps:circular_deps_build_test [k8-fastbuild]                                                       60ms
//npm_deps:rollup_version_test [k8-fastbuild]                                                            201ms
//npm_deps:test1 [k8-fastbuild]                                                                          64ms
//npm_deps:test10_cjs [k8-fastbuild]                                                                     121ms
//npm_deps:test10_mjs [k8-fastbuild]                                                                     206ms
//npm_deps:test11_cjs [k8-fastbuild]                                                                     204ms
//npm_deps:test11_mjs [k8-fastbuild]                                                                     166ms
//npm_deps:test3 [k8-fastbuild]                                                                          77ms
//npm_deps:test4 [k8-fastbuild]                                                                          74ms
//npm_deps:test5 [k8-fastbuild]                                                                          50ms
//npm_deps:test5_alt [k8-fastbuild]                                                                      70ms
//npm_deps:test6 [k8-fastbuild]                                                                          125ms
//npm_deps:test7_a [k8-fastbuild]                                                                        130ms
//npm_deps:test7_b_cjs [k8-fastbuild]                                                                    150ms
//npm_deps:test7_b_mjs [k8-fastbuild]                                                                    140ms
//npm_deps:test8 [k8-fastbuild]                                                                          83ms
//npm_deps:test9_cjs [k8-fastbuild]                                                                      176ms
//npm_deps:test9_mjs [k8-fastbuild]                                                                      143ms
//npm_deps:test_peer [k8-fastbuild]                                                                      135ms
//npm_deps:test_uvu_version [k8-fastbuild]                                                               174ms
//package_json_module:test [k8-fastbuild]                                                                447ms
//rspack:build_test [k8-fastbuild]                                                                       29ms
//runfiles:module_name_runfiles [k8-fastbuild]                                                           133ms
//runfiles:outer_runfiles [k8-fastbuild]                                                                 202ms
//runfiles:run_outer_binary_asserts__direct_srcs [k8-fastbuild]                                          97ms
//runfiles:run_outer_binary_asserts__transitive_data [k8-fastbuild]                                      123ms
//runfiles:run_test_binary_asserts__direct_srcs [k8-fastbuild]                                           146ms
//runfiles:run_test_binary_asserts__transitive_data [k8-fastbuild]                                       99ms
//runfiles:runfiles [k8-fastbuild]                                                                       109ms
//stack_traces:stack_traces [k8-fastbuild]                                                               201ms
//stamped_package_json:stamp_test [k8-fastbuild]                                                         45ms
//vite3:build_test [k8-fastbuild]                                                                        40ms
//vite6:build_test [k8-fastbuild]                                                                        43ms
//webpack_cli:test [k8-fastbuild]                                                                        550ms
//worker:test_pi [k8-fastbuild]                                                                          103ms

Bazel 8 (Test)

examples

1 test target passed

Targets
//webpack_cli:test [k8-fastbuild]494ms

Total test execution time was 494ms. 81 tests (98.8%) were fully cached saving 11s.


Bazel 9 (Test)

examples

1 test target passed

Targets
//webpack_cli:test [k8-fastbuild]352ms

Total test execution time was 352ms. 81 tests (98.8%) were fully cached saving 12s.


Buildifier      Format

@acozzette acozzette marked this pull request as ready for review May 15, 2026 04:45
@acozzette acozzette requested a review from jbedard May 15, 2026 04:46

module.exports = defineConfig({
entry: {
main: './rspack_entry.js',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is rspack resolving this from the current working directory or relative to the config file since the config file will live in a separate bazel-out tree than than this entrypoint

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's resolving it from the current working directory. js_run_binary's working directory is basically "bazel-out/<target platform>/bin/" + chdir where in this case chdir is "rspack".

For the output path below, I did have to replace __dirname with process.cwd() to reflect that the config file is no longer placed in the target platform bin directory.

@jbedard jbedard requested a review from nickschaap May 17, 2026 02:21
acozzette and others added 4 commits May 18, 2026 14:36
This example started out as a test case by @jbedard and @nickschaap showing how
`js_run_binary` can sometimes fail to work correctly when the execution and
target platforms are different.

I was able to get it working, primarily by setting `use_execroot_entry_point =
False`. The problem with the default behavior (`use_execroot_entry_point =
True`) is that it runs target-platform sources during the build action, which
can go haywire if the target platform is meaningfully different from the
execution platform.

Getting all the sources in the right place and built for the right platform is
not entirely straightforward, so I thought it would be good to have a simple
example showing this. I added a lot of comments trying to explain why
everything is set up the way it is.
…tform separation

For webpack and rollup invocations, configs and their npm plugin/loader
dependencies now live in the tool binary's runfiles rather than being
passed as target-platform action inputs. This ensures all exec-platform
code runs from the same runfiles tree, avoiding resolution failures in
cross-platform builds.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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