[corgi](https://github.com/ConradIrwin/corgi) is a cargo-compatible build tool that runs `build.rs` scripts and proc-macros in a sandbox (no network, no ambient env, reads limited to a package's own `.rs` sources unless declared). This makes Zed buildable under it. Cargo builds (dev and release) are unaffected. ### Changes - **`scratch` patch**: patch `scratch` to a small local copy (`corgi-patches/scratch`) that reads `OUT_DIR` at runtime instead of baking it in at compile time. `cxx-build` writes its shared cxxbridge headers into `scratch::path(...)`; upstream returns a single global dir (outside any action's `OUT_DIR`) that the sandbox can't grant, while this patch gives each build script a private, writable dir in its own entry. webrtc-sys is self-contained, so per-crate scratch dirs are sufficient. Kept local rather than a cxx git fork because a git checkout of cxx needs symlink support that Windows cargo CI lacks. - **Dev asset loading**: add `util::dev_fs_embed!` and switch dev-mode `rust_embed` asset sources (`assets`, `settings`, `grammars`, `agent`, `edit_prediction_cli`) to read from the checkout at runtime, locating the repo root by walking from the executable up to the enclosing `.git`. This avoids baking `CARGO_MANIFEST_DIR` into the binary (corgi rejects artifacts that embed the build-time checkout path, and it's wrong in any other worktree). Release builds still embed via `#[derive(RustEmbed)]`. - **Stop baking checkout paths into artifacts**: drop `gpui::GPUI_MANIFEST_DIR`; resolve `../gpui` from `gpui_apple`'s build script; stage the metal shader into `OUT_DIR` before compiling so the `.metallib` records the output dir, not the checkout; resolve the repo root at runtime in `remote` and `inspector_ui` (removing `inspector_ui`'s `build.rs` / `ZED_REPO_DIR`). - **corgi.toml**: declare the pinned tools (`cmake`, prebuilt libwebrtc via `LK_CUSTOM_WEBRTC`), a release-only `ZED_COMMIT_SHA` probe, and the non-`.rs` / cross-package reads each package performs. ### Validation - `corgi check` + `corgi build`, dev and release, for `zed` (plus `cli`, `remote_server`, `ep`) with a warm C++ cache — clean; built binaries embed no checkout path. - `corgi fmt --check`, `corgi clippy`, and `corgi test` on the changed crates (922 tests pass). - `cargo check -p util` locally; relying on CI for the full cargo build/test matrix. ### Notes for the reviewer - Per the repo rule, the first two lines of `README.md` are the review-confirmation marker; remove them before merging (this is what Danger is failing on). - `remote_server` cross-compilation (linux-musl via zigbuild) is not yet covered by `corgi.toml` — host (macOS arm64) only for now. ### Suggested .rules additions Only if the team wants corgi guidance in `.rules` (it recurred several times here): dev builds must not bake the checkout path into artifacts — no `env!("CARGO_MANIFEST_DIR")` or `file!()`-derived absolute paths in library/binary output. Resolve the repo root at runtime via `util::dev_repo_root()` (walks to `.git`), and use `util::dev_fs_embed!` for dev-mode `rust_embed` sources. Release Notes: - N/A --------- Co-authored-by: Ben Kunkle <ben@zed.dev>
121 lines
3.4 KiB
TOML
121 lines
3.4 KiB
TOML
[package]
|
|
name = "agent"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lib]
|
|
path = "src/agent.rs"
|
|
|
|
[features]
|
|
test-support = ["db/test-support"]
|
|
unit-eval = []
|
|
e2e = []
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
acp_thread.workspace = true
|
|
action_log.workspace = true
|
|
async-channel.workspace = true
|
|
agent-client-protocol.workspace = true
|
|
agent_servers.workspace = true
|
|
agent_settings.workspace = true
|
|
agent_skills.workspace = true
|
|
anyhow.workspace = true
|
|
chrono.workspace = true
|
|
client.workspace = true
|
|
cloud_api_types.workspace = true
|
|
cloud_llm_client.workspace = true
|
|
collections.workspace = true
|
|
context_server.workspace = true
|
|
db.workspace = true
|
|
feature_flags.workspace = true
|
|
fs.workspace = true
|
|
futures.workspace = true
|
|
git.workspace = true
|
|
gpui.workspace = true
|
|
handlebars = { workspace = true, features = ["rust-embed"] }
|
|
heck.workspace = true
|
|
html_to_markdown.workspace = true
|
|
http_client.workspace = true
|
|
http_proxy.workspace = true
|
|
indoc.workspace = true
|
|
itertools.workspace = true
|
|
language.workspace = true
|
|
language_model.workspace = true
|
|
language_models.workspace = true
|
|
log.workspace = true
|
|
parking_lot.workspace = true
|
|
paths.workspace = true
|
|
project.workspace = true
|
|
prompt_store.workspace = true
|
|
quick-xml.workspace = true
|
|
rand.workspace = true
|
|
regex.workspace = true
|
|
sandbox.workspace = true
|
|
schemars.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
settings.workspace = true
|
|
shell_command_parser.workspace = true
|
|
smallvec.workspace = true
|
|
sqlez.workspace = true
|
|
streaming_diff.workspace = true
|
|
strsim.workspace = true
|
|
task.workspace = true
|
|
telemetry.workspace = true
|
|
tempfile.workspace = true
|
|
text.workspace = true
|
|
thiserror.workspace = true
|
|
ui.workspace = true
|
|
url.workspace = true
|
|
util.workspace = true
|
|
uuid.workspace = true
|
|
watch.workspace = true
|
|
web_search.workspace = true
|
|
zed_env_vars.workspace = true
|
|
zstd.workspace = true
|
|
|
|
# Used only on Windows to resolve the running release channel/version so the WSL
|
|
# sandbox helper can fetch a matching Linux `zed`.
|
|
[target.'cfg(target_os = "windows")'.dependencies]
|
|
release_channel.workspace = true
|
|
|
|
[dev-dependencies]
|
|
acp_thread = { workspace = true, features = ["test-support"] }
|
|
async-io.workspace = true
|
|
agent_servers = { workspace = true, "features" = ["test-support"] }
|
|
client = { workspace = true, "features" = ["test-support"] }
|
|
clock = { workspace = true, "features" = ["test-support"] }
|
|
context_server = { workspace = true, "features" = ["test-support"] }
|
|
ctor.workspace = true
|
|
db = { workspace = true, "features" = ["test-support"] }
|
|
editor = { workspace = true, "features" = ["test-support"] }
|
|
env_logger.workspace = true
|
|
eval_utils.workspace = true
|
|
fs = { workspace = true, "features" = ["test-support"] }
|
|
git = { workspace = true, "features" = ["test-support"] }
|
|
gpui = { workspace = true, "features" = ["test-support"] }
|
|
gpui_tokio.workspace = true
|
|
language = { workspace = true, "features" = ["test-support"] }
|
|
language_model = { workspace = true, "features" = ["test-support"] }
|
|
lsp = { workspace = true, "features" = ["test-support"] }
|
|
pretty_assertions.workspace = true
|
|
project = { workspace = true, "features" = ["test-support"] }
|
|
proptest.workspace = true
|
|
reqwest_client.workspace = true
|
|
settings = { workspace = true, "features" = ["test-support"] }
|
|
|
|
theme = { workspace = true, "features" = ["test-support"] }
|
|
theme_settings.workspace = true
|
|
|
|
unindent = { workspace = true }
|
|
|
|
zlog.workspace = true
|
|
|
|
[package.metadata.cargo-shear]
|
|
ignored = ["editor"]
|