fix: Make sure empty VERSION_EXTRA strings are ignored
Also updates built & removes unused optional features
This commit is contained in:
parent
f605913ea9
commit
3e4e696761
7 changed files with 24 additions and 47 deletions
45
Cargo.lock
generated
45
Cargo.lock
generated
|
@ -584,9 +584,12 @@ name = "built"
|
||||||
version = "0.7.7"
|
version = "0.7.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b"
|
checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b"
|
||||||
dependencies = [
|
|
||||||
"cargo-lock",
|
[[package]]
|
||||||
]
|
name = "built"
|
||||||
|
version = "0.8.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bumpalo"
|
name = "bumpalo"
|
||||||
|
@ -634,19 +637,6 @@ dependencies = [
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cargo-lock"
|
|
||||||
version = "10.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c06acb4f71407ba205a07cb453211e0e6a67b21904e47f6ba1f9589e38f2e454"
|
|
||||||
dependencies = [
|
|
||||||
"petgraph",
|
|
||||||
"semver",
|
|
||||||
"serde",
|
|
||||||
"toml",
|
|
||||||
"url",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cargo_toml"
|
name = "cargo_toml"
|
||||||
version = "0.21.0"
|
version = "0.21.0"
|
||||||
|
@ -876,7 +866,7 @@ dependencies = [
|
||||||
name = "conduwuit_build_metadata"
|
name = "conduwuit_build_metadata"
|
||||||
version = "0.5.0-rc.5"
|
version = "0.5.0-rc.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"built",
|
"built 0.8.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1541,12 +1531,6 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "fixedbitset"
|
|
||||||
version = "0.4.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
version = "1.1.1"
|
version = "1.1.1"
|
||||||
|
@ -3164,16 +3148,6 @@ version = "2.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "petgraph"
|
|
||||||
version = "0.6.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
|
|
||||||
dependencies = [
|
|
||||||
"fixedbitset",
|
|
||||||
"indexmap 2.8.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "phf"
|
name = "phf"
|
||||||
version = "0.11.3"
|
version = "0.11.3"
|
||||||
|
@ -3565,7 +3539,7 @@ dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"av1-grain",
|
"av1-grain",
|
||||||
"bitstream-io",
|
"bitstream-io",
|
||||||
"built",
|
"built 0.7.7",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"interpolate_name",
|
"interpolate_name",
|
||||||
"itertools 0.12.1",
|
"itertools 0.12.1",
|
||||||
|
@ -4169,9 +4143,6 @@ name = "semver"
|
||||||
version = "1.0.26"
|
version = "1.0.26"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
|
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
|
||||||
dependencies = [
|
|
||||||
"serde",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sentry"
|
name = "sentry"
|
||||||
|
|
|
@ -18,8 +18,8 @@ build = "build.rs"
|
||||||
[lib]
|
[lib]
|
||||||
path = "mod.rs"
|
path = "mod.rs"
|
||||||
crate-type = [
|
crate-type = [
|
||||||
"rlib",
|
"rlib",
|
||||||
# "dylib",
|
# "dylib",
|
||||||
]
|
]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
@ -28,7 +28,7 @@ crate-type = [
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
built = {version = "0.7", features = ["cargo-lock", "dependency-tree"]}
|
built = { version = "0.8", features = [] }
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -78,6 +78,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Rerun Triggers ---
|
// --- Rerun Triggers ---
|
||||||
|
// TODO: The git rerun triggers seem to always run
|
||||||
// Rerun if the git HEAD changes
|
// Rerun if the git HEAD changes
|
||||||
println!("cargo:rerun-if-changed=.git/HEAD");
|
println!("cargo:rerun-if-changed=.git/HEAD");
|
||||||
// Rerun if the ref pointed to by HEAD changes (e.g., new commit on branch)
|
// Rerun if the ref pointed to by HEAD changes (e.g., new commit on branch)
|
||||||
|
|
|
@ -12,11 +12,16 @@ pub static VERSION_EXTRA: Option<&str> =
|
||||||
v
|
v
|
||||||
} else if let v @ Some(_) = option_env!("CONDUWUIT_VERSION_EXTRA") {
|
} else if let v @ Some(_) = option_env!("CONDUWUIT_VERSION_EXTRA") {
|
||||||
v
|
v
|
||||||
} else if let v @ Some(_) = option_env!("CONDUIT_VERSION_EXTRA") {
|
|
||||||
v
|
|
||||||
} else {
|
} else {
|
||||||
GIT_COMMIT_HASH_SHORT
|
option_env!("CONDUIT_VERSION_EXTRA")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub fn version_tag() -> Option<&'static str> {
|
||||||
|
VERSION_EXTRA
|
||||||
|
.filter(|s| !s.is_empty())
|
||||||
|
.or(GIT_COMMIT_HASH_SHORT)
|
||||||
|
}
|
||||||
|
|
||||||
pub static GIT_REMOTE_WEB_URL: Option<&str> = option_env!("GIT_REMOTE_WEB_URL");
|
pub static GIT_REMOTE_WEB_URL: Option<&str> = option_env!("GIT_REMOTE_WEB_URL");
|
||||||
pub static GIT_REMOTE_COMMIT_URL: Option<&str> = option_env!("GIT_REMOTE_COMMIT_URL");
|
pub static GIT_REMOTE_COMMIT_URL: Option<&str> = option_env!("GIT_REMOTE_COMMIT_URL");
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,6 @@ pub fn user_agent() -> &'static str { USER_AGENT.get_or_init(init_user_agent) }
|
||||||
fn init_user_agent() -> String { format!("{}/{}", name(), version()) }
|
fn init_user_agent() -> String { format!("{}/{}", name(), version()) }
|
||||||
|
|
||||||
fn init_version() -> String {
|
fn init_version() -> String {
|
||||||
conduwuit_build_metadata::VERSION_EXTRA
|
conduwuit_build_metadata::version_tag()
|
||||||
.map_or(SEMANTIC.to_owned(), |extra| format!("{SEMANTIC} ({extra})"))
|
.map_or(SEMANTIC.to_owned(), |extra| format!("{SEMANTIC} ({extra})"))
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ use axum::{
|
||||||
response::{Html, IntoResponse, Response},
|
response::{Html, IntoResponse, Response},
|
||||||
routing::get,
|
routing::get,
|
||||||
};
|
};
|
||||||
use conduwuit_build_metadata::{GIT_REMOTE_COMMIT_URL, GIT_REMOTE_WEB_URL, VERSION_EXTRA};
|
use conduwuit_build_metadata::{GIT_REMOTE_COMMIT_URL, GIT_REMOTE_WEB_URL, version_tag};
|
||||||
use conduwuit_service::state;
|
use conduwuit_service::state;
|
||||||
|
|
||||||
pub fn build() -> Router<state::State> {
|
pub fn build() -> Router<state::State> {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
{%~ block footer ~%}
|
{%~ block footer ~%}
|
||||||
<footer>
|
<footer>
|
||||||
<p>Powered by <a href="https://continuwuity.org">Continuwuity</a>
|
<p>Powered by <a href="https://continuwuity.org">Continuwuity</a>
|
||||||
{%~ if let Some(version_info) = VERSION_EXTRA ~%}
|
{%~ if let Some(version_info) = self::version_tag() ~%}
|
||||||
{%~ if let Some(url) = GIT_REMOTE_COMMIT_URL.or(GIT_REMOTE_WEB_URL) ~%}
|
{%~ if let Some(url) = GIT_REMOTE_COMMIT_URL.or(GIT_REMOTE_WEB_URL) ~%}
|
||||||
(<a href="{{ url }}">{{ version_info }}</a>)
|
(<a href="{{ url }}">{{ version_info }}</a>)
|
||||||
{%~ else ~%}
|
{%~ else ~%}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue