feat: new bun_build and bun_compile, extend bun_install

This commit is contained in:
eric
2026-03-15 00:11:55 +01:00
parent c446f23a35
commit a0bc998bd2
58 changed files with 1845 additions and 191 deletions

View File

@@ -121,3 +121,10 @@ sh_test(
"//conditions:default": ["@bun_linux_x64//:bun"],
}),
)
sh_test(
name = "bun_install_install_flags_shape_test",
srcs = ["install_flags_shape.sh"],
args = ["$(location //internal:bun_install.bzl)"],
data = ["//internal:bun_install.bzl"],
)

View File

@@ -5,7 +5,7 @@ bun_path="$1"
workdir="$(mktemp -d)"
trap 'rm -rf "${workdir}"' EXIT
cat > "${workdir}/package.json" <<'JSON'
cat >"${workdir}/package.json" <<'JSON'
{
"name": "clean-install-test",
"version": "1.0.0"

View File

@@ -7,3 +7,4 @@ grep -Eq 'install_args = \[str\(bun_bin\), "--bun", "install", "--frozen-lockfil
grep -Eq 'if repository_ctx\.attr\.isolated_home:' "${rule_file}"
grep -Eq 'environment[[:space:]]*=[[:space:]]*\{"HOME":[[:space:]]*str\(repository_ctx\.path\("\."\)\)\}' "${rule_file}"
grep -Eq '"isolated_home": attr\.bool\(default = True\)' "${rule_file}"
grep -Eq '"install_flags": attr\.string_list\(\)' "${rule_file}"

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
rule_file="$1"
grep -Fq 'repository_ctx.attr.production' "${rule_file}"
grep -Fq '"--production"' "${rule_file}"
grep -Fq 'for omit in repository_ctx.attr.omit' "${rule_file}"
grep -Fq '"--omit"' "${rule_file}"
grep -Fq 'repository_ctx.attr.linker' "${rule_file}"
grep -Fq '"--linker"' "${rule_file}"
grep -Fq 'repository_ctx.attr.backend' "${rule_file}"
grep -Fq '"--backend"' "${rule_file}"
grep -Fq 'repository_ctx.attr.ignore_scripts' "${rule_file}"
grep -Fq '"--ignore-scripts"' "${rule_file}"
grep -Fq 'repository_ctx.attr.install_flags' "${rule_file}"