Skip to content
Closed
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/dylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ jobs:
# 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
find crates -type f -name '*.rs' -exec 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
12 changes: 6 additions & 6 deletions crates/fbuild-cli/tests/ci_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ fn run_cli_or_timeout(mut cmd: Command) -> Output {

#[test]
fn ci_help_lists_pio_compat_flags() {
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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 @@ -77,8 +77,8 @@ fn ci_help_lists_pio_compat_flags() {

#[test]
fn ci_without_board_is_a_usage_error() {
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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 @@ -94,8 +94,8 @@ fn ci_without_board_is_a_usage_error() {

#[test]
fn ci_without_sketches_is_a_usage_error() {
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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: 4 additions & 3 deletions crates/fbuild-cli/tests/daemon_crash_recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ fn free_port() -> u16 {
}

fn cli_command(args: &[&str], port: u16, cache_dir: &std::path::Path) -> Command {
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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 @@ -175,7 +175,8 @@ fn client_recovers_after_daemon_is_killed_uncleanly() {
// 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(
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild"),
std::env::var("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
Expand Down
12 changes: 6 additions & 6 deletions crates/fbuild-cli/tests/lib_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +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 =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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 @@ -77,8 +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 =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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 @@ -103,8 +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 =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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
8 changes: 4 additions & 4 deletions crates/fbuild-cli/tests/test_emu_exit_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ fn deploy_output_survives_nonzero_exit() {
let port = spawn_mock_daemon(Arc::clone(&stop));

let project = make_test_project();
let bin =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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 @@ -216,8 +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 =
option_env!("CARGO_BIN_EXE_fbuild").expect("cargo test must provide CARGO_BIN_EXE_fbuild");
let bin = std::env::var("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
2 changes: 1 addition & 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,7 @@ 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 = option_env!("CARGO_BIN_EXE_fbuild-daemon")
let bin = std::env::var("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"
Expand Down
6 changes: 3 additions & 3 deletions crates/fbuild-daemon/tests/port_recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ 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 = option_env!("CARGO_BIN_EXE_fbuild-daemon")
let bin = std::env::var("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.
let mut d1 = Command::new(bin)
let mut d1 = Command::new(&bin)
.env("FBUILD_DAEMON_PORT", port.to_string())
.stdout(Stdio::null())
.stderr(Stdio::null())
Expand Down Expand Up @@ -96,7 +96,7 @@ fn daemon_rebinds_cleanly_after_hard_kill_with_open_connection() {
// With a *correct* fix (graceful shutdown + SO_EXCLUSIVEADDRUSE
// on Windows) this should succeed without permissive REUSEADDR.
// allow-direct-spawn: test driver spawns the real fbuild-daemon binary under test.
let mut d2 = Command::new(bin)
let mut d2 = Command::new(&bin)
.env("FBUILD_DAEMON_PORT", port.to_string())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down
2 changes: 1 addition & 1 deletion crates/fbuild-daemon/tests/process_containment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ 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 = option_env!("CARGO_BIN_EXE_containment_harness")
let harness = std::env::var("CARGO_BIN_EXE_containment_harness")
.expect("cargo test must provide CARGO_BIN_EXE_containment_harness");

// Start the parent role.
Expand Down
Loading