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

Installs python-fixtures in Whonix VMs only when necessary #190

Merged
merged 3 commits into from
Nov 8, 2018

Conversation

conorsch
Copy link
Contributor

@conorsch conorsch commented Nov 6, 2018

The qvm-run command ensuring that python-fixtures was present in the Whonix templates was flakey, causing several developers (myself included) to omit it when testing locally to avoid problems. Made it more stable by checking whether the library is available before running the apt commands.

Also finetuned the dependency declaration in the related Salt commands, so that python-fixtures is always present before Salt commands are run against the associated VMs. Increased verbosity of the Salt output, as well, since the default behavior was masking highly informative error output.

Closes #184.

Testing

  1. Run make all in dom0, confirm no errors
  2. Run make test in dom0, confirm no errors.

If you see failing tests in step 2 regarding uninstalled updates, run sudo securedrop-update, then re-run make test.

Conor Schaefer added 3 commits November 5, 2018 20:51
The Whonix 14 templates lack `python-futures`, due to their dependency
on an older version of the debian-9-minimal Template, so Salt cannot be
used against them out of of the box. We must ensure the package is
present in order to use Salt.

Since updating apt lists can a while, especially over Tor, let's first
check whether the package is present by trying to import it, and skip if
so. Otherwise, we'll proceed with the apt list update and install
command.

The other significant change here is more explicit dependency
declaration, so that the python-futures task is guaranteed to finish
before any Salt-related tasks are run against the child VMs.
The proper syntax for Salt dependencies is:

  require:
    - <pkg>: <name>

Omitting the Salt package name was causing failures in setting up the
apt repo in the securedrop-workstation template. Resolved.
The default behavior of `qubesctl` is to mask details of command
execution, for brevity. That masking makes debugging quite difficult, so
let's display the output by default to developers.
Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried several times to reproduce the error described in #184 but was unable to.
Soon qubes 4.0.1 will be released that will likely solve this problem as whonix-14 templates are included by default[0], and we will be able to use those as a base.

make all and make test do indeed complete successfully, and a visual review of this diff does indeed make the install logic more verbose, robust and less failure-prone. Unfortunately I cannot validate the fix functionally since I cannot reproduce the error, but will not immediately merge so that others which were experiencing the issue can chime in.

[0] https://www.qubes-os.org/news/2018/11/05/qubes-401-rc1/

@emkll
Copy link
Contributor

emkll commented Nov 8, 2018

I just experienced this issue right now, and can confirm this fixes the issue. Thanks @conorsch, merging!

@emkll emkll merged commit be67502 into master Nov 8, 2018
@emkll emkll deleted the 184-whonix-python-fixtures-only-when-necessary branch November 8, 2018 03:17
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.

Whonix update error
2 participants