Skip to content
Open
Changes from 1 commit
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
10 changes: 8 additions & 2 deletions installer/build-linux.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#!/bin/bash

set -euo pipefail

Copilot AI Mar 31, 2026

Copy link

Choose a reason for hiding this comment

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

Switching from virtualenv to python3 -m venv can fail on Debian/Ubuntu images that don’t have the python3-venv (and/or ensurepip) components installed, which would break the build at this step. Consider adding an explicit preflight check with a clear error message (e.g., instructing to install python3-venv) so failures are actionable.

Suggested change
# Preflight check: ensure that the Python venv module is available.
if ! python3 -m venv --help >/dev/null 2>&1; then
echo "Error: Python 'venv' module is not available for python3." >&2
echo "On Debian/Ubuntu, install it with: sudo apt-get install python3-venv" >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
python3 -m venv .venv

Comment on lines +3 to 6

Copilot AI Mar 31, 2026

Copy link

Choose a reason for hiding this comment

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

With set -euo pipefail, any failure in venv creation / dependency install / pyinstaller will exit the script before the teardown lines run, leaving .venv behind. If the intent is to always clean up, add an EXIT/ERR trap that performs deactivate (if defined) and rm -rf .venv, while still propagating the original failure status.

Copilot uses AI. Check for mistakes.
virtualenv -p python3 .venv
source ./.venv/bin/activate
pip install --upgrade pip
Comment thread
louiseschmidtgen marked this conversation as resolved.
Outdated
pip install -r requirements.txt

pyinstaller ./microk8s.spec
deactivate

deactivate 2>/dev/null || true
rm -rf .venv

Loading