Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/template_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Setup soldr
id: setup-soldr
# Canary exact setup-soldr main SHA before v0 promotion.
uses: zackees/setup-soldr@a71cd1c92c72f8effbe65862e1440e9627678189
uses: zackees/setup-soldr@dfbe9627f6cb0226716b61625b99a58949162720
with:
# cache-preset: foundation expands to:
# build-cache: true, target-cache: false,
Expand Down
14 changes: 7 additions & 7 deletions bench/fastled-examples/src/build_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::env;
use std::ffi::{OsStr, OsString};
use std::fs::{self, File};
use std::io::{self, Write};
use std::path::{Path, PathBuf};
use std::path::Path;
use std::process::{Command, Output};
use std::sync::Mutex;
use std::sync::atomic::{AtomicUsize, Ordering};
Expand Down Expand Up @@ -423,11 +423,11 @@ fn phase_medians(trials: &[BTreeMap<String, f64>]) -> BTreeMap<String, f64> {
}

/// Locate the compile DB fbuild wrote for env `uno`.
fn find_compile_db(project_dir: &Path) -> Option<PathBuf> {
fn search(dir: &Path) -> Option<PathBuf> {
fn find_compile_db(project_dir: &Path) -> Option<NormalizedPath> {
fn search(dir: &Path) -> Option<NormalizedPath> {
let candidate = dir.join("compile_commands.json");
if candidate.is_file() {
return Some(candidate);
return Some(NormalizedPath::from(candidate));
}
let mut subdirs = fs::read_dir(dir)
.ok()?
Expand All @@ -438,9 +438,9 @@ fn find_compile_db(project_dir: &Path) -> Option<PathBuf> {
subdirs.sort();
subdirs.iter().find_map(|sub| search(sub))
}
search(&project_dir.join(".fbuild/build/uno")).or_else(|| {
search(&fbuild_paths::get_project_build_root(project_dir).join("uno")).or_else(|| {
let fallback = project_dir.join("compile_commands.json");
fallback.is_file().then_some(fallback)
fallback.is_file().then(|| NormalizedPath::from(fallback))
})
}

Expand Down Expand Up @@ -575,7 +575,7 @@ fn rewrite_compile_argv(argv: &[String], output: &Path) -> Vec<String> {

/// Replay every compile DB entry with the bare compiler across `jobs` threads.
fn raw_baseline_ms(entries: &[CompileEntry], jobs: usize) -> AppResult<f64> {
let temp = tempfile::TempDir::new()?;
let temp = tempfile::TempDir::new_in(fbuild_paths::temp_subdir("fastled-examples-bench"))?;
let next = AtomicUsize::new(0);
let failure: Mutex<Option<String>> = Mutex::new(None);
let started = Instant::now();
Expand Down
16 changes: 8 additions & 8 deletions crates/fbuild-build-engine/src/perf_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
//! // auto-summary on drop
//! ```

use std::ffi::OsString;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::path::Path;
use std::sync::OnceLock;
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Duration, Instant};
Expand All @@ -57,13 +58,12 @@ pub fn enabled() -> bool {
///
/// Cached after the first call.
pub fn json_sink_path() -> Option<&'static Path> {
static SINK: OnceLock<Option<PathBuf>> = OnceLock::new();
SINK.get_or_init(|| {
std::env::var_os("FBUILD_PERF_LOG_JSON")
.filter(|v| !v.is_empty())
.map(PathBuf::from)
})
.as_deref()
// Keep the raw value: lexical normalization would resolve `..` across
// symlinks and could open a different file than the caller named.
static SINK: OnceLock<Option<OsString>> = OnceLock::new();
SINK.get_or_init(|| std::env::var_os("FBUILD_PERF_LOG_JSON").filter(|v| !v.is_empty()))
.as_ref()
.map(Path::new)
}

/// Append `value` as a single JSON line to `path` (append + create).
Expand Down
Loading