1
0
Fork 0

Use reflinks when supported

This commit is contained in:
Robbert van der Helm 2022-02-27 01:06:45 +01:00
parent 0675feb54b
commit 9d137fe813
3 changed files with 14 additions and 1 deletions

10
Cargo.lock generated
View file

@ -727,6 +727,15 @@ dependencies = [
"bitflags",
]
[[package]]
name = "reflink"
version = "0.1.3"
source = "git+https://github.com/nicokoch/reflink?rev=e8d93b465f5d9ad340cd052b64bbc77b8ee107e2#e8d93b465f5d9ad340cd052b64bbc77b8ee107e2"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "ryu"
version = "1.0.9"
@ -1156,6 +1165,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"goblin",
"reflink",
"serde",
"toml",
]

View file

@ -8,5 +8,7 @@ license = "ISC"
[dependencies]
anyhow = "1.0"
goblin = "0.5"
# Version 0.1.3 from crates.io assumes a 64-bit toolchain
reflink = { git = "https://github.com/nicokoch/reflink", rev = "e8d93b465f5d9ad340cd052b64bbc77b8ee107e2" }
serde = { version = "1.0", features = ["derive"] }
toml = "0.5"

View file

@ -141,7 +141,8 @@ fn bundle(package: &str, args: &[String]) -> Result<()> {
fs::create_dir_all(vst3_lib_path.parent().unwrap())
.context("Could not create bundle directory")?;
fs::copy(&lib_path, &vst3_lib_path).context("Could not copy library to bundle")?;
reflink::reflink_or_copy(&lib_path, &vst3_lib_path)
.context("Could not copy library to bundle")?;
maybe_create_macos_vst3_bundle(package, cross_compile_target.as_deref())?;