fix: resolve Windows Git Bash setup and startup compatibility issues#1630
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR targets developer-experience parity for running SecuScan natively on Windows via Git Bash by making the setup/start/test shell scripts resilient to Windows venv layouts and missing Unix-only tooling.
Changes:
- Detect and source the correct virtualenv activation path (
venv/Scriptsvsvenv/bin) across scripts. - Add a Windows-friendly port cleanup fallback in
start.shwhenlsofis unavailable. - Standardize runtime invocation inside venvs to use
python(instead ofpython3) and update frontend guidance text accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
testing/test_python.sh |
Adds Windows venv Scripts/ path handling for selecting venv python and activating the venv. |
start.sh |
Adds lsof/netstat+taskkill port cleanup fallback and Windows venv activation; adjusts interpreter usage. |
setup.sh |
Adds Windows venv Scripts/ activation and venv-python selection logic; updates manual-start instructions. |
frontend/start.sh |
Updates the printed backend-start instruction to use python instead of python3. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+59
to
+65
| # Determine python command | ||
| PYTHON_CMD="python3" | ||
| if ! command -v python3 &>/dev/null && command -v python &>/dev/null; then | ||
| if python -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else 1)' &>/dev/null; then | ||
| PYTHON_CMD="python" | ||
| fi | ||
| fi |
Comment on lines
+133
to
+145
| if [ -d "venv/Scripts" ]; then | ||
| VENV_BIN="venv/Scripts" | ||
| else | ||
| VENV_BIN="venv/bin" | ||
| fi | ||
|
|
||
| if [ -x "$VENV_BIN/python3" ]; then | ||
| VENV_PYTHON="$VENV_BIN/python3" | ||
| elif [ -x "$VENV_BIN/python" ]; then | ||
| VENV_PYTHON="$VENV_BIN/python" | ||
| else | ||
| VENV_PYTHON="$VENV_BIN/python3" | ||
| fi |
Comment on lines
+37
to
+49
| if [ -d "$VENV_DIR/Scripts" ]; then | ||
| VENV_BIN_DIR="$VENV_DIR/Scripts" | ||
| else | ||
| VENV_BIN_DIR="$VENV_DIR/bin" | ||
| fi | ||
|
|
||
| if [ -x "$VENV_BIN_DIR/python3" ]; then | ||
| VENV_PYTHON="$VENV_BIN_DIR/python3" | ||
| elif [ -x "$VENV_BIN_DIR/python" ]; then | ||
| VENV_PYTHON="$VENV_BIN_DIR/python" | ||
| else | ||
| VENV_PYTHON="$VENV_BIN_DIR/python3" | ||
| fi |
omnipotentchaos
force-pushed
the
fix/windows-git-bash-compat
branch
from
July 4, 2026 15:16
6946229 to
0fe7b9d
Compare
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves the compatibility issues encountered when setting up, running, and testing the SecuScan development environment natively on Windows via Git Bash (MINGW64).
Closes #1531
Changes Done
setup.sh,start.sh,testing/test_python.sh):venv/Scripts(Windows) andvenv/bin(Linux/macOS) layout.activatescript in Git Bash.start.sh):lsofcalls with a fallback chain checking fornetstatandtaskkillon Windows.|| trueto the pipeline commands to preventset -euo pipefailfrom exiting when no processes are listening on ports 8000/5173.pythoninstead ofpython3inside the virtual environment because Windows venvs only generatepython.exe.frontend/start.sh):pythoninstead ofpython3.Verification Details