mirror of
https://github.com/openai/codex.git
synced 2026-03-05 21:45:28 +03:00
Adds voice transcription on press-and-hold of spacebar. https://github.com/user-attachments/assets/85039314-26f3-46d1-a83b-8c4a4a1ecc21 --------- Co-authored-by: Codex <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com> Co-authored-by: David Zbarsky <zbarsky@openai.com>
226 lines
6.0 KiB
Python
226 lines
6.0 KiB
Python
module(name = "codex")
|
|
|
|
bazel_dep(name = "platforms", version = "1.0.0")
|
|
bazel_dep(name = "toolchains_llvm_bootstrapped", version = "0.5.6")
|
|
single_version_override(
|
|
module_name = "toolchains_llvm_bootstrapped",
|
|
patch_strip = 1,
|
|
patches = [
|
|
"//patches:toolchains_llvm_bootstrapped_resource_dir.patch",
|
|
],
|
|
)
|
|
|
|
register_toolchains("@toolchains_llvm_bootstrapped//toolchain:all")
|
|
|
|
osx = use_extension("@toolchains_llvm_bootstrapped//extensions:osx.bzl", "osx")
|
|
osx.framework(name = "ApplicationServices")
|
|
osx.framework(name = "AppKit")
|
|
osx.framework(name = "ColorSync")
|
|
osx.framework(name = "CoreFoundation")
|
|
osx.framework(name = "CoreGraphics")
|
|
osx.framework(name = "CoreServices")
|
|
osx.framework(name = "CoreText")
|
|
osx.framework(name = "AudioToolbox")
|
|
osx.framework(name = "CFNetwork")
|
|
osx.framework(name = "FontServices")
|
|
osx.framework(name = "AudioUnit")
|
|
osx.framework(name = "CoreAudio")
|
|
osx.framework(name = "CoreAudioTypes")
|
|
osx.framework(name = "Foundation")
|
|
osx.framework(name = "ImageIO")
|
|
osx.framework(name = "IOKit")
|
|
osx.framework(name = "Kernel")
|
|
osx.framework(name = "OSLog")
|
|
osx.framework(name = "Security")
|
|
osx.framework(name = "SystemConfiguration")
|
|
use_repo(osx, "macosx15.4.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.23")
|
|
|
|
# Special toolchains branch
|
|
archive_override(
|
|
module_name = "rules_rs",
|
|
integrity = "sha256-O34UF4H7b1Qacu3vlu2Od4ILGVApzg5j1zl952SFL3w=",
|
|
strip_prefix = "rules_rs-097123c2aa72672e371e69e7035869f5a45c7b2b",
|
|
url = "https://github.com/dzbarsky/rules_rs/archive/097123c2aa72672e371e69e7035869f5a45c7b2b.tar.gz",
|
|
)
|
|
|
|
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,
|
|
"experimental_rust_toolchains_1_93_0",
|
|
"rust_toolchain_artifacts_macos_aarch64_1_93_0",
|
|
)
|
|
|
|
register_toolchains("@experimental_rust_toolchains_1_93_0//: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",
|
|
],
|
|
)
|
|
|
|
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")
|
|
bazel_dep(name = "libcap", version = "2.27.bcr.1")
|
|
|
|
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_features = [
|
|
"dep:openssl-src",
|
|
],
|
|
crate = "openssl-sys",
|
|
data = ["@openssl//:gen_dir"],
|
|
)
|
|
|
|
inject_repo(crate, "openssl")
|
|
|
|
crate.annotation(
|
|
crate = "runfiles",
|
|
workspace_cargo_toml = "rust/runfiles/Cargo.toml",
|
|
)
|
|
|
|
llvm = use_extension("@toolchains_llvm_bootstrapped//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 = [
|
|
"@macosx15.4.sdk//sysroot",
|
|
],
|
|
build_script_env = {
|
|
"BINDGEN_EXTRA_CLANG_ARGS": "-isystem $(location @toolchains_llvm_bootstrapped//:builtin_headers)",
|
|
"COREAUDIO_SDK_PATH": "$(location @macosx15.4.sdk//sysroot)",
|
|
"LIBCLANG_PATH": "$(location @codex//:clang)",
|
|
},
|
|
build_script_tools = [
|
|
"@codex//:clang",
|
|
"@toolchains_llvm_bootstrapped//:builtin_headers",
|
|
],
|
|
crate = "coreaudio-sys",
|
|
)
|
|
|
|
inject_repo(crate, "codex", "toolchains_llvm_bootstrapped", "macosx15.4.sdk")
|
|
|
|
# Fix readme inclusions
|
|
crate.annotation(
|
|
crate = "windows-link",
|
|
patch_args = ["-p1"],
|
|
patches = [
|
|
"//patches:windows-link.patch",
|
|
],
|
|
)
|
|
|
|
WINDOWS_IMPORT_LIB = """
|
|
load("@rules_cc//cc:defs.bzl", "cc_import")
|
|
|
|
cc_import(
|
|
name = "windows_import_lib",
|
|
static_library = glob(["lib/*.a"])[0],
|
|
)
|
|
"""
|
|
|
|
crate.annotation(
|
|
additive_build_file_content = WINDOWS_IMPORT_LIB,
|
|
crate = "windows_x86_64_gnullvm",
|
|
gen_build_script = "off",
|
|
deps = [":windows_import_lib"],
|
|
)
|
|
crate.annotation(
|
|
additive_build_file_content = WINDOWS_IMPORT_LIB,
|
|
crate = "windows_aarch64_gnullvm",
|
|
gen_build_script = "off",
|
|
deps = [":windows_import_lib"],
|
|
)
|
|
|
|
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")
|
|
|
|
use_repo(crate, "crates")
|
|
|
|
rbe_platform_repository = use_repo_rule("//:rbe.bzl", "rbe_platform_repository")
|
|
|
|
rbe_platform_repository(
|
|
name = "rbe_platform",
|
|
)
|