Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
72 lines
2.9 KiB
Python
72 lines
2.9 KiB
Python
load("//:defs.bzl", "codex_rust_crate")
|
|
load("//bazel/rules:runtime_package.bzl", "release_binary")
|
|
|
|
# Cargo's build.rs emits rustc-link-arg-bin so only the setup helper gets the
|
|
# asInvoker manifest. rules_rust warns on and drops that directive, so Bazel
|
|
# spells out the same per-binary linker contract here.
|
|
WINDOWS_SETUP_MANIFEST_RUSTC_FLAGS = select({
|
|
"@llvm//constraints/windows/abi:gnullvm": [
|
|
"-C",
|
|
"link-arg=$(location :codex-windows-sandbox-setup-manifest-resource)",
|
|
],
|
|
"@llvm//constraints/windows/abi:msvc": [
|
|
"-C",
|
|
"link-arg=/MANIFEST:EMBED",
|
|
"-C",
|
|
"link-arg=/MANIFESTINPUT:$(location :akode-windows-sandbox-setup.manifest)",
|
|
],
|
|
"//conditions:default": [],
|
|
})
|
|
|
|
# Copying build.rs's gnullvm /MANIFESTINPUT flags is not enough: lld-link
|
|
# shells out to mt.exe, but the supported gnullvm cross-build executes on
|
|
# Linux RBE. Compile the same RT_MANIFEST resource with hermetic LLVM instead.
|
|
# -no-preprocess does not expand RT_MANIFEST, so use its numeric type, 24.
|
|
# Keep the command on one line: Windows checkouts use CRLF, but Linux RBE runs it.
|
|
genrule(
|
|
name = "codex-windows-sandbox-setup-manifest-resource",
|
|
srcs = ["akode-windows-sandbox-setup.manifest"],
|
|
outs = ["akode-windows-sandbox-setup.manifest.res"],
|
|
cmd = " && ".join([
|
|
"printf '1 24 \"%s\"\\n' \"$(location :akode-windows-sandbox-setup.manifest)\" > \"$(@D)/codex-windows-sandbox-setup.manifest.rc\"",
|
|
"$(location @llvm//tools:llvm-rc) -no-preprocess \"$(@D)/codex-windows-sandbox-setup.manifest.rc\"",
|
|
]),
|
|
tools = ["@llvm//tools:llvm-rc"],
|
|
)
|
|
|
|
codex_rust_crate(
|
|
name = "windows-sandbox-rs",
|
|
binary_compile_data_extra = {
|
|
"akode-windows-sandbox-setup": select({
|
|
"@llvm//constraints/windows/abi:gnullvm": [":codex-windows-sandbox-setup-manifest-resource"],
|
|
"@llvm//constraints/windows/abi:msvc": ["akode-windows-sandbox-setup.manifest"],
|
|
"//conditions:default": [],
|
|
}),
|
|
},
|
|
binary_rustc_flags_extra = {
|
|
"akode-windows-sandbox-setup": WINDOWS_SETUP_MANIFEST_RUSTC_FLAGS,
|
|
},
|
|
binary_test_target_compatible_with = ["@platforms//os:windows"],
|
|
# Do not run build.rs under Bazel: rules_rust cannot translate its
|
|
# rustc-link-arg-bin directives, and the target-local equivalents above
|
|
# provide the link inputs and flags without the unsupported-directive warning.
|
|
build_script_enabled = False,
|
|
crate_name = "akode_windows_sandbox",
|
|
test_data_extra = [
|
|
":akode-command-runner",
|
|
":akode-windows-sandbox-setup",
|
|
],
|
|
)
|
|
|
|
release_binary(
|
|
name = "command-runner-release",
|
|
binary = ":akode-command-runner",
|
|
target_compatible_with = ["@platforms//os:windows"],
|
|
)
|
|
|
|
release_binary(
|
|
name = "sandbox-setup-release",
|
|
binary = ":akode-windows-sandbox-setup",
|
|
target_compatible_with = ["@platforms//os:windows"],
|
|
)
|