Skip to content

Commit a2d7f86

Browse files
committed
refactor: rename bundled_artifact -> materialized_artifact
"Bundled" clashes with `include_bytes!`, which also bundles. The distinctive feature of this crate is that it gives you a real path on disk for APIs that need one (`LoadLibrary`, `LD_PRELOAD`, helper binaries) — the value-add over `include_bytes!` is the materialization step. The env-var prefix moves to `MATERIALIZED_ARTIFACT_` accordingly.
1 parent 0d9eb15 commit a2d7f86

17 files changed

Lines changed: 62 additions & 59 deletions

File tree

Cargo.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ derive_more = "2.0.1"
6969
diff-struct = "0.5.3"
7070
directories = "6.0.0"
7171
elf = { version = "0.8.0", default-features = false }
72-
bundled_artifact = { path = "crates/bundled_artifact" }
73-
bundled_artifact_build = { path = "crates/bundled_artifact_build" }
72+
materialized_artifact = { path = "crates/materialized_artifact" }
73+
materialized_artifact_build = { path = "crates/materialized_artifact_build" }
7474
flate2 = "1.0.35"
7575
fspy = { path = "crates/fspy" }
7676
fspy_detours_sys = { path = "crates/fspy_detours_sys" }

crates/bundled_artifact/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

crates/bundled_artifact_build/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

crates/fspy/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ wincode = { workspace = true }
1010
bstr = { workspace = true, default-features = false }
1111
bumpalo = { workspace = true }
1212
derive_more = { workspace = true, features = ["debug"] }
13-
bundled_artifact = { workspace = true }
13+
materialized_artifact = { workspace = true }
1414
fspy_shared = { workspace = true }
1515
futures-util = { workspace = true }
1616
libc = { workspace = true }
@@ -60,7 +60,7 @@ fspy_test_bin = { path = "../fspy_test_bin", artifact = "bin", target = "x86_64-
6060
# builds are cheap.
6161
[build-dependencies]
6262
anyhow = { workspace = true }
63-
bundled_artifact_build = { workspace = true }
63+
materialized_artifact_build = { workspace = true }
6464
flate2 = { workspace = true }
6565
fspy_preload_unix = { workspace = true }
6666
fspy_preload_windows = { workspace = true }

crates/fspy/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn fetch_macos_binaries(out_dir: &Path) -> anyhow::Result<()> {
138138
);
139139
fs::write(&dest, &data).with_context(|| format!("writing {}", dest.display()))?;
140140
}
141-
bundled_artifact_build::register(name, &dest);
141+
materialized_artifact_build::register(name, &dest);
142142
}
143143
Ok(())
144144
}
@@ -153,7 +153,7 @@ fn register_preload_cdylib() -> anyhow::Result<()> {
153153
// the path changes. Track it so we re-publish the hash on update.
154154
println!("cargo:rerun-if-env-changed={env_name}");
155155
let dylib_path = env::var_os(env_name).with_context(|| format!("{env_name} not set"))?;
156-
bundled_artifact_build::register("fspy_preload", Path::new(&dylib_path));
156+
materialized_artifact_build::register("fspy_preload", Path::new(&dylib_path));
157157
Ok(())
158158
}
159159

crates/fspy/src/unix/macos_artifacts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bundled_artifact::{Artifact, artifact};
1+
use materialized_artifact::{Artifact, artifact};
22

33
pub const COREUTILS_BINARY: Artifact = artifact!("coreutils");
44
pub const OILS_BINARY: Artifact = artifact!("oils_for_unix");

crates/fspy/src/unix/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl SpyImpl {
4545
pub fn init_in(#[cfg_attr(target_env = "musl", allow(unused))] dir: &Path) -> io::Result<Self> {
4646
#[cfg(not(target_env = "musl"))]
4747
let preload_path = {
48-
use bundled_artifact::{Artifact, artifact};
48+
use materialized_artifact::{Artifact, artifact};
4949

5050
const PRELOAD_CDYLIB: Artifact = artifact!("fspy_preload");
5151

crates/fspy/src/windows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use std::{
66
sync::Arc,
77
};
88

9-
use bundled_artifact::{Artifact, artifact};
109
use fspy_detours_sys::{DetourCopyPayloadToProcess, DetourUpdateProcessWithDll};
1110
use fspy_shared::{
1211
ipc::{PathAccess, channel::channel},
1312
windows::{PAYLOAD_ID, Payload},
1413
};
1514
use futures_util::FutureExt;
15+
use materialized_artifact::{Artifact, artifact};
1616
use tokio_util::sync::CancellationToken;
1717
use winapi::{
1818
shared::minwindef::TRUE,

0 commit comments

Comments
 (0)