aspect-build / rules_js

High-performance Bazel rules for running Node.js tools and building JavaScript projects
https://docs.aspect.build/rules/aspect_rules_js
Apache License 2.0
310 stars 107 forks source link

fix: upgrade bazel-lib to include run_binary param parsing fix #1987

Closed jbedard closed 1 month ago

jbedard commented 1 month ago

This is to include https://github.com/bazel-contrib/bazel-lib/commit/73d021fb368c67be40ae204a62cfa789e14515a7 which fixed a bug in run_binary and therefore js_run_binary.

Currently the rules_js WORKSPACE deps have this fix but bzlmod does not. This change upgrades the minimum bazel-lib version to include this fix.

The updated assertions align with running node outside bazel on the cli:

> echo 'console.log(`${process.argv[2]} + ${process.argv[3]}`)' | node - --x='3' '4'

--x=3 + 4

The stdout has no quotes despite the arguments being quoted. The tests updated in this change show rules_js now does the same.


Changes are visible to end-users: no

Test plan

jbedard commented 1 month ago

Here's a CI run at HEAD with the current failure: https://github.com/aspect-build/rules_js/actions/runs/11374410329/job/31643056254#step:7:1543

aspect-workflows[bot] commented 1 month ago

Test

3 test targets passed

Targets
//.aspect/bazelrc:update_aspect_bazelrc_presets_1_test [k8-fastbuild]                   91ms
//.aspect/bazelrc:update_aspect_bazelrc_presets_2_test [k8-fastbuild]                   90ms
//.github/workflows:update_aspect_bazelrc_presets_1_test [k8-fastbuild]                 92ms

Total test execution time was 273ms. 200 tests (98.5%) were fully cached saving 39s.


Test

e2e/bzlmod

All tests were cache hits

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


Test

e2e/gyp_no_install_script

All tests were cache hits

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


Test

e2e/js_image_oci

All tests were cache hits

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


Test

e2e/npm_link_package

All tests were cache hits

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


Test

e2e/npm_link_package-esm

All tests were cache hits

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


Test

e2e/npm_translate_lock

All tests were cache hits

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


Test

e2e/npm_translate_lock_empty

All tests were cache hits

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


Test

e2e/npm_translate_lock_multi

All tests were cache hits

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


Test

e2e/npm_translate_lock_partial_clone

All tests were cache hits

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


Test

e2e/npm_translate_lock_replace_packages

All tests were cache hits

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


Test

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

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


Test

e2e/npm_translate_package_lock

All tests were cache hits

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


Test

e2e/npm_translate_yarn_lock

All tests were cache hits

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


Test

e2e/package_json_module

All tests were cache hits

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


Test

e2e/pnpm_lockfiles

All tests were cache hits

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


Test

e2e/pnpm_workspace

All tests were cache hits

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


Test

e2e/pnpm_workspace_rerooted

All tests were cache hits

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


Test

e2e/repo_mapping

All tests were cache hits

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


Test

e2e/rules_foo

All tests were cache hits

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


Test

e2e/runfiles

All tests were cache hits

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


Test

e2e/vendored_node

All tests were cache hits

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


Buildifier      Format

jbedard commented 1 month ago

@ahmedneilhussain you logged the original issue (https://github.com/aspect-build/rules_js/issues/1045) the tests changed in this PR were testing. Do you know if you're already using bazel-lib >= 2.8.1 and can confirm your issue is still fixed?