Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aspect-build/rules_js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.3.0
Choose a base ref
...
head repository: aspect-build/rules_js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.3.1
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 21, 2025

  1. fix: js_image_layer when binary file is directly in bin_dir (#2141)

    jbedard authored Mar 21, 2025
    Copy the full SHA
    8ef910d View commit details
Showing with 8 additions and 6 deletions.
  1. +8 −6 js/private/js_image_layer.bzl
14 changes: 8 additions & 6 deletions js/private/js_image_layer.bzl
Original file line number Diff line number Diff line change
@@ -303,15 +303,17 @@ def _write_laucher(ctx, real_binary):
"Creates a call-through shell entrypoint which sets BAZEL_BINDIR to '.' then immediately invokes the original entrypoint."
launcher = ctx.actions.declare_file("%s_launcher" % ctx.label.name)

substitutions = {
"#!/usr/bin/env bash": _LAUNCHER_PREABMLE,
'export JS_BINARY__BINDIR="%s"' % real_binary.root.path: 'export JS_BINARY__BINDIR="$(pwd)"',
'export JS_BINARY__TARGET_CPU="%s"' % ctx.expand_make_variables("", "$(TARGET_CPU)", {}): 'export JS_BINARY__TARGET_CPU="$(uname -m)"',
}
substitutions['export JS_BINARY__BINDIR="%s"' % ctx.bin_dir.path] = 'export JS_BINARY__BINDIR="$(pwd)"'

ctx.actions.expand_template(
template = real_binary,
output = launcher,
substitutions = {
"#!/usr/bin/env bash": _LAUNCHER_PREABMLE,
'export JS_BINARY__BINDIR="%s"' % real_binary.root.path: 'export JS_BINARY__BINDIR="$(pwd)"',
'export JS_BINARY__BINDIR="%s"' % ctx.bin_dir.path: 'export JS_BINARY__BINDIR="$(pwd)"',
'export JS_BINARY__TARGET_CPU="%s"' % ctx.expand_make_variables("", "$(TARGET_CPU)", {}): 'export JS_BINARY__TARGET_CPU="$(uname -m)"',
},
substitutions = substitutions,
is_executable = True,
)
return launcher