Skip to content

Commit

Permalink
Install newer dh-virtualenv in Xenial builder
Browse files Browse the repository at this point in the history
Install dh-virtualenv from Debian Sid, switch to its alternative build
system, and tell it to use our pinned version of setuptools.
  • Loading branch information
rmol committed Sep 1, 2020
1 parent 74b6250 commit 1773732
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@
args:
chdir: "{{ securedrop_app_code_deb_dir }}"
environment:
DH_PIP_EXTRA_ARGS: "--verbose --ignore-installed --no-deps --no-binary=:all: --no-cache-dir"
DH_UPGRADE_SETUPTOOLS: "46.0.0"
DH_VIRTUALENV_ARGUMENTS: "--python=/usr/bin/python3.5 --setuptools"
DH_VIRTUALENV_INSTALL_ROOT: "/opt/venvs"
SETUPTOOLS_USE_DISTUTILS: "stdlib"

- name: Find newly built Debian package
find:
Expand Down
12 changes: 1 addition & 11 deletions install_files/securedrop-app-code/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DEB_DH_INSTALL_ARGS=-X .git
SECUREDROP_BUILD_PLATFORM=$(shell lsb_release -sc)

%:
dh $@ --with python-virtualenv --with systemd
dh $@ --buildsystem=dh_virtualenv --with systemd

override_dh_gencontrol:
dh_gencontrol -- $(SUBSTVARS)
Expand All @@ -24,16 +24,6 @@ override_dh_strip_nondeterminism:
find -type f -name RECORD -exec sed -i -e '/.*\.pyc.*/d' {} +
dh_strip_nondeterminism $@

override_dh_virtualenv:
dh_virtualenv \
--python=/usr/bin/python3.5 \
--setuptools \
--extra-pip-arg "--verbose" \
--extra-pip-arg "--ignore-installed" \
--extra-pip-arg "--no-deps" \
--extra-pip-arg "--no-binary=:all:" \
--extra-pip-arg "--no-cache-dir"

#
# Have to override the automatic service handling since we have more
# than one.
Expand Down
8 changes: 7 additions & 1 deletion molecule/builder-xenial/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ RUN apt-get -y update && apt-get upgrade -y && apt-get install -y \
devscripts \
dh-python \
dh-systemd \
dh-virtualenv \
gdb \
git \
gnupg2 \
Expand All @@ -36,4 +35,11 @@ RUN apt-get -y update && apt-get upgrade -y && apt-get install -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

#install dh-virtualenv from debian unstable
RUN echo "deb https://deb.debian.org/debian unstable main contrib" > /etc/apt/sources.list.d/debian-unstable.list
COPY aptpreferences.conf /etc/apt/preferences.d/debian-unstable
RUN apt-get install -y debian-archive-keyring
RUN ln -s /usr/share/keyrings/debian-archive-keyring.gpg /etc/apt/trusted.gpg.d/
RUN apt-get update && apt-get install -y dh-virtualenv

RUN paxctl -cm /usr/bin/python3.5 && mkdir -p /tmp/build
7 changes: 7 additions & 0 deletions molecule/builder-xenial/aptpreferences.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Package: *
Pin: release a=xenial
Pin-Priority: 700

Package: *
Pin: release a=unstable
Pin-Priority: 1

0 comments on commit 1773732

Please sign in to comment.