[tbb-commits] [tor-browser-build/master] Bug 29235: Build our own version of python3.6

gk at torproject.org gk at torproject.org
Fri Feb 1 18:28:59 UTC 2019


commit 66a0ab022c3c539a3756771cf72e793fa2e861e7
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Wed Jan 30 20:54:51 2019 +0100

    Bug 29235: Build our own version of python3.6
    
    The build of HTTPS-Everywhere requires python3.6, however the python3.6
    package which we were using has now been removed from Debian Unstable.
    
    We now build python 3.6 ourselves. As the different platforms use a
    different suite by default, we add the common-stretch target to
    rbm.conf, which we use to avoid building a different python for each
    platform.
---
 keyring/python.gpg                | Bin 0 -> 4302 bytes
 projects/debootstrap-image/config |   7 -------
 projects/https-everywhere/build   |   1 +
 projects/https-everywhere/config  |   9 ++++++---
 projects/python/build             |  14 ++++++++++++++
 projects/python/config            |  25 +++++++++++++++++++++++++
 rbm.conf                          |  17 +++++++++++++++++
 7 files changed, 63 insertions(+), 10 deletions(-)

diff --git a/keyring/python.gpg b/keyring/python.gpg
new file mode 100644
index 0000000..66711fd
Binary files /dev/null and b/keyring/python.gpg differ
diff --git a/projects/debootstrap-image/config b/projects/debootstrap-image/config
index c916e9f..7e8b280 100644
--- a/projects/debootstrap-image/config
+++ b/projects/debootstrap-image/config
@@ -100,13 +100,6 @@ targets:
         suite: jessie
         arch: i386
 
-  buster-amd64:
-    var:
-      minimal_apt_version: '1.8.0~alpha3.1'
-      container:
-        suite: buster
-        arch: amd64
-
   stretch-amd64:
     var:
       minimal_apt_version: 1.4.9
diff --git a/projects/https-everywhere/build b/projects/https-everywhere/build
index 10dd4bf..88431e0 100644
--- a/projects/https-everywhere/build
+++ b/projects/https-everywhere/build
@@ -1,5 +1,6 @@
 #!/bin/bash
 [% c("var/set_default_env") -%]
+[% pc('python', 'var/setup', { python_tarfile => c('input_files_by_name/python') }) %]
 tar xf [% project %]-[% c('version') %].tar.gz
 cd [% project %]-[% c('version') %]
 ./make.sh
diff --git a/projects/https-everywhere/config b/projects/https-everywhere/config
index 59eb463..1be120b 100644
--- a/projects/https-everywhere/config
+++ b/projects/https-everywhere/config
@@ -10,18 +10,17 @@ var:
   # HTTPS Everywhere is expected to be the same on all platforms. To avoid
   # building the same thing 4 times, using 4 different container images
   # (each one with a different suite or architecture), we set the container
-  # to buster/amd64 for all platforms. This allows us to create only one
+  # to stretch/amd64 for all platforms. This allows us to create only one
   # container image, and also build the extension only one time as the
   # filename does not contain the platform, and var/build_id should be
   # the same since there is now nothing platform specific in the build
   # inputs. This allows us to save a little time and disk space.
   container:
     use_container: 1
-    suite: buster
+    suite: stretch
     arch: amd64
   deps:
     - git
-    - python3.6
     - libxslt1.1
     - libxml2-utils
     - sqlite3
@@ -31,3 +30,7 @@ var:
 
 input_files:
   - project: container-image
+  - project: python
+    name: python
+    target:
+      - common-stretch
diff --git a/projects/python/build b/projects/python/build
new file mode 100644
index 0000000..1fff7ce
--- /dev/null
+++ b/projects/python/build
@@ -0,0 +1,14 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+distdir=/var/tmp/dist/[% project %]
+mkdir -p $distdir
+tar xf [% c('input_files_by_name/python') %]
+cd Python-[% c('version') %]
+./configure --prefix=$distdir
+make -j[% c("buildconf/num_procs") %]
+make prefix=$distdir install
+cd /var/tmp/dist
+[% c('tar', {
+	tar_src => 'python',
+	tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
+    }) %]
diff --git a/projects/python/config b/projects/python/config
new file mode 100644
index 0000000..10c79cc
--- /dev/null
+++ b/projects/python/config
@@ -0,0 +1,25 @@
+# vim: filetype=yaml sw=2
+version: 3.6.8
+filename: 'python-[% c("lsb_release/id") %]-[% c("lsb_release/release") %]-[% c("var/build_id") %].tar.gz'
+var:
+  container:
+    use_container: 1
+  deps:
+    - xz-utils
+    - build-essential
+    - python-all
+    - zlib1g-dev
+    - libssl-dev
+
+  setup: |
+    mkdir -p /var/tmp/dist
+    tar -C /var/tmp/dist -xf $rootdir/[% c("python_tarfile") %]
+    export PATH=/var/tmp/dist/python/bin:"$PATH"
+
+input_files:
+  - project: container-image
+  - name: python
+    URL: 'https://www.python.org/ftp/python/[% c("version") %]/Python-[% c("version") %].tar.xz'
+    gpg_keyring: python.gpg
+    sig_ext: asc
+    file_gpg_id: 1
diff --git a/rbm.conf b/rbm.conf
index 810eae8..381eab6 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -140,6 +140,23 @@ targets:
       # Don't create mar files to save time
       build_mar: 0
 
+  # The common-stretch target is used to build components that are common to all
+  # platforms, using Debian stretch.
+  common-stretch:
+    var:
+      common: 1
+      container:
+        suite: stretch
+        arch: amd64
+      deps:
+        - build-essential
+        - python
+        - bison
+        - automake
+        - libtool
+        - zip
+        - unzip
+
   torbrowser-android-armv7:
     - android-armv7
   android-armv7:



More information about the tbb-commits mailing list