Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ jobs:
run: |
python -m venv "$RUNNER_TEMP/ttp-runtime"
bash scripts/install_locked.sh "$RUNNER_TEMP/ttp-runtime/bin/python" runtime
# Again over the first: scripts/install.sh upgrades a source install this way.
bash scripts/install_locked.sh "$RUNNER_TEMP/ttp-runtime/bin/python" runtime
"$RUNNER_TEMP/ttp-runtime/bin/ttp" --help >/dev/null
"$RUNNER_TEMP/ttp-runtime/bin/ttp" start --help >/dev/null
"$RUNNER_TEMP/ttp-runtime/bin/ttp" config --help >/dev/null
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- `scripts/install.sh` could not upgrade a source install. It installs the
wheel with `installer`, which refuses to overwrite a file, so a second run
stopped at `/opt/ttp/venv/bin/ttp` with `FileExistsError`, possibly after
part of the new version was already written. The previous version is now
uninstalled from the venv first, and `/opt/ttp/ttp` is replaced rather than
copied over, so modules a release removed do not linger. CI installs the
runtime twice into one venv.

### Tests

- The `nse` extra requires `network-sandbox-engine>=2.9.0`. In 2.9.0 a
Expand Down
10 changes: 10 additions & 0 deletions docs/web/release-notes/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- `scripts/install.sh` could not upgrade a source install. It installs the
wheel with `installer`, which refuses to overwrite a file, so a second run
stopped at `/opt/ttp/venv/bin/ttp` with `FileExistsError`, possibly after
part of the new version was already written. The previous version is now
uninstalled from the venv first, and `/opt/ttp/ttp` is replaced rather than
copied over, so modules a release removed do not linger. CI installs the
runtime twice into one venv.

### Tests

- The `nse` extra requires `network-sandbox-engine>=2.9.0`. In 2.9.0 a
Expand Down
2 changes: 2 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ echo "[TTP] Starting system-wide installation..."
# This follows Linux best practices for optional/third-party software.
echo "[TTP] Deploying files to /opt/ttp..."
mkdir -p /opt/ttp
# A copy, not a merge: modules a newer release removed must not linger.
rm -rf /opt/ttp/ttp
cp -r ttp /opt/ttp/
cp -r assets /opt/ttp/
cp pyproject.toml /opt/ttp/
Expand Down
2 changes: 2 additions & 0 deletions scripts/install_locked.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ if [ "$profile" != docs ]; then
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
"$python" -m build --no-isolation --wheel --outdir "$work" "$source_dir"
# installer never overwrites: without this, re-running install.sh to upgrade stops at bin/ttp.
"$python" -m pip uninstall --yes --quiet transparent-tor-proxy
"$python" -m installer "$work"/*.whl
fi
"$python" -m pip check