Skip to content

Commit c911c6a

Browse files
committed
fix(repo): resolve FreeBSD build disk space issue (#35030)
## Current Behavior The FreeBSD native build in the publish workflow runs out of disk space (`No space left on device`). The VM has an 11G disk and the Rust build fills it completely. The build was already on the edge — the Mar 25 run succeeded with only 11MB to spare, and the Mar 26 run failed after rustc 1.94.1 slightly increased artifact sizes. A major contributor is OpenJDK17 and its ~30 X11/font dependencies (~500MB) being installed solely for the `@nx/gradle` plugin's project graph step, which is irrelevant to building native Rust bindings. ## Expected Behavior The FreeBSD build completes successfully with comfortable disk headroom by disabling the Gradle plugin via `NX_GRADLE_DISABLE=true`, which eliminates the need for Java and its heavy dependency tree. ## Related Issue(s) Fixes the FreeBSD build failure: https://github.com/nrwl/nx/actions/runs/23613960439/job/68776656960 (cherry picked from commit 9747038)
1 parent 0cc9d70 commit c911c6a

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -419,21 +419,18 @@ jobs:
419419
NX_PREFER_TS_NODE: true
420420
PLAYWRIGHT_BROWSERS_PATH: 0
421421
NODE_VERSION: 22.16.0
422+
NX_GRADLE_DISABLE: 'true'
422423
with:
423424
operating_system: freebsd
424425
version: '14.0'
425426
architecture: x86-64
426-
environment_variables: DEBUG RUSTUP_IO_THREADS CI NX_PREFER_TS_NODE PLAYWRIGHT_BROWSERS_PATH NODE_VERSION
427+
environment_variables: DEBUG RUSTUP_IO_THREADS CI NX_PREFER_TS_NODE PLAYWRIGHT_BROWSERS_PATH NODE_VERSION NX_GRADLE_DISABLE
427428
shell: bash
428429
run: |
429430
env
430431
whoami
431-
sudo pkg install -y -f node libnghttp2 www/npm git openjdk17
432+
sudo pkg install -y -f node libnghttp2 www/npm git ca_root_nss
432433
sudo npm install --location=global --ignore-scripts [email protected]
433-
# Set up Java 17
434-
export JAVA_HOME=/usr/local/openjdk17
435-
export PATH="$JAVA_HOME/bin:$PATH"
436-
java --version
437434
curl https://sh.rustup.rs -sSf --output rustup.sh
438435
sh rustup.sh -y --profile minimal --default-toolchain stable
439436
source "$HOME/.cargo/env"
@@ -489,9 +486,7 @@ jobs:
489486
pnpm store prune || true
490487
rm -rf ~/.npm || true
491488
rm -rf ~/.pnpm-store || true
492-
# Remove Rust build artifacts if any
493-
rm -rf ~/.cargo/registry || true
494-
rm -rf ~/.cargo/git || true
489+
# Clean Rust extras but keep registry/git (needed for cargo to resolve deps)
495490
rm -rf ~/.rustup/toolchains/*/share || true
496491
# Remove other development tool caches
497492
rm -rf ~/.cache/* || true

packages/nx/src/native/utils/command.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ const CREATE_NO_WINDOW: u32 = 0x08000000;
1111
/// Use this instead of `Command::new()` directly to avoid spawning visible
1212
/// console windows from background/daemon processes.
1313
pub fn create_command(program: &str) -> Command {
14-
let cmd = Command::new(program);
1514
#[cfg(target_os = "windows")]
16-
cmd.creation_flags(CREATE_NO_WINDOW);
17-
cmd
15+
{
16+
let mut cmd = Command::new(program);
17+
cmd.creation_flags(CREATE_NO_WINDOW);
18+
cmd
19+
}
20+
#[cfg(not(target_os = "windows"))]
21+
{
22+
Command::new(program)
23+
}
1824
}
1925

2026
/// Creates a shell `Command` (`cmd /C` on Windows, `sh -c` elsewhere)

0 commit comments

Comments
 (0)