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 crates/fbuild-build-engine/src/compiler_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async fn compile_path_contract_pairs_cwd_and_output_arg_for_282() {
let workspace = tmp_canon.join("proj_for_282");
let core = workspace
.join(fbuild_paths::FBUILD_DIR_NAME)
.join("build")
.join(fbuild_paths::BUILD_DIR_NAME)
.join("x")
.join("quick")
.join("core");
Expand Down
12 changes: 10 additions & 2 deletions crates/fbuild-build/src/compile_many.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,9 +840,17 @@ mod tests {
// here that doesn't also update the orchestrators will silently
// break the stage-1→stage-2 core/ handoff in FastLED/fbuild#335.
let p = project_build_dir(Path::new("/tmp/sketch"), "uno", BuildProfile::Release);
assert!(p.ends_with("sketch/.fbuild/build/uno/release"));
assert!(p.ends_with(format!(
"sketch/{}/{}/uno/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
)));
let q = project_build_dir(Path::new("/tmp/sketch"), "esp32s3", BuildProfile::Quick);
assert!(q.ends_with("sketch/.fbuild/build/esp32s3/quick"));
assert!(q.ends_with(format!(
"sketch/{}/{}/esp32s3/quick",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
)));
}

/// FastLED stages each board's project at
Expand Down
60 changes: 50 additions & 10 deletions crates/fbuild-build/tests/avr_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ async fn build_uno_minimal() {
// `params.build_dir` is the resolved env-rooted dir per
// `BuildLayout::resolve()`.
let tmp = tempfile::TempDir::new().unwrap();
let build_dir = tmp.path().join(".fbuild/build/uno/release");
let build_dir = tmp.path().join(format!(
"{}/{}/uno/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));

let params = BuildParams {
project_dir: project_dir.clone(),
Expand Down Expand Up @@ -210,7 +214,11 @@ async fn build_uno_minimal() {
async fn compare_with_python_output() {
let project_dir = home_dir().join("dev/fbuild/tests/uno_minimal");

let python_hex = project_dir.join(".fbuild/build/uno/release/firmware.hex");
let python_hex = project_dir.join(format!(
"{}/{}/uno/release/firmware.hex",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
if !python_hex.exists() {
eprintln!(
"SKIP: Python build output not found at {}",
Expand All @@ -222,7 +230,11 @@ async fn compare_with_python_output() {

// Build with Rust
let tmp = tempfile::TempDir::new().unwrap();
let build_dir = tmp.path().join(".fbuild/build/uno/release");
let build_dir = tmp.path().join(format!(
"{}/{}/uno/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));

let params = BuildParams {
project_dir: project_dir.clone(),
Expand Down Expand Up @@ -317,7 +329,11 @@ void loop() {
)
.unwrap();

let build_dir = project_dir.join(".fbuild/build/uno/release");
let build_dir = project_dir.join(format!(
"{}/{}/uno/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
let params = BuildParams {
project_dir: project_dir.to_path_buf(),
env_name: "uno".to_string(),
Expand Down Expand Up @@ -438,7 +454,11 @@ fn stomp_mtimes(root: &Path, mtime: FileTime) {
}

fn fingerprint_path(project_dir: &Path) -> PathBuf {
project_dir.join(".fbuild/build/uno/release/build_fingerprint.json")
project_dir.join(format!(
"{}/{}/uno/release/build_fingerprint.json",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
))
}

/// RAII guard for an env var: sets it on construction, restores the previous
Expand Down Expand Up @@ -501,7 +521,11 @@ async fn cache_survives_tar_extract_uno() {

let cold_result = under_test_timeout(orchestrator.build(&uno_build_params(
&proj_a,
proj_a.join(".fbuild/build/uno/release"),
proj_a.join(format!(
"{}/{}/uno/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
)),
true,
)))
.await
Expand Down Expand Up @@ -533,7 +557,11 @@ async fn cache_survives_tar_extract_uno() {
// because of an orchestrator/fast-path bug unrelated to tar restoration.
let same_project_warm = under_test_timeout(orchestrator.build(&uno_build_params(
&proj_a,
proj_a.join(".fbuild/build/uno/release"),
proj_a.join(format!(
"{}/{}/uno/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
)),
false,
)))
.await
Expand Down Expand Up @@ -564,8 +592,16 @@ async fn cache_survives_tar_extract_uno() {
proj_b.display()
);
assert!(
proj_b.join(".fbuild/build").exists(),
"tar restore left no .fbuild/build/ at {}",
proj_b
.join(format!(
"{}/{}",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
))
.exists(),
"tar restore left no {}/{}/ at {}",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME,
proj_b.display()
);
assert_ne!(
Expand All @@ -578,7 +614,11 @@ async fn cache_survives_tar_extract_uno() {

let warm_result = under_test_timeout(orchestrator.build(&uno_build_params(
&proj_b,
proj_b.join(".fbuild/build/uno/release"),
proj_b.join(format!(
"{}/{}/uno/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
)),
false,
)))
.await
Expand Down
6 changes: 5 additions & 1 deletion crates/fbuild-build/tests/clangd_check_parity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ async fn clangd_check_parity_uno() {
install_test_compile_backend().await;

let tmp = tempfile::TempDir::new().expect("tempdir");
let build_dir = tmp.path().join(".fbuild/build/uno/release");
let build_dir = tmp.path().join(format!(
"{}/{}/uno/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));

let params = BuildParams {
project_dir: project_dir.clone(),
Expand Down
11 changes: 7 additions & 4 deletions crates/fbuild-build/tests/compile_many_stage2_perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,13 @@ Compiled 5/26 files
/// point) and embeds its head and tail so the failure is diagnosable after
/// the TempDir is dropped — FastLED/fbuild#1346.
fn stage2_failure_detail(r: &SketchResult) -> String {
let log_path = r
.log_path
.clone()
.unwrap_or_else(|| r.sketch.join(".fbuild/build/uno/release/compile_many.log"));
let log_path = r.log_path.clone().unwrap_or_else(|| {
r.sketch.join(format!(
"{}/{}/uno/release/compile_many.log",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
))
});
let log = fs::read_to_string(&log_path).unwrap_or_else(|e| {
format!(
"<compile_many.log unreadable at {}: {e}>",
Expand Down
4 changes: 2 additions & 2 deletions crates/fbuild-build/tests/compile_many_two_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ impl SketchBuilder for MockBuilder {
// bug we are trying to rule out.
let build_dir = inputs
.sketch
.join(".fbuild")
.join("build")
.join(fbuild_paths::FBUILD_DIR_NAME)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
.join(fbuild_paths::BUILD_DIR_NAME)
.join(&inputs.env_name)
.join(match inputs.profile {
BuildProfile::Release => "release",
Expand Down
18 changes: 15 additions & 3 deletions crates/fbuild-build/tests/eh_frame_strip_esp32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ async fn install_test_compile_backend() {
}

fn make_params(project_dir: &Path) -> BuildParams {
let build_dir = project_dir.join(".fbuild/build/esp32dev/release");
let build_dir = project_dir.join(format!(
"{}/{}/esp32dev/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
BuildParams {
project_dir: project_dir.to_path_buf(),
env_name: "esp32dev".to_string(),
Expand Down Expand Up @@ -141,7 +145,11 @@ async fn eh_frame_strip_drops_firmware_at_least_150kb() {
.elf_path
.clone()
.expect("preserve build should produce ELF path");
let preserve_firmware_bin = preserve_dir.join(".fbuild/build/esp32dev/release/firmware.bin");
let preserve_firmware_bin = preserve_dir.join(format!(
"{}/{}/esp32dev/release/firmware.bin",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
std::env::remove_var("FBUILD_KEEP_EH_FRAME");

// --- Build 2: strip eh_frame ---
Expand All @@ -156,7 +164,11 @@ async fn eh_frame_strip_drops_firmware_at_least_150kb() {
.elf_path
.clone()
.expect("strip build should produce ELF path");
let strip_firmware_bin = strip_dir.join(".fbuild/build/esp32dev/release/firmware.bin");
let strip_firmware_bin = strip_dir.join(format!(
"{}/{}/esp32dev/release/firmware.bin",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
std::env::remove_var("FBUILD_STRIP_EH_FRAME");

// --- firmware.bin delta ---
Expand Down
48 changes: 40 additions & 8 deletions crates/fbuild-build/tests/esp32_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ void loop() {
)
.unwrap();

let build_dir = project_dir.join(".fbuild/build/esp32dev/release");
let build_dir = project_dir.join(format!(
"{}/{}/esp32dev/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
let params = BuildParams {
project_dir: project_dir.to_path_buf(),
env_name: "esp32dev".to_string(),
Expand Down Expand Up @@ -187,7 +191,11 @@ void loop() {
)
.unwrap();

let build_dir = project_dir.join(".fbuild/build/esp32c6/release");
let build_dir = project_dir.join(format!(
"{}/{}/esp32c6/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
let params = BuildParams {
project_dir: project_dir.to_path_buf(),
env_name: "esp32c6".to_string(),
Expand Down Expand Up @@ -274,7 +282,11 @@ void loop() {
)
.unwrap();

let build_dir = project_dir.join(".fbuild/build/esp32c3/release");
let build_dir = project_dir.join(format!(
"{}/{}/esp32c3/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
let params = BuildParams {
project_dir: project_dir.to_path_buf(),
env_name: "esp32c3".to_string(),
Expand Down Expand Up @@ -362,7 +374,11 @@ void loop() {
)
.unwrap();

let build_dir = project_dir.join(".fbuild/build/esp32s3/release");
let build_dir = project_dir.join(format!(
"{}/{}/esp32s3/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
let params = BuildParams {
project_dir: project_dir.to_path_buf(),
env_name: "esp32s3".to_string(),
Expand Down Expand Up @@ -440,7 +456,11 @@ async fn build_esp32s3_fixture() {
}
install_test_compile_backend().await;

let build_dir = project_dir.join(".fbuild/build/esp32s3/release");
let build_dir = project_dir.join(format!(
"{}/{}/esp32s3/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
let params = BuildParams {
project_dir: project_dir.clone(),
env_name: "esp32s3".to_string(),
Expand Down Expand Up @@ -509,7 +529,11 @@ async fn build_nightdriverstrip_demo() {
install_test_compile_backend().await;

let tmp = tempfile::TempDir::new().unwrap();
let build_dir = tmp.path().join(".fbuild/build/demo/release");
let build_dir = tmp.path().join(format!(
"{}/{}/demo/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));

let params = BuildParams {
project_dir: project_dir.clone(),
Expand Down Expand Up @@ -595,7 +619,11 @@ async fn incremental_nightdriverstrip_no_changes() {
async fn incremental_build_at(project_dir: &std::path::Path, env_name: &str) {
// Verify there's an existing build
let build_marker = project_dir
.join(".fbuild/build")
.join(format!(
"{}/{}",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
))
.join(env_name)
.join("release/firmware.elf");
if !build_marker.exists() {
Expand Down Expand Up @@ -683,7 +711,11 @@ async fn incremental_nightdriverstrip_one_file_changed() {

let env_name = "demo";
let build_marker = project_dir
.join(".fbuild/build")
.join(format!(
"{}/{}",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
))
.join(env_name)
.join("release/firmware.elf");
if !build_marker.exists() {
Expand Down
6 changes: 5 additions & 1 deletion crates/fbuild-build/tests/nxplpc_build_flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ async fn lpc845brk_propagates_build_flags_to_library_compile_587() {

// Build into a temp dir so reruns are clean and don't litter the repo.
let tmp = tempfile::TempDir::new().expect("tempdir");
let build_dir = tmp.path().join(".fbuild/build/lpc845brk/release");
let build_dir = tmp.path().join(format!(
"{}/{}/lpc845brk/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));

let params = BuildParams {
project_dir: fixture.clone(),
Expand Down
14 changes: 10 additions & 4 deletions crates/fbuild-build/tests/nxplpc_core_compile_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ async fn build_core_repo(repo: &Path, env_name: &str) -> tempfile::TempDir {
let tmp = tempfile::TempDir::new().expect("tempdir");
let build_dir = tmp
.path()
.join(".fbuild/build")
.join(format!(
"{}/{}",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
))
.join(env_name)
.join("release");

Expand Down Expand Up @@ -96,9 +100,11 @@ async fn arduino_core_lpc845brk_compile_commands_match_platform_txt() {
return;
};
let tmp = build_core_repo(&repo, "lpc845brk").await;
let compile_db = tmp
.path()
.join(".fbuild/build/lpc845brk/release/compile_commands.json");
let compile_db = tmp.path().join(format!(
"{}/{}/lpc845brk/release/compile_commands.json",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
let text = fs::read_to_string(&compile_db).expect("compile_commands.json");
let entries: Vec<Value> = serde_json::from_str(&text).expect("valid compile database");
let args = entries
Expand Down
6 changes: 5 additions & 1 deletion crates/fbuild-build/tests/stm32_acceptance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ async fn stm32f103c8_blink_with_spi_auto_discovers_library_205_ac4() {
)
.unwrap();

let build_dir = project_dir.join(".fbuild/build/stm32f103c8/release");
let build_dir = project_dir.join(format!(
"{}/{}/stm32f103c8/release",
fbuild_paths::FBUILD_DIR_NAME,
fbuild_paths::BUILD_DIR_NAME
));
let params = BuildParams {
project_dir: project_dir.to_path_buf(),
env_name: "stm32f103c8".to_string(),
Expand Down
Loading
Loading