Fix Bazel macOS CI failures caused by the llvm module's pinned macOS SDK URL returning 403 Forbidden from Apple's CDN. Bump llvm to 0.6.8, switch to the new osx.from_archive(...) / osx.frameworks(...) API, and refresh MODULE.bazel.lock so Bazel uses the updated SDK archive configuration.
221 lines
5.8 KiB
Text
221 lines
5.8 KiB
Text
module(name = "codex")
|
|
|
|
bazel_dep(name = "bazel_skylib", version = "1.8.2")
|
|
bazel_dep(name = "platforms", version = "1.0.0")
|
|
bazel_dep(name = "llvm", version = "0.6.8")
|
|
|
|
register_toolchains("@llvm//toolchain:all")
|
|
|
|
osx = use_extension("@llvm//extensions:osx.bzl", "osx")
|
|
osx.from_archive(
|
|
sha256 = "6a4922f89487a96d7054ec6ca5065bfddd9f1d017c74d82f1d79cecf7feb8228",
|
|
strip_prefix = "Payload/Library/Developer/CommandLineTools/SDKs/MacOSX26.2.sdk",
|
|
type = "pkg",
|
|
urls = [
|
|
"https://swcdn.apple.com/content/downloads/26/44/047-81934-A_28TPKM5SD1/ps6pk6dk4x02vgfa5qsctq6tgf23t5f0w2/CLTools_macOSNMOS_SDK.pkg",
|
|
],
|
|
)
|
|
osx.frameworks(names = [
|
|
"ApplicationServices",
|
|
"AppKit",
|
|
"ColorSync",
|
|
"CoreFoundation",
|
|
"CoreGraphics",
|
|
"CoreServices",
|
|
"CoreText",
|
|
"AudioToolbox",
|
|
"CFNetwork",
|
|
"FontServices",
|
|
"AudioUnit",
|
|
"CoreAudio",
|
|
"CoreAudioTypes",
|
|
"Foundation",
|
|
"ImageIO",
|
|
"IOKit",
|
|
"Kernel",
|
|
"OSLog",
|
|
"Security",
|
|
"SystemConfiguration",
|
|
])
|
|
use_repo(osx, "macos_sdk")
|
|
|
|
# Needed to disable xcode...
|
|
bazel_dep(name = "apple_support", version = "2.1.0")
|
|
bazel_dep(name = "rules_cc", version = "0.2.16")
|
|
bazel_dep(name = "rules_platform", version = "0.1.0")
|
|
bazel_dep(name = "rules_rs", version = "0.0.43")
|
|
|
|
rules_rust = use_extension("@rules_rs//rs/experimental:rules_rust.bzl", "rules_rust")
|
|
use_repo(rules_rust, "rules_rust")
|
|
|
|
toolchains = use_extension("@rules_rs//rs/experimental/toolchains:module_extension.bzl", "toolchains")
|
|
toolchains.toolchain(
|
|
edition = "2024",
|
|
version = "1.93.0",
|
|
)
|
|
use_repo(toolchains, "default_rust_toolchains")
|
|
|
|
register_toolchains("@default_rust_toolchains//:all")
|
|
|
|
crate = use_extension("@rules_rs//rs:extensions.bzl", "crate")
|
|
crate.from_cargo(
|
|
cargo_lock = "//codex-rs:Cargo.lock",
|
|
cargo_toml = "//codex-rs:Cargo.toml",
|
|
platform_triples = [
|
|
"aarch64-unknown-linux-gnu",
|
|
"aarch64-unknown-linux-musl",
|
|
"aarch64-apple-darwin",
|
|
"aarch64-pc-windows-gnullvm",
|
|
"x86_64-unknown-linux-gnu",
|
|
"x86_64-unknown-linux-musl",
|
|
"x86_64-apple-darwin",
|
|
"x86_64-pc-windows-gnullvm",
|
|
],
|
|
use_experimental_platforms = True,
|
|
)
|
|
|
|
bazel_dep(name = "zstd", version = "1.5.7")
|
|
|
|
crate.annotation(
|
|
crate = "zstd-sys",
|
|
gen_build_script = "off",
|
|
deps = ["@zstd"],
|
|
)
|
|
crate.annotation(
|
|
build_script_env = {
|
|
"AWS_LC_SYS_NO_JITTER_ENTROPY": "1",
|
|
},
|
|
crate = "aws-lc-sys",
|
|
patch_args = ["-p1"],
|
|
patches = [
|
|
"//patches:aws-lc-sys_memcmp_check.patch",
|
|
],
|
|
)
|
|
|
|
inject_repo(crate, "zstd")
|
|
|
|
bazel_dep(name = "bzip2", version = "1.0.8.bcr.3")
|
|
|
|
crate.annotation(
|
|
crate = "bzip2-sys",
|
|
gen_build_script = "off",
|
|
deps = ["@bzip2//:bz2"],
|
|
)
|
|
|
|
inject_repo(crate, "bzip2")
|
|
|
|
bazel_dep(name = "zlib", version = "1.3.1.bcr.8")
|
|
|
|
crate.annotation(
|
|
crate = "libz-sys",
|
|
gen_build_script = "off",
|
|
deps = ["@zlib"],
|
|
)
|
|
|
|
inject_repo(crate, "zlib")
|
|
|
|
# TODO(zbarsky): Enable annotation after fixing windows arm64 builds.
|
|
crate.annotation(
|
|
crate = "lzma-sys",
|
|
gen_build_script = "on",
|
|
)
|
|
|
|
bazel_dep(name = "openssl", version = "3.5.4.bcr.0")
|
|
|
|
crate.annotation(
|
|
build_script_data = [
|
|
"@openssl//:gen_dir",
|
|
],
|
|
build_script_env = {
|
|
"OPENSSL_DIR": "$(execpath @openssl//:gen_dir)",
|
|
"OPENSSL_NO_VENDOR": "1",
|
|
"OPENSSL_STATIC": "1",
|
|
},
|
|
crate = "openssl-sys",
|
|
data = ["@openssl//:gen_dir"],
|
|
gen_build_script = "on",
|
|
)
|
|
|
|
inject_repo(crate, "openssl")
|
|
|
|
crate.annotation(
|
|
crate = "runfiles",
|
|
workspace_cargo_toml = "rust/runfiles/Cargo.toml",
|
|
)
|
|
|
|
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
llvm = use_extension("@llvm//extensions:llvm.bzl", "llvm")
|
|
use_repo(llvm, "llvm-project")
|
|
|
|
crate.annotation(
|
|
# Provide the hermetic SDK path so the build script doesn't try to invoke an unhermetic `xcrun --show-sdk-path`.
|
|
build_script_data = [
|
|
"@macos_sdk//sysroot",
|
|
],
|
|
build_script_env = {
|
|
"BINDGEN_EXTRA_CLANG_ARGS": "-Xclang -internal-isystem -Xclang $(location @llvm//:builtin_resource_dir)/include",
|
|
"COREAUDIO_SDK_PATH": "$(location @macos_sdk//sysroot)",
|
|
"LIBCLANG_PATH": "$(location @llvm-project//clang:libclang_interface_output)",
|
|
},
|
|
build_script_tools = [
|
|
"@llvm-project//clang:libclang_interface_output",
|
|
"@llvm//:builtin_resource_dir",
|
|
],
|
|
crate = "coreaudio-sys",
|
|
gen_build_script = "on",
|
|
)
|
|
|
|
inject_repo(crate, "llvm", "llvm-project", "macos_sdk")
|
|
|
|
# Fix readme inclusions
|
|
crate.annotation(
|
|
crate = "windows-link",
|
|
patch_args = ["-p1"],
|
|
patches = [
|
|
"//patches:windows-link.patch",
|
|
],
|
|
)
|
|
|
|
bazel_dep(name = "alsa_lib", version = "1.2.9.bcr.4")
|
|
|
|
crate.annotation(
|
|
crate = "alsa-sys",
|
|
gen_build_script = "off",
|
|
deps = ["@alsa_lib"],
|
|
)
|
|
|
|
inject_repo(crate, "alsa_lib")
|
|
|
|
bazel_dep(name = "v8", version = "14.6.202.9")
|
|
archive_override(
|
|
module_name = "v8",
|
|
integrity = "sha256-JphDwLAzsd9KvgRZ7eQvNtPU6qGd3XjFt/a/1QITAJU=",
|
|
patch_strip = 3,
|
|
patches = [
|
|
"//patches:v8_module_deps.patch",
|
|
"//patches:v8_bazel_rules.patch",
|
|
"//patches:v8_source_portability.patch",
|
|
],
|
|
strip_prefix = "v8-14.6.202.9",
|
|
urls = ["https://github.com/v8/v8/archive/refs/tags/14.6.202.9.tar.gz"],
|
|
)
|
|
|
|
http_archive(
|
|
name = "v8_crate_146_4_0",
|
|
build_file = "//third_party/v8:v8_crate.BUILD.bazel",
|
|
sha256 = "d97bcac5cdc5a195a4813f1855a6bc658f240452aac36caa12fd6c6f16026ab1",
|
|
strip_prefix = "v8-146.4.0",
|
|
type = "tar.gz",
|
|
urls = ["https://static.crates.io/crates/v8/v8-146.4.0.crate"],
|
|
)
|
|
|
|
use_repo(crate, "crates")
|
|
|
|
bazel_dep(name = "libcap", version = "2.27.bcr.1")
|
|
|
|
rbe_platform_repository = use_repo_rule("//:rbe.bzl", "rbe_platform_repository")
|
|
|
|
rbe_platform_repository(
|
|
name = "rbe_platform",
|
|
)
|