mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-08-12 10:03:13 +00:00
fix(build): re-run logos-delivery build script when the native lib appears
This commit is contained in:
parent
71d3217e64
commit
d85b7dae80
@ -4,8 +4,15 @@ A terminal chat application built on top of libchat. End-to-end encrypted messag
|
|||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
[logos-delivery](https://github.com/logos-messaging/logos-delivery) is exposed as a Nix package.
|
`chat-cli` links the native [logos-delivery](https://github.com/logos-messaging/logos-delivery)
|
||||||
Build it once, then point `LOGOS_DELIVERY_LIB_DIR` at the result:
|
library. The dev shell builds it and sets `LOGOS_DELIVERY_LIB_DIR` for you:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix develop
|
||||||
|
cargo build --release -p chat-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
Or build the library yourself and point `LOGOS_DELIVERY_LIB_DIR` at it:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix build .#logos-delivery
|
nix build .#logos-delivery
|
||||||
|
|||||||
@ -94,6 +94,11 @@ fn resolve_lib_dir(dir: &str) -> Option<PathBuf> {
|
|||||||
let manifest = std::env::var("CARGO_MANIFEST_DIR").ok()?;
|
let manifest = std::env::var("CARGO_MANIFEST_DIR").ok()?;
|
||||||
Path::new(&find_flake_root(&manifest)?).join(path)
|
Path::new(&find_flake_root(&manifest)?).join(path)
|
||||||
};
|
};
|
||||||
|
// Re-run once the lib appears, so build order (nix build vs. cargo) is free.
|
||||||
|
println!("cargo:rerun-if-changed={}", anchored.display());
|
||||||
|
if let Some(parent) = anchored.parent() {
|
||||||
|
println!("cargo:rerun-if-changed={}", parent.display());
|
||||||
|
}
|
||||||
anchored.canonicalize().ok()
|
anchored.canonicalize().ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,8 +154,11 @@ fn nix_build_logos_delivery() -> Option<String> {
|
|||||||
|
|
||||||
println!("cargo:rerun-if-changed={flake_root}/flake.lock");
|
println!("cargo:rerun-if-changed={flake_root}/flake.lock");
|
||||||
|
|
||||||
|
// Enable flakes inline so the fallback works without global nix.conf setup.
|
||||||
let output = Command::new("nix")
|
let output = Command::new("nix")
|
||||||
.args([
|
.args([
|
||||||
|
"--extra-experimental-features",
|
||||||
|
"nix-command flakes",
|
||||||
"build",
|
"build",
|
||||||
".#logos-delivery",
|
".#logos-delivery",
|
||||||
"--no-link",
|
"--no-link",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user