From c67a427610659d2419cdac388e8859be883c904b Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Tue, 7 Nov 2023 21:06:29 -0500 Subject: [PATCH] mtime fixes --- Cargo.lock | 22 ++++++++++++++++++++++ veilid-core/Cargo.toml | 1 + veilid-core/build.rs | 5 +++++ 3 files changed, 28 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 559f2fd3..05f41c32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1830,6 +1830,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a481586acf778f1b1455424c343f71124b048ffa5f4fc3f8f6ae9dc432dcb3c7" +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", +] + [[package]] name = "flate2" version = "1.0.28" @@ -3930,6 +3942,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -5521,6 +5542,7 @@ dependencies = [ "enum-as-inner", "enumset", "eyre", + "filetime", "flume", "futures-util", "getrandom", diff --git a/veilid-core/Cargo.toml b/veilid-core/Cargo.toml index 6a3a4692..c12abb15 100644 --- a/veilid-core/Cargo.toml +++ b/veilid-core/Cargo.toml @@ -274,6 +274,7 @@ wasm-logger = "0.2.0" [build-dependencies] capnpc = "0.18.0" glob = "0.3.1" +filetime = "0.2.22" [package.metadata.wasm-pack.profile.release] wasm-opt = ["-O", "--enable-mutable-globals"] diff --git a/veilid-core/build.rs b/veilid-core/build.rs index 4d8395d8..3324b5f8 100644 --- a/veilid-core/build.rs +++ b/veilid-core/build.rs @@ -1,3 +1,4 @@ +use filetime::{set_file_mtime, FileTime}; use glob::glob; use std::{ env, fs, io, @@ -84,6 +85,9 @@ fn do_capnp_build() { .output_path(".") .run() .expect("compiling schema"); + + // If successful, update modification time + set_file_mtime("proto/veilid_capnp.rs", FileTime::now()).unwrap(); } // Fix for missing __extenddftf2 on Android x86_64 Emulator @@ -113,6 +117,7 @@ fn main() { } if is_input_file_outdated("./proto/veilid.capnp", "./proto/veilid_capnp.rs").unwrap() { + println!("cargo:warning=rebuilding proto/veilid_capnp.rs because it is older than proto/veilid.capnp"); do_capnp_build(); }