From 8fecb82f356b0a3f65b1ffd7f02f9c433353b5d6 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Thu, 27 Nov 2025 03:20:49 -0700 Subject: [PATCH] [MIRROR] test symlink support (#12035) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- tools/bootstrap/javascript.sh | 20 ++++++++++++++++++++ tools/bootstrap/javascript_.ps1 | 22 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/tools/bootstrap/javascript.sh b/tools/bootstrap/javascript.sh index 4ce45eeeb0..91d539638a 100755 --- a/tools/bootstrap/javascript.sh +++ b/tools/bootstrap/javascript.sh @@ -16,6 +16,26 @@ cd "$OldPWD" BunVersion="$BUN_VERSION" BunFullVersion="bun-v$BunVersion" +# Check if symlinks are supported in this directory +test_symlink_support() { + echo "Testing symlink support." + TMPDIR=$(mktemp -d) + TARGET="$TMPDIR/target.txt" + LINK="$TMPDIR/link.txt" + echo "test" > "$TARGET" + if ln -s "$TARGET" "$LINK" 2>/dev/null; then + rm -rf "$TMPDIR" + echo "Symlinks are supported." + return 0 + else + rm -rf "$TMPDIR" + echo "File system does not support symlinks. Compilation won't be possible." + exit 1 + fi +} + +test_symlink_support + # If Bun is not present, install using the official installer. if ! command -v bun >/dev/null 2>&1; then echo "Bun not found, installing with official installer..." diff --git a/tools/bootstrap/javascript_.ps1 b/tools/bootstrap/javascript_.ps1 index dbf9a7a9b8..136a278f4a 100644 --- a/tools/bootstrap/javascript_.ps1 +++ b/tools/bootstrap/javascript_.ps1 @@ -151,6 +151,28 @@ $BunExe = "$BunTargetDir\bun.exe" $BunZip = "$BunTargetDir\bun.zip" $CoreInfoExe = "$Cache\coreinfo\Coreinfo.exe" +function Test-SymlinkSupport { + Write-Output "Checking filesystem support" + + $fullBaseDir = Resolve-Path $BaseDir + + $driveLetter = Split-Path -Qualifier $fullBaseDir + $driveLetter = $driveLetter.TrimEnd(":\") + + $volume = Get-Volume -DriveLetter $driveLetter + $fsType = $volume.FileSystem + + if ($fsType -in @("FAT", "FAT32", "exFAT")) { + Write-Error "Compilation of code won't be possible. File system $fsType doesn't support symlinks" + exit 1 + } + + Write-Output "File system $fsType not in unsupported filesystems" +} + +## Check symlink support +Test-SymlinkSupport + ## Just print the path and exit if ($Args.length -eq 1 -and $Args[0] -eq "Get-Path") { Write-Output "$BunTargetDir"