Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Mar 2, 2024
1 parent 9d94470 commit f91f002
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 84 deletions.
75 changes: 0 additions & 75 deletions MODULE.bazel.orig

This file was deleted.

5 changes: 1 addition & 4 deletions py/private/py_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@aspect_bazel_lib//lib:paths.bzl", "BASH_RLOCATION_FUNCTION", "to_rlocatio
load("@aspect_bazel_lib//lib:expand_make_vars.bzl", "expand_locations", "expand_variables")
load("//py/private:py_library.bzl", _py_library = "py_library_utils")
load("//py/private:py_semantics.bzl", _py_semantics = "semantics")
load("//py/private/toolchain:types.bzl", "PY_TOOLCHAIN", "SH_TOOLCHAIN", "VENV_TOOLCHAIN")
load("//py/private/toolchain:types.bzl", "PY_TOOLCHAIN", "VENV_TOOLCHAIN")

def _dict_to_exports(env):
return [
Expand All @@ -13,7 +13,6 @@ def _dict_to_exports(env):
]

def _py_binary_rule_impl(ctx):
sh_toolchain = ctx.toolchains[SH_TOOLCHAIN]
venv_toolchain = ctx.toolchains[VENV_TOOLCHAIN]
py_toolchain = _py_semantics.resolve_toolchain(ctx)

Expand Down Expand Up @@ -67,7 +66,6 @@ def _py_binary_rule_impl(ctx):
template = ctx.file._run_tmpl,
output = executable_launcher,
substitutions = {
"{{SHELL_BIN}}": sh_toolchain.path,
"{{BASH_RLOCATION_FN}}": BASH_RLOCATION_FUNCTION,
"{{INTERPRETER_FLAGS}}": " ".join(py_toolchain.flags),
"{{VENV_TOOL}}": to_rlocation_path(ctx, venv_toolchain.bin),
Expand Down Expand Up @@ -158,7 +156,6 @@ py_base = struct(
implementation = _py_binary_rule_impl,
attrs = _attrs,
toolchains = [
SH_TOOLCHAIN,
PY_TOOLCHAIN,
VENV_TOOLCHAIN,
],
Expand Down
4 changes: 1 addition & 3 deletions py/private/py_venv.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ load("@bazel_skylib//lib:paths.bzl", "paths")
load("//py/private:providers.bzl", "PyVirtualInfo")
load("//py/private:py_library.bzl", _py_library = "py_library_utils")
load("//py/private:py_semantics.bzl", _py_semantics = "semantics")
load("//py/private/toolchain:types.bzl", "PY_TOOLCHAIN", "SH_TOOLCHAIN", "VENV_TOOLCHAIN")
load("//py/private/toolchain:types.bzl", "PY_TOOLCHAIN", "VENV_TOOLCHAIN")

def _py_venv_rule_imp(ctx):
sh_toolchain = ctx.toolchains[SH_TOOLCHAIN]
venv_toolchain = ctx.toolchains[VENV_TOOLCHAIN]
py_toolchain = _py_semantics.resolve_toolchain(ctx)

Expand Down Expand Up @@ -41,7 +40,6 @@ def _py_venv_rule_imp(ctx):
template = ctx.file._venv_tmpl,
output = executable_launcher,
substitutions = {
"{{SHELL_BIN}}": sh_toolchain.path,
"{{BASH_RLOCATION_FN}}": BASH_RLOCATION_FUNCTION,
"{{INTERPRETER_FLAGS}}": " ".join(py_toolchain.flags),
"{{VENV_TOOL}}": to_rlocation_path(ctx, venv_toolchain.bin),
Expand Down
4 changes: 3 additions & 1 deletion py/private/run.tmpl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!{{SHELL_BIN}}
#!/usr/bin/env bash
# NB: we don't use a path from @bazel_tools//tools/sh:toolchain_type because that's configured for the exec
# configuration, while this script executes in the target configuration at runtime.

{{BASH_RLOCATION_FN}}
runfiles_export_envvars
Expand Down
4 changes: 3 additions & 1 deletion py/private/venv.tmpl.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!{{SHELL_BIN}}
#!/usr/bin/env bash
# NB: we don't use a path from @bazel_tools//tools/sh:toolchain_type because that's configured for the exec
# configuration, while this script executes in the target configuration at runtime.

{{BASH_RLOCATION_FN}}
runfiles_export_envvars
Expand Down

0 comments on commit f91f002

Please sign in to comment.