aboutsummaryrefslogtreecommitdiff
path: root/build.rs
diff options
context:
space:
mode:
authorMathijs van Veluw <[email protected]>2023-12-09 23:04:33 +0100
committerGitHub <[email protected]>2023-12-09 23:04:33 +0100
commit3246251f295fd16dba21ec9d32afbbb104bd9c8e (patch)
treeb74920222f24255d492a8547d0c5667a6b13d5e3 /build.rs
parent8ab200224e9ef0879ccd35080365118b08c43b02 (diff)
downloadvaultwarden-3246251f295fd16dba21ec9d32afbbb104bd9c8e.tar.gz
vaultwarden-3246251f295fd16dba21ec9d32afbbb104bd9c8e.zip
Fix the version string (#4153)
For some reason still not known, the `.git` directory was not copied into the container. I think buildkit (buildx) did this by default before, and stopped this with newer versions. This PR fixes this by also touching `build.rs` besides `src/main.rs`. This PR also updates Rust to v1.74.1 and some crates, including the latest version of Alpine 3.19. Fixes #4150
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/build.rs b/build.rs
index 34ebec89..63b3bc45 100644
--- a/build.rs
+++ b/build.rs
@@ -17,6 +17,13 @@ fn main() {
"You need to enable one DB backend. To build with previous defaults do: cargo build --features sqlite"
);
+ // Rerun when these paths are changed.
+ // Someone could have checked-out a tag or specific commit, but no other files changed.
+ println!("cargo:rerun-if-changed=.git");
+ println!("cargo:rerun-if-changed=.git/HEAD");
+ println!("cargo:rerun-if-changed=.git/index");
+ println!("cargo:rerun-if-changed=.git/refs/tags");
+
#[cfg(all(not(debug_assertions), feature = "query_logger"))]
compile_error!("Query Logging is only allowed during development, it is not intended for production usage!");
@@ -48,11 +55,6 @@ fn run(args: &[&str]) -> Result<String, std::io::Error> {
/// - env!("GIT_REV")
/// - env!("VW_VERSION")
fn version_from_git_info() -> Result<String, std::io::Error> {
- // Rerun when these paths are changed.
- // Someone could have checked-out a tag or specific commit, but no other files changed.
- println!("cargo:rerun-if-changed=.git/HEAD");
- println!("cargo:rerun-if-changed=.git/refs/tags/");
-
// The exact tag for the current commit, can be empty when
// the current commit doesn't have an associated tag
let exact_tag = run(&["git", "describe", "--abbrev=0", "--tags", "--exact-match"]).ok();