mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-06 03:59:14 +00:00
e99c41a9bf
* chore(deps): refresh scanner heal batch dependency baseline Regenerate compatible lockfile selections before the next implementation batch. Cargo upgrade leaves direct requirements unchanged. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * fix(ecstore): remove duplicate local rename implementation Keep the canonical commit module after concurrent storage changes merged. The control-write and rollback changes are already present there. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * chore(deps): refresh profiling dependencies for the next batch Update hotpath and its macro crate to the compatible patch release before the next dependency-ready implementation tasks. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * fix(deps): preserve supported hotpath focus expressions Keep the profiler runtime before its regex-lite compatibility regression. Track the opt-in validation required to remove this constraint in backlog. Refs rustfs/backlog#2302. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * test(scanner): add bounded ABBA validation harness Refs rustfs/backlog#2266 and rustfs/backlog#2240. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * test(scanner): verify real restart evidence before release gates Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * fix(test): bind scanner evidence to execution and build identity Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * docs(test): use the nextest workspace report directory Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * fix(test): reap ABBA leaders only after process-group cleanup Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> * fix(test): preserve inclusive ABBA thresholds Use decimal boundary comparisons for ABBA ratio checks and cover exact documented p99, throughput, and P1 limits. Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> --------- Co-authored-by: heihutu <heihutu@gmail.com> Co-authored-by: zhi22915 <qiuzgang@gmail.com> Co-authored-by: overtrue <anzhengchao@gmail.com>
75 lines
2.8 KiB
Rust
75 lines
2.8 KiB
Rust
// Copyright 2024 RustFS Team
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
use std::path::Path;
|
|
use std::process::Command;
|
|
|
|
fn git(root: &Path, args: &[&str]) -> Option<String> {
|
|
let output = Command::new("git").args(args).current_dir(root).output().ok()?;
|
|
output
|
|
.status
|
|
.success()
|
|
.then(|| String::from_utf8_lossy(&output.stdout).trim().to_owned())
|
|
}
|
|
|
|
fn emit(name: &str, value: &str) {
|
|
let value = if value.contains(['\n', '\r']) { "unknown" } else { value };
|
|
println!("cargo:rustc-env=RUSTFS_E2E_BUILD_{name}={value}");
|
|
}
|
|
|
|
fn main() {
|
|
let manifest = std::env::var_os("CARGO_MANIFEST_DIR").unwrap_or_default();
|
|
let root = Path::new(&manifest).join("../..");
|
|
// Cover dependency/common sources as well as this crate. HEAD/ref/index
|
|
// changes must refresh identity even when no Rust source mtime changes.
|
|
for path in [
|
|
"crates",
|
|
"rustfs",
|
|
"Cargo.toml",
|
|
"Cargo.lock",
|
|
"rust-toolchain.toml",
|
|
".cargo",
|
|
".config",
|
|
] {
|
|
println!("cargo:rerun-if-changed={}", root.join(path).display());
|
|
}
|
|
let mut git_paths = vec!["HEAD".to_owned(), "index".to_owned(), "packed-refs".to_owned()];
|
|
if let Some(reference) = git(&root, &["symbolic-ref", "-q", "HEAD"]) {
|
|
git_paths.push(reference);
|
|
}
|
|
for path in git_paths {
|
|
if let Some(path) = git(&root, &["rev-parse", "--git-path", &path]) {
|
|
let path = Path::new(&path);
|
|
let path = if path.is_absolute() {
|
|
path.to_owned()
|
|
} else {
|
|
root.join(path)
|
|
};
|
|
if path.exists() {
|
|
println!("cargo:rerun-if-changed={}", path.display());
|
|
}
|
|
}
|
|
}
|
|
let revision = git(&root, &["rev-parse", "HEAD"]).unwrap_or_else(|| "unknown".to_owned());
|
|
let dirty = git(&root, &["status", "--porcelain", "--untracked-files=normal"]).is_none_or(|status| !status.is_empty());
|
|
let lock = git(&root, &["hash-object", "Cargo.lock"]).unwrap_or_else(|| "unknown".to_owned());
|
|
let mut features = std::env::vars()
|
|
.filter_map(|(key, _)| {
|
|
key.strip_prefix("CARGO_FEATURE_")
|
|
.map(|name| name.to_ascii_lowercase().replace('_', "-"))
|
|
})
|
|
.collect::<Vec<_>>();
|
|
features.sort();
|
|
emit("COMMIT", &revision);
|
|
emit("DIRTY", if dirty { "true" } else { "false" });
|
|
emit("LOCK", &lock);
|
|
emit("FEATURES", &features.join(","));
|
|
for name in ["TARGET", "PROFILE"] {
|
|
emit(name, &std::env::var(name).unwrap_or_else(|_| "unknown".to_owned()));
|
|
}
|
|
println!("cargo:rerun-if-env-changed=CARGO_ENCODED_RUSTFLAGS");
|
|
let flags = std::env::var("CARGO_ENCODED_RUSTFLAGS").unwrap_or_default();
|
|
let flags: String = flags.as_bytes().iter().map(|byte| format!("{byte:02x}")).collect();
|
|
emit("RUSTFLAGS_HEX", &flags);
|
|
}
|