-
Notifications
You must be signed in to change notification settings - Fork 8
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
Postinstall scripts can fail silently when executed incorrectly #66
Comments
Resolution will be a partial implementation of #19, switching to a static data-driven postinstall script that reads a JSON layer config file from
Reading the JSON file on every startup would have been pointlessly slow, so The post-install script implementation will be importable at build time, so the build environment |
* Allow postinstall scripts to be executed with any Python interpreter (not just the deployed base runtime interpreter) * Generate layer config file as part of layers * Use a common postinstall script in all layers * Generate the deployed `sitecustomize.py` file from the layer config in the postinstall script * Add unit tests for the common postinstall script Closes #66. Implements initial steps towards #19.
The updates for #66 are substantially changing the way the deployed environment checks work in the test suite. To make that change easier to review, first deduplicate the deployed environment checking code.
The updates for #66 are substantially changing the way the deployed environment checks work in the test suite. To make that change easier to review, first deduplicate the deployed environment checking code.
While working on #24/#64, I found a problem where the postinstall scripts will do the wrong thing if executed with something other than the expected base runtime environment (
pyvenv.cfg
gets populated incorrectly, so the layered environment ends up referencing the wrong copy of the base runtime environment).LM Studio itself does this right, so it didn't hit the problem. The test suite is doing it wrong, but wasn't failing due to the deployed environments and build environments both existing in the CI environment.
The new automatic layer versioning tests in #64 picked up the problem because the expected contents of
sys.path
now differ between the built environments and the deployed environments fortest_sample_project
, making the misconfigured environments fail their checks (on Windows - the symlinked environments on Linux and macOS still worked due to the way CPython behaves when run via a symlink, even withoutpyvenv.cfg
being set up yet).The text was updated successfully, but these errors were encountered: