Repository navigation
Studio: keep commands and modules from a second sandboxed pip install - #16018
Conversation
|
Reached Codex review convergence at NilayYadav#955 on 488cb47. |
|
Reached Codex review convergence at NilayYadav#955 on 8201118. |
pip --prefix with --ignore-installed never uninstalls, so reinstalling another version left the old dist-info beside the new one and importlib.metadata could report the old version. The sandbox shim now drops a project's older dist-info folders under PIP_PREFIX at interpreter start and exit. Also mirror pip's osx_framework_library -> posix_prefix remap for prefix installs. [skip ci]
[skip ci]
Debian's posix_local scheme installs console scripts to local/bin, which PATH and approved host calls never searched. Derive it from the same scheme as the library dirs, keeping the bare bin/Scripts for packages installed with pip --target. [skip ci]
On Windows the nt scheme's stdlib/include paths stay on the Python install drive, so taking relpath of every entry raised ValueError at import when Studio ran from another drive.
…16108) Since #16031 (test-launch sd.cpp binaries without the Windows missing-DLL box), the AV shapes lint finds a new error on main. Every PR's `Source lint` job and the `test_lint_av_shapes.py::test_the_repository_is_clean_against_its_baseline` test in the CPU shards fail on it, for example on #16018 and #15994: ``` studio/backend/tests/test_sd_cpp_probe_error_mode.py:221: [AV009] error: copies a Windows system binary line: shutil.copy(getattr(sys, "_base_executable", sys.executable), binary) 1 new error(s). ``` `test_a_real_binary_missing_its_dll_is_reported_unrunnable` copies `python.exe` into `tmp_path` as `sd-server.exe`, away from `pythonXY.dll`, and cuts `PATH` to System32. The result is a real PE whose loader fails with `STATUS_DLL_NOT_FOUND`, the same failure as an sd.cpp ROCm build without HIP. The lint's suggested replacement, `windows_console_stub.py`, links nothing and starts fine, so it cannot produce that failure. The copy has to stay. The lint documents this route for that case: the finding is recorded in `scripts/av_shapes_baseline.json` with the reason. The entry carries the digest of that one line, so any other copy in the file is still a new error. I did not use `--update`. It would also have pruned many unrelated stale entries across the baseline. This adds the one group (9 lines). The CI message also prints an AV010 warning for `.github/workflows/studio-tauri-smoke.yml:374` first, but warnings do not fail the check. With only this entry added, the test passes. ## Verification - `python scripts/lint_av_shapes.py`: `1 new error(s)` on main, `0 new errors` here. - `tests/security/test_lint_av_shapes.py::test_the_repository_is_clean_against_its_baseline`: fails on main on the AV009 line, passes here. The rest of the file passes (19 passed). - `--self-test` still passes, since the lint is unchanged.
|
Review record for #16018, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#639. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
In a sandboxed chat (bubblewrap on Linux, Seatbelt on macOS, the Windows container), every pip install went into one shared package folder with pip's --target mode. That mode skips any top level folder that already exists and still reports success. So a later install silently lost its parts: after
pip install requests,pip install gdownsucceeded butgdownwas then "command not found", a package sharing a namespace folder with an earlier one (such as thegooglepackages) lost its modules, and installing idna 3.10 over 3.7 left 3.7 in use.Sandboxed installs now use pip's prefix layout inside the same folder, which pip fills file by file, so each new package lands next to the earlier ones. Its commands stay on PATH as before, and packages that older chats installed in the old layout still import.