Skip to content

Conversation

@conorsch
Copy link
Contributor

The Python app code we ship to dom0 only uses stdlib imports, or else imports that are OS-provided in dom0, suhc as the Qt bindings. Therefore we don't need to use the "setup.py" and "pip install" intermediate build steps, because there's no additional dependency resolution via pip that we care about: we just want to ship *.py files.

This change updates the RPM build logic to use "install" declarations directly, via build-in-place.

Other small improvements:

  • tacks on a .dockerignore file as a best practice
  • touches up the "hostname" logic in the Makefile, to silence a warning about "hostname" not being on PATH for the container

The built RPM works the same in dom0. I'd actually like to drop the container logic altogether and build directly from system-provided tooling like "rpmbuild", but punting on that now, as it's a more substantive change to build tooling.

Test plan

You should compare an RPM built from this branch with one built from main:

git switch -c review-simple-rpm-before main
make build-rpm
fd --no-ignore -e rpm -x cp {} before.rpm
git switch -c review-simple-rpm-after simpler-rpm-build
make build-rpm
fd --no-ignore -e rpm -x cp {} after.rpm
diffoscope before.rpm after.rpm

and review the output. Additionally, it'd be good to check that a make clean && make clone && make dev works as expected, but that'll take a while.

Checklist

Should be pretty complete. Note that the PR removes mention of the MANIFEST.in file from the description below, because the file itself is removed.

This change accounts for:

  • any necessary RPM packaging updates (e.g., added/removed files, see MANIFEST.in and rpm-build/SPECS/securedrop-workstation-dom0-config.spec)
  • any required documentation

The Python app code we ship to dom0 only uses stdlib imports,
or else imports that are OS-provided in dom0, suhc as the Qt bindings.
Therefore we don't need to use the "setup.py" and "pip install"
intermediate build steps, because there's no additional dependency
resolution via pip that we care about: we just want to ship *.py files.

This change updates the RPM build logic to use "install" declarations
directly, via build-in-place.

Other small improvements:

   * tacks on a `.dockerignore` file as a best practice
   * touches up the "hostname" logic in the Makefile, to silence
     a warning about "hostname" not being on PATH for the container

The built RPM works the same in dom0. I'd actually like to drop
the container logic altogether and build directly from system-provided
tooling like "rpmbuild", but punting on that now, as it's a more
substantive change to build tooling.
@conorsch conorsch requested a review from a team as a code owner February 11, 2026 01:13
RUN if test $USER_NAME != root ; then \
useradd --no-create-home --home-dir /tmp --uid $USER_ID $USER_NAME \
&& echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers ; \
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These containerfile changes aren't strictly necessary, but they satisfy a few hadolint suggestions, and as long as we're breaking the container image cache by updating the spec file, might as well do some spring cleaning. Refs #1532.

@conorsch conorsch moved this to Ready For Review in SecureDrop Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

1 participant