Skip to content

Conversation

janantharaj
Copy link
Contributor

@janantharaj janantharaj commented Jun 17, 2025

Description

When testing a js_run_devserver target with a WXT server, I noticed that a shell executable I passed in didn't have its data files copied over. @alexeagle pointed out that js_run_devserver wasn't including data runfiles when copying files to the sandbox. This PR changes that.

Test

Using the following two BUILD.bazel files, I ran bazel build serve. Previously only foo.sh would be copied over to the sandbox. After this change, foo.sh and bar.txt were copied over:

load("@aspect_rules_js//js:defs.bzl", "js_run_devserver")
load("@npm//:http-server/package_json.bzl", http_server_bin = "bin")

http_server_bin.http_server_binary(
    name = "http_server",
)

js_run_devserver(
    name = "serve",
    args = ["."],
    data = ["//binary:foo"],
    no_copy_to_bin = ["//binary:foo"],
    tool = ":http_server",
)
sh_binary(
    name = "foo",
    srcs = ["foo.sh"],
    data = ["bar.txt"],
    visibility = ["//visibility:public"],
)

Happy to do more comprehensive testing if desired.

@CLAassistant
Copy link

CLAassistant commented Jun 17, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

aspect-workflows bot commented Jun 17, 2025

Test

All tests were cache hits

225 tests (100.0%) were fully cached saving 29s.


Test

e2e/bzlmod

All tests were cache hits

5 tests (100.0%) were fully cached saving 557ms.


Test

e2e/gyp_no_install_script

All tests were cache hits

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


Test

e2e/js_image_oci

All tests were cache hits

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


Test

e2e/npm_link_package

All tests were cache hits

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


Test

e2e/npm_link_package-esm

All tests were cache hits

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


Test

e2e/npm_translate_lock

All tests were cache hits

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


Test

e2e/npm_translate_lock_empty

All tests were cache hits

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


Test

e2e/npm_translate_lock_multi

All tests were cache hits

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


Test

e2e/npm_translate_lock_partial_clone

All tests were cache hits

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


Test

e2e/npm_translate_lock_replace_packages

All tests were cache hits

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


Test

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

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


Test

e2e/npm_translate_package_lock

All tests were cache hits

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


Test

e2e/npm_translate_yarn_lock

All tests were cache hits

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


Test

e2e/package_json_module

All tests were cache hits

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


Test

e2e/pnpm_lockfiles

All tests were cache hits

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


Test

e2e/pnpm_workspace

All tests were cache hits

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


Test

e2e/pnpm_workspace_rerooted

All tests were cache hits

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


Test

e2e/repo_mapping

All tests were cache hits

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


Test

e2e/rules_foo

All tests were cache hits

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


Test

e2e/runfiles

All tests were cache hits

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


Test

e2e/vendored_node

All tests were cache hits

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


Buildifier      Format

@janantharaj janantharaj force-pushed the ja/add-data-runfiles-js-run-devserver branch from 32be02f to 2a5d44e Compare June 17, 2025 07:32
Copy link
Member

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

Thank you!

@alexeagle alexeagle merged commit 7a74eeb into aspect-build:main Jun 17, 2025
99 checks passed
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.

3 participants