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
42 changes: 23 additions & 19 deletions tests/ci_build/install-foundationdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,29 @@ sha256sum -c "${server_pkg}${hash_suffix}" || die "Server package verification f
cd - || die "Failed to change back to previous directory"

# Install the packages
echo "Installing FoundationDB packages..."
dpkg -i "${workspace}/${client_pkg}" "${workspace}/${server_pkg}" || die "Failed to install FoundationDB packages"

# Fix any missing dependencies
echo "Fixing missing dependencies..."
apt-get install -f -y || die "Failed to fix missing dependencies"

# Verify the installation
echo "Verifying FoundationDB installation..."
if command -v fdbcli &> /dev/null; then
echo "FoundationDB CLI installed successfully."
fdbcli --version
if grep -q Microsoft /proc/version && ! grep -q microsoft-standard /proc/version; then
echo "Running on WSL1: skipping FoundationDB installation."
else
Comment on lines +77 to 79
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the WSL1 branch you skip installation but still leave the downloaded files in the temporary workspace (cleanup only runs in the non-WSL1 branch or via die()). Add cleanup for the WSL1 path (or use a trap to always remove the workspace), and consider skipping downloads when you’re not installing anything.

Copilot uses AI. Check for mistakes.
echo "FoundationDB CLI installation failed."
exit 1
fi
echo "Installing FoundationDB packages..."
dpkg -i "${workspace}/${client_pkg}" "${workspace}/${server_pkg}" || die "Failed to install FoundationDB packages"
Comment on lines +77 to +81
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new WSL1 branch skips all FoundationDB installation, which means the FoundationDB headers/libs still won’t be present on WSL1 (the original compilation problem remains). If WSL1 can’t run the server, consider installing only the client package (or extracting just headers/libs) rather than skipping everything, and avoid downloading the server .deb in that case.

Copilot uses AI. Check for mistakes.

# Fix any missing dependencies
echo "Fixing missing dependencies..."
apt-get install -f -y || die "Failed to fix missing dependencies"

# Verify the installation
echo "Verifying FoundationDB installation..."
if command -v fdbcli &> /dev/null; then
echo "FoundationDB CLI installed successfully."
fdbcli --version
else
echo "FoundationDB CLI installation failed."
exit 1
fi

# Clean up temporary workspace
echo "Removing temporary workspace..."
rm -r "${workspace:?}"
# Clean up temporary workspace
echo "Removing temporary workspace..."
rm -r "${workspace:?}"

echo "FoundationDB installation completed successfully."
echo "FoundationDB installation completed successfully."
fi
Comment on lines +77 to +102

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There are two issues with this block of code:

  1. Contradiction with PR description: The code skips the FoundationDB installation on WSL1, but the pull request description states that it should install the FDB libraries and header files.
  2. Resource leak: The temporary workspace (${workspace}) is only cleaned up in the else branch. This means on WSL1, the workspace directory and its contents are never removed.

I suggest refactoring this section to correctly handle the WSL1 case as described, and to move the common steps like dependency fixing, verification, and cleanup outside the conditional block to avoid code duplication and fix the resource leak.

if grep -q Microsoft /proc/version && ! grep -q microsoft-standard /proc/version; then
	echo "Running on WSL1: installing FoundationDB client package..."
	dpkg -i "${workspace}/${client_pkg}" || die "Failed to install FoundationDB client package"
else
	echo "Installing FoundationDB packages..."
	dpkg -i "${workspace}/${client_pkg}" "${workspace}/${server_pkg}" || die "Failed to install FoundationDB packages"
fi

# Fix any missing dependencies
echo "Fixing missing dependencies..."
apt-get install -f -y || die "Failed to fix missing dependencies"

# Verify the installation
echo "Verifying FoundationDB installation..."
if command -v fdbcli &> /dev/null; then
	echo "FoundationDB CLI installed successfully."
	fdbcli --version
else
	echo "FoundationDB CLI installation failed."
	exit 1
fi

# Clean up temporary workspace
echo "Removing temporary workspace..."
rm -r "${workspace:?}"

echo "FoundationDB installation completed successfully."

6 changes: 1 addition & 5 deletions tests/setup_machine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,7 @@ if [ ! -f /etc/sudoers.d/saunafstest ] || ! grep -q '# FoundationDB' /etc/sudoer
fi

echo ; echo 'Install FoundationDB'
if grep -q Microsoft /proc/version && ! grep -q microsoft-standard /proc/version; then
echo "Running on WSL1: skipping FoundationDB installation."
else
"$script_dir/ci_build/install-foundationdb.sh"
fi
"$script_dir/ci_build/install-foundationdb.sh"
Comment on lines 197 to +198
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup_machine.sh now always runs install-foundationdb.sh, but that script currently still skips installation on WSL1. If the goal is to ensure WSL1 has FoundationDB headers/libs for compilation, this change won’t achieve it unless install-foundationdb.sh installs (at least) the client package on WSL1.

Copilot uses AI. Check for mistakes.

echo ; echo 'Fixing GIDs of users'
for name in saunafstest saunafstest_{0..9}; do
Expand Down