mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
740c4f269d
## Intent Keep Bazel and Starlark files consistently formatted without requiring contributors to install or version buildifier themselves. ## Implementation - Add a SHA-256-pinned, cross-platform DotSlash manifest for buildifier v8.5.1. - Run buildifier from the shared `just fmt` and `just fmt-check` driver, with Windows-safe explicit DotSlash invocation. - Provision DotSlash in formatting CI and contributor devcontainers, and document the source-build prerequisite. - Apply the initial mechanical buildifier formatting baseline.
36 lines
1003 B
Python
36 lines
1003 B
Python
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
load("//:defs.bzl", "codex_rust_crate")
|
|
|
|
codex_rust_crate(
|
|
name = "bwrap",
|
|
# Bazel wires vendored bubblewrap + libcap via :bwrap-ffi below and sets
|
|
# bwrap_available explicitly, so we skip Cargo's build.rs in Bazel builds.
|
|
build_script_enabled = False,
|
|
crate_name = "codex_bwrap",
|
|
deps_extra = select({
|
|
"@platforms//os:linux": [":bwrap-ffi"],
|
|
"//conditions:default": [],
|
|
}),
|
|
rustc_flags_extra = select({
|
|
"@platforms//os:linux": ["--cfg=bwrap_available"],
|
|
"//conditions:default": [],
|
|
}),
|
|
)
|
|
|
|
cc_library(
|
|
name = "bwrap-ffi",
|
|
srcs = ["//codex-rs/vendor:bubblewrap_c_sources"],
|
|
hdrs = [
|
|
"config.h",
|
|
"//codex-rs/vendor:bubblewrap_headers",
|
|
],
|
|
copts = [
|
|
"-D_GNU_SOURCE",
|
|
"-Dmain=bwrap_main",
|
|
],
|
|
includes = ["."],
|
|
target_compatible_with = ["@platforms//os:linux"],
|
|
visibility = ["//visibility:private"],
|
|
deps = ["@libcap"],
|
|
)
|