diff --git a/.aspect/workflows/config.yaml b/.aspect/workflows/config.yaml index 284b08854..c4dcfbab2 100644 --- a/.aspect/workflows/config.yaml +++ b/.aspect/workflows/config.yaml @@ -3,6 +3,7 @@ workspaces: - . - e2e + - e2e/cases/bcr-simulation-900 - examples/uv_pip_compile: tasks: - bazel-9: diff --git a/e2e/cases/bcr-simulation-900/BUILD.bazel b/e2e/cases/bcr-simulation-900/BUILD.bazel new file mode 100644 index 000000000..384ba1f5e --- /dev/null +++ b/e2e/cases/bcr-simulation-900/BUILD.bazel @@ -0,0 +1,35 @@ +load("@aspect_rules_py//py/unstable:defs.bzl", "py_venv_binary") +load("@bazel_lib//lib:transitions.bzl", "platform_transition_filegroup") +load("@rules_shell//shell:sh_test.bzl", "sh_test") + +platform( + name = "arm64_linux", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:aarch64", + ], +) + +py_venv_binary( + name = "hello_bin", + srcs = ["hello.py"], + main = "hello.py", + python_version = "3.12", + venv = "hello_venv", +) + +platform_transition_filegroup( + name = "arm64_transition", + srcs = [":hello_bin"], + target_platform = ":arm64_linux", +) + +sh_test( + name = "bcr_compatibility_test", + srcs = ["test.sh"], + data = [":arm64_transition"], + target_compatible_with = [ + "@platforms//os:linux", + "@platforms//cpu:x86_64", + ], +) diff --git a/e2e/cases/bcr-simulation-900/MODULE.bazel b/e2e/cases/bcr-simulation-900/MODULE.bazel new file mode 100644 index 000000000..6c690ec35 --- /dev/null +++ b/e2e/cases/bcr-simulation-900/MODULE.bazel @@ -0,0 +1,21 @@ +module(name = "bcr_simulation_900") + +bazel_dep(name = "aspect_rules_py", version = "0.0.0") +local_path_override( + module_name = "aspect_rules_py", + path = "../../..", +) + +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "bazel_lib", version = "3.2.2") +bazel_dep(name = "rules_shell", version = "0.6.1") +bazel_dep(name = "rules_python", version = "1.0.0") + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain( + is_default = True, + python_version = "3.12", +) +use_repo(python, "python_3_12") + +register_toolchains("@python_3_12//:all") diff --git a/e2e/cases/bcr-simulation-900/hello.py b/e2e/cases/bcr-simulation-900/hello.py new file mode 100644 index 000000000..11b15b1a4 --- /dev/null +++ b/e2e/cases/bcr-simulation-900/hello.py @@ -0,0 +1 @@ +print("hello") diff --git a/e2e/cases/bcr-simulation-900/test.sh b/e2e/cases/bcr-simulation-900/test.sh new file mode 100644 index 000000000..8c55ca611 --- /dev/null +++ b/e2e/cases/bcr-simulation-900/test.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +echo "BCR Compatibility Test" +echo "======================" +echo +echo "If this test runs, either:" +echo " 1. ARM64 toolchains are registered (test passes)" +echo " 2. target_compatible_with constraints are properly set (test skipped)" +echo +echo "The arm64_transition target was successfully resolved."