mirror of
https://github.com/openai/codex.git
synced 2026-11-01 19:33:35 +00:00
159 lines
4.7 KiB
Python
159 lines
4.7 KiB
Python
load("@apple_support//xcode:xcode_config.bzl", "xcode_config")
|
|
load("//:windows_platform_test.bzl", "windows_platform_declarations_test")
|
|
|
|
xcode_config(name = "disable_xcode")
|
|
|
|
# We mark the local platform as glibc-compatible so that rust can grab a toolchain for us.
|
|
# TODO(zbarsky): Upstream a better libc constraint into rules_rust.
|
|
# We only enable this on linux though for sanity, and because it breaks remote execution.
|
|
platform(
|
|
name = "local_linux",
|
|
constraint_values = [
|
|
# We mark the local platform as glibc-compatible because musl-built rust cannot dlopen proc macros.
|
|
"@llvm//constraints/libc:gnu.2.28",
|
|
],
|
|
parents = ["@platforms//host"],
|
|
)
|
|
|
|
platform(
|
|
name = "local_windows",
|
|
constraint_values = [
|
|
"@llvm//constraints/windows_abi:gnullvm",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_gnullvm",
|
|
],
|
|
parents = ["@platforms//host"],
|
|
)
|
|
|
|
platform(
|
|
name = "local_windows_msvc",
|
|
constraint_values = [
|
|
"@llvm//constraints/windows_abi:msvc",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_msvc",
|
|
],
|
|
parents = ["@platforms//host"],
|
|
)
|
|
|
|
# The hermetic LLVM Windows toolchain is llvm-mingw and therefore gnullvm.
|
|
# MSVC targets intentionally resolve only on Windows hosts with an installed
|
|
# MSVC toolchain and Windows SDK.
|
|
platform(
|
|
name = "windows_x86_64_gnullvm",
|
|
constraint_values = [
|
|
"@llvm//constraints/windows_abi:gnullvm",
|
|
"@platforms//cpu:x86_64",
|
|
"@platforms//os:windows",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_gnullvm",
|
|
],
|
|
)
|
|
|
|
platform(
|
|
name = "windows_x86_64_msvc",
|
|
constraint_values = [
|
|
"@llvm//constraints/windows_abi:msvc",
|
|
"@platforms//cpu:x86_64",
|
|
"@platforms//os:windows",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_msvc",
|
|
],
|
|
)
|
|
|
|
# Release bundles cross-compile from the host and need the complete constraint
|
|
# set expected by both the Rust and LLVM toolchains.
|
|
platform(
|
|
name = "release_linux_arm64_musl",
|
|
constraint_values = [
|
|
"@llvm//constraints/libc:musl",
|
|
"@llvm//constraints/pie:off",
|
|
"@platforms//cpu:aarch64",
|
|
"@platforms//os:linux",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
platform(
|
|
name = "release_linux_amd64_musl",
|
|
constraint_values = [
|
|
"@llvm//constraints/libc:musl",
|
|
"@llvm//constraints/pie:off",
|
|
"@platforms//cpu:x86_64",
|
|
"@platforms//os:linux",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
platform(
|
|
name = "release_windows_amd64",
|
|
constraint_values = [
|
|
"@llvm//constraints/windows_abi:gnullvm",
|
|
"@platforms//cpu:x86_64",
|
|
"@platforms//os:windows",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_gnullvm",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
platform(
|
|
name = "release_windows_arm64",
|
|
constraint_values = [
|
|
"@llvm//constraints/windows_abi:gnullvm",
|
|
"@platforms//cpu:aarch64",
|
|
"@platforms//os:windows",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_gnullvm",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
toolchain(
|
|
name = "windows_gnullvm_tests_on_msvc_host_toolchain",
|
|
exec_compatible_with = [
|
|
"@platforms//cpu:x86_64",
|
|
"@platforms//os:windows",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_msvc",
|
|
],
|
|
target_compatible_with = [
|
|
"@platforms//cpu:x86_64",
|
|
"@platforms//os:windows",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_gnullvm",
|
|
],
|
|
toolchain = "@bazel_tools//tools/test:empty_toolchain",
|
|
toolchain_type = "@bazel_tools//tools/test:default_test_toolchain_type",
|
|
)
|
|
|
|
toolchain(
|
|
name = "windows_arm64_gnullvm_tests_on_linux_host_toolchain",
|
|
exec_compatible_with = [
|
|
"@platforms//cpu:x86_64",
|
|
"@platforms//os:linux",
|
|
],
|
|
target_compatible_with = [
|
|
"@llvm//constraints/windows_abi:gnullvm",
|
|
"@platforms//cpu:aarch64",
|
|
"@platforms//os:windows",
|
|
"@rules_rs//rs/experimental/platforms/constraints:windows_gnullvm",
|
|
],
|
|
toolchain = "@bazel_tools//tools/test:empty_toolchain",
|
|
toolchain_type = "@bazel_tools//tools/test:default_test_toolchain_type",
|
|
)
|
|
|
|
windows_platform_declarations_test(
|
|
name = "windows_platform_declarations_test",
|
|
data = [
|
|
"BUILD.bazel",
|
|
"MODULE.bazel",
|
|
"//patches:llvm_windows_arm64_powl.patch",
|
|
"//patches:llvm_windows_gnullvm_abi.patch",
|
|
],
|
|
script = "windows_platform_test.sh",
|
|
target_compatible_with = ["@platforms//os:linux"],
|
|
)
|
|
|
|
alias(
|
|
name = "rbe",
|
|
actual = "@rbe_platform",
|
|
)
|
|
|
|
exports_files([
|
|
"AGENTS.md",
|
|
"workspace_root_test_launcher.bat.tpl",
|
|
"workspace_root_test_launcher.sh.tpl",
|
|
])
|