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
7 changes: 4 additions & 3 deletions .github/workflows/dylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,10 @@ jobs:
env:
FBUILD_PLATFORM_BOUNDARY_OBSERVED: ${{ github.workspace }}/target/platform-boundary-dylint-observed.tsv
run: |
# Force fresh traversal so the independent observation ledger sees
# every platform-gated source path on each run.
export RUSTFLAGS="${RUSTFLAGS:+${RUSTFLAGS} }--cfg fbuild_platform_boundary_observation_run_${GITHUB_RUN_ID}"
# Force fresh workspace traversal for the observation ledger while
# preserving Cargo's cached dependencies. A per-run RUSTFLAGS value
# invalidated every dependency, causing a cold rebuild on each run.
rg --files crates -g '*.rs' -0 | xargs -0 -r touch
rm -f "$FBUILD_PLATFORM_BOUNDARY_OBSERVED"
env -u RUSTUP_TOOLCHAIN soldr dylint --all -- --workspace --all-targets
- name: Compare scanner with actual Dylint observations
Expand Down
9 changes: 6 additions & 3 deletions crates/fbuild-cli/tests/ci_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ fn run_cli_or_timeout(mut cmd: Command) -> Output {

#[test]
fn ci_help_lists_pio_compat_flags() {
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
// allow-direct-spawn: integration test driver invoking the compiled fbuild binary.
let mut cmd = Command::new(bin);
cmd.args(["ci", "--help"]);
Expand Down Expand Up @@ -76,7 +77,8 @@ fn ci_help_lists_pio_compat_flags() {

#[test]
fn ci_without_board_is_a_usage_error() {
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
// allow-direct-spawn: integration test driver.
let mut cmd = Command::new(bin);
cmd.args(["ci", "examples/Blink/Blink.ino"]);
Expand All @@ -92,7 +94,8 @@ fn ci_without_board_is_a_usage_error() {

#[test]
fn ci_without_sketches_is_a_usage_error() {
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
// allow-direct-spawn: integration test driver.
let mut cmd = Command::new(bin);
cmd.args(["ci", "--board", "uno"]);
Expand Down
7 changes: 5 additions & 2 deletions crates/fbuild-cli/tests/daemon_crash_recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ fn free_port() -> u16 {
}

fn cli_command(args: &[&str], port: u16, cache_dir: &std::path::Path) -> Command {
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
// allow-direct-spawn: test driver invoking the fbuild CLI binary under test.
let mut command = Command::new(bin);
command
Expand Down Expand Up @@ -173,7 +174,9 @@ fn client_recovers_after_daemon_is_killed_uncleanly() {
// The production spawn path resolves the daemon binary as a sibling of
// the CLI. Under `cargo test --workspace` (and any full build) it exists;
// under an isolated `-p fbuild-cli` test run it may not — skip then.
let cli = NormalizedPath::new(env!("CARGO_BIN_EXE_fbuild"));
let cli = NormalizedPath::new(
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild"),
);
let daemon_name = fbuild_core::platform::executable::name("fbuild-daemon", "fbuild-daemon.exe");
let sibling = cli
.parent()
Expand Down
9 changes: 6 additions & 3 deletions crates/fbuild-cli/tests/lib_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ fn run_cli_or_timeout(mut cmd: Command) -> Output {
/// `fbuild lib-select --help` must exit 0 and document both modes.
#[test]
fn lib_select_help_lists_command() {
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
// allow-direct-spawn: integration test driver invoking the compiled fbuild binary.
let mut cmd = Command::new(bin);
cmd.args(["lib-select", "--help"]);
Expand Down Expand Up @@ -76,7 +77,8 @@ fn lib_select_help_lists_command() {
/// the precise code, only that callers (CI, scripts) can detect the error.
#[test]
fn lib_select_missing_project_exits_nonzero() {
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
// allow-direct-spawn: integration test driver invoking the compiled fbuild binary.
let mut cmd = Command::new(bin);
cmd.args([
Expand All @@ -101,7 +103,8 @@ fn lib_select_missing_project_exits_nonzero() {
/// Passing both must fail at argument-parse time, not silently pick one.
#[test]
fn lib_select_explain_and_json_conflict() {
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
// allow-direct-spawn: integration test driver invoking the compiled fbuild binary.
let mut cmd = Command::new(bin);
cmd.args(["lib-select", ".", "--explain", "--json"]);
Expand Down
6 changes: 4 additions & 2 deletions crates/fbuild-cli/tests/test_emu_exit_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ fn deploy_output_survives_nonzero_exit() {
let port = spawn_mock_daemon(Arc::clone(&stop));

let project = make_test_project();
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");

// allow-direct-spawn: integration test driver that invokes the compiled fbuild binary.
let mut cmd = Command::new(bin);
Expand Down Expand Up @@ -215,7 +216,8 @@ fn test_emu_exits_non_zero_when_daemon_returns_failure() {
let port = spawn_mock_daemon(Arc::clone(&stop));

let project = make_test_project();
let bin = env!("CARGO_BIN_EXE_fbuild");
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");

// Drive the CLI at the mock daemon. We clear FBUILD_DEV_MODE so the
// CLI sticks to prod-mode path assumptions, and pin
Expand Down
3 changes: 2 additions & 1 deletion crates/fbuild-daemon/tests/legacy_daemon_transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ async fn wait_for_http_health(port: u16, timeout: Duration) -> bool {
async fn real_daemon_root_ownership_released_on_kill() {
let temp_home = tempfile::tempdir().expect("temp home");
let port = free_port();
let bin = env!("CARGO_BIN_EXE_fbuild-daemon");
let bin = option_env!("CARGO_BIN_EXE_fbuild-daemon")
.expect("cargo test must provide CARGO_BIN_EXE_fbuild-daemon");
let home_key = if fbuild_core::platform::host::is_windows() {
"USERPROFILE"
} else {
Expand Down
3 changes: 2 additions & 1 deletion crates/fbuild-daemon/tests/port_recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ fn wait_with_timeout(child: &mut Child, budget: Duration) -> bool {
#[ignore = "expects a real fbuild-daemon binary; run with --ignored"]
fn daemon_rebinds_cleanly_after_hard_kill_with_open_connection() {
let port: u16 = 18900; // dedicated test port, avoids 8765 collisions
let bin = env!("CARGO_BIN_EXE_fbuild-daemon");
let bin = option_env!("CARGO_BIN_EXE_fbuild-daemon")
.expect("cargo test must provide CARGO_BIN_EXE_fbuild-daemon");

// 1) Spawn the first daemon.
// allow-direct-spawn: test driver spawns the real fbuild-daemon binary under test.
Expand Down
3 changes: 2 additions & 1 deletion crates/fbuild-daemon/tests/process_containment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ fn wait_with_timeout(child: &mut Child, budget: Duration) -> bool {
#[test]
#[ignore = "spawns real subprocesses and issues hard-kills; run with --ignored"]
fn daemon_children_die_when_daemon_dies() {
let harness = env!("CARGO_BIN_EXE_containment_harness");
let harness = option_env!("CARGO_BIN_EXE_containment_harness")
.expect("cargo test must provide CARGO_BIN_EXE_containment_harness");

// Start the parent role.
// allow-direct-spawn: integration-test driver invoking the containment harness binary.
Expand Down
Loading