Skip to content
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

Creates a symlink to the .so file in postint for mod_wsgi #5489

Closed
wants to merge 1 commit into from

Conversation

kushaldas
Copy link
Contributor

Status

Ready for review

Description of Changes

Fixes in part of #4768

On Focal, mod_wsgi expects a shared library for the python module at:

$VENV/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.so

But, the real shared library path is

$VENV/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so"

So we are creating a symlink with the proper path if we are using Python 3.8 (that is on Focal)

Testing

  • make build-deps on this branch
  • make staging to create a fresh staging environment from the debian packages. There should not be any error in the postinstall section
  • Login to app molecule -s libvirt-staging-xenial -h app-staging (on mac point to virtualbox) and see that the following file does not exist.
/opt/venvs/securedrop-app-code/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.so
  • sudo touch /usr/bin/python3.8 to emulate a python3.8 env in focal
  • reinstall the securedrop-app-code package or reconfigure it, it should create a symlink as mentioned above.

Deployment

Any special considerations for deployment? Consider both:

  1. Upgrading existing production instances.
  2. New installs.

Checklist

If you made changes to the server application code:

  • Linting (make lint) and tests (make test) pass in the development container

If you made changes to securedrop-admin:

  • Linting and tests (make -C admin test) pass in the admin development container

If you made changes to the system configuration:

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

If you made changes to documentation:

  • Doc linting (make docs-lint) passed locally

If you added or updated a code dependency:

Choose one of the following:

  • I have performed a diff review and pasted the contents to the packaging wiki
  • I would like someone else to do the diff review

On Focal, mod_wsgi expects a shared library for the python
module at:
$VENV/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.so

But, the real shared library path is

$VENV/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so"

So we are creating a symlink with the proper path if we are using
Python 3.8
@kushaldas
Copy link
Contributor Author

This is continuation of #5443

@rmol
Copy link
Contributor

rmol commented Sep 11, 2020

I finally figured out why the mod_wsgi configuration was broken. The Ubuntu box used in the libvirt staging environment somehow lacks the python3-distutils package. When running mod_wsgi-express module-config, that causes this import to fail, bypassing the determination of the shared library naming scheme, specifically this.

The generic Ubuntu installation used in the Qubes staging environment has python3-distutils by default, so I never saw this failure.

I think the best fix is adding python3-distutils as a dependency of securedrop-app-code, which I've done in #5484. So now if you build the Focal debs on that branch, then check out the branch of #5486, you get a working mod_wsgi configuration.

@conorsch
Copy link
Contributor

Thanks for the clarification, @rmol. #5484 is now merged, and #5486 has been rebased to include it, so we should be unblocked to proceed with review over there.

@kushaldas Should we then close this PR? Or would you prefer to test #5486 first?

@kushaldas
Copy link
Contributor Author

I thought I closed this one, it seems I only closed the issue and forgot the pr.

@kushaldas kushaldas closed this Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants