-
Notifications
You must be signed in to change notification settings - Fork 18
chore(wsl1): Fix consistent FDB deps install LS-379 #769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| 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
|
||
|
|
||
| # 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two issues with this block of code:
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." |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
|
||
|
|
||
| echo ; echo 'Fixing GIDs of users' | ||
| for name in saunafstest saunafstest_{0..9}; do | ||
|
|
||
There was a problem hiding this comment.
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.