diff --git a/.hgignore b/.hgignore new file mode 100644 index 00000000..597ec228 --- /dev/null +++ b/.hgignore @@ -0,0 +1,3 @@ +build/ +dist/ +venv/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..0b8a7e86 --- /dev/null +++ b/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2018 to present, Gregory Szorc +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.rst b/README.rst new file mode 100644 index 00000000..d621750a --- /dev/null +++ b/README.rst @@ -0,0 +1,123 @@ +======================== +Python Standalone Builds +======================== + +This project contains code for building Python distributions that are +self-contained and highly portable (the binaries can be executed +on most target machines). + +The intended audience of this project are people wanting to produce +applications that embed Python in a larger executable. The artifacts +that this project produces make it easier to build highly-portable +applications containing Python. + +Most consumers of this project can bypass the building of artifacts +and consume the pre-built binaries produced from it. + +Project Status +============== + +The project can be considered alpha quality. It is still in a heavy state +of flux. + +Currently, it produces a nearly full-featured CPython distribution for +Linux that is fully statically linked with the exception of some very +common system libraries. + +Planned features include: + +* Support for Windows +* Support for macOS +* Static/dynamic linking toggles for dependencies + +Instructions +============ + +To build a Python distribution for Linux x64:: + + $ ./build-linux.py + +Requirements +============ + +Linux +----- + +The host system must be 64-bit. A Python 3.5+ interpreter must be +available. The execution environment must have access to a Docker +daemon (all build operations are performed in Docker containers for +isolation from the host system). + +How It Works +============ + +The first thing the ``build-*`` scripts do is bootstrap an environment +for building Python. On Linux, a base Docker image based on a deterministic +snapshot of Debian Wheezy is created. A modern binutils and GCC are built +in this environment. That modern GCC is then used to build a modern Clang. +Clang is then used to build all of Python's dependencies (openssl, ncurses, +readline, sqlite, etc). Finally, Python itself is built. + +Python is built in such a way that extensions are statically linked +against their dependencies. e.g. instead of the ``sqlite3`` Python +extension having a run-time dependency against ``libsqlite3.so``, the +SQLite symbols are statically inlined into the Python extension object +file. + +From the built Python, we produce an archive containing the raw Python +distribution (as if you had run ``make install``) as well as other files +useful for downstream consumers. + +Setup.local Hackery +------------------- + +Python's build system reads the ``Modules/Setup`` and ``Modules/Setup.local`` +files to influence how C extensions are built. By default, many extensions +have no entry in these files and the ``setup.py`` script performs work +to compile these extensions. (``setup.py`` looks for headers, libraries, +etc, and sets up the proper compiler flags.) + +``setup.py`` doesn't provide a lot of flexibility and relies on a lot +of default behavior in ``distutils`` as well as other inline code in +``setup.py``. This default behavior is often undesirable for our +desired outcome of producing a standalone Python distribution. + +Since the build environment is mostly deterministic and since we have +special requirements, we generate a custom ``Setup.local`` file that +builds C extensions in a specific manner. The undesirable behavior of +``setup.py`` is bypassed and the Python C extensions are compiled just +the way we want. + +Linux Runtime Requirements +========================== + +The produced Linux binaries have minimal references to shared +libraries and thus can be executed on most Linux systems. + +The following shared libraries are referenced: + +* linux-vdso.so.1 +* libpthread.so.0 +* libdl.so.2 (required by ctypes extension) +* libutil.so.1 +* librt.so.1 +* libnsl.so.1 (required by nis extension) +* libcrypt.so.1 (required by crypt extension) +* libm.so.6 +* libc.so.6 +* ld-linux-x86-64.so.2 + +Licensing +========= + +Python and its various dependencies are governed by varied software use +licenses. This impacts the rights and requirements of downstream consumers. + +The ``python-licenses.rst`` file contained in this repository and produced +artifacts summarizes the licenses of various components. + +Most licenses are fairly permissive. Notable exceptions to this are GDBM and +readline, which are both licensed under GPL Version 3. + +**It is important to understand the licensing requirements when integrating +the output of this project into derived works.** diff --git a/build-linux.py b/build-linux.py new file mode 100755 index 00000000..9cf42a42 --- /dev/null +++ b/build-linux.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +import datetime +import os +import pathlib +import subprocess +import sys +import venv + + +ROOT = pathlib.Path(os.path.abspath(__file__)).parent +BUILD = ROOT / 'build' +DIST = ROOT / 'dist' +VENV = BUILD / 'venv' +PIP = VENV / 'bin' / 'pip' +PYTHON = VENV / 'bin' / 'python' +REQUIREMENTS = ROOT / 'requirements.txt' +MAKE_DIR = ROOT / 'cpython-linux' + + +def bootstrap(): + BUILD.mkdir(exist_ok=True) + DIST.mkdir(exist_ok=True) + + venv.create(VENV, with_pip=True) + + subprocess.run([str(PIP), 'install', '-r', str(REQUIREMENTS)], + check=True) + + os.environ['PYBUILD_BOOTSTRAPPED'] = '1' + os.environ['PATH'] = '%s:%s' % (str(VENV / 'bin'), os.environ['PATH']) + os.environ['PYTHONPATH'] = str(ROOT) + subprocess.run([str(PYTHON), __file__], check=True) + + +def run(): + import zstandard + from pythonbuild.downloads import DOWNLOADS + + now = datetime.datetime.utcnow() + + subprocess.run(['make'], + cwd=str(MAKE_DIR), check=True) + + source_path = BUILD / 'cpython-linux64.tar' + dest_path = DIST / ('cpython-%s-linux64-%s.tar.zst' % ( + DOWNLOADS['cpython-3.7']['version'], now.strftime('%Y%m%dT%H%M'))) + + print('compressing Python archive to %s' % dest_path) + with source_path.open('rb') as ifh, dest_path.open('wb') as ofh: + cctx = zstandard.ZstdCompressor(level=15) + cctx.copy_stream(ifh, ofh, source_path.stat().st_size) + + +if __name__ == '__main__': + try: + if 'PYBUILD_BOOTSTRAPPED' not in os.environ: + bootstrap() + else: + run() + except subprocess.CalledProcessError as e: + sys.exit(e.returncode) diff --git a/cpython-linux/Makefile b/cpython-linux/Makefile new file mode 100644 index 00000000..6613b44b --- /dev/null +++ b/cpython-linux/Makefile @@ -0,0 +1,82 @@ +ROOT := $(abspath $(CURDIR)/..) +HERE := $(ROOT)/cpython-linux +OUTDIR := $(ROOT)/build + +BUILD := $(HERE)/build.py +NULL := + +COMMON_DEPENDS := \ +# $(BUILD) \ + $(NULL) + +PLATFORM := linux64 + +TOOLCHAIN_DEPENDS := \ + $(OUTDIR)/binutils-linux64.tar \ + $(OUTDIR)/gcc-linux64.tar \ + $(OUTDIR)/clang-linux64.tar \ + $(NULL) + +default: $(OUTDIR)/cpython-linux64.tar + +$(OUTDIR)/image-%.tar: $(HERE)/%.Dockerfile $(COMMON_DEPENDS) + $(BUILD) image-$* + +$(OUTDIR)/binutils-linux64.tar: $(OUTDIR)/image-gcc.tar $(HERE)/build-binutils.sh + $(BUILD) binutils + +$(OUTDIR)/gcc-linux64.tar: $(OUTDIR)/binutils-linux64.tar $(HERE)/build-gcc.sh + $(BUILD) gcc + +$(OUTDIR)/clang-linux64.tar: $(OUTDIR)/binutils-linux64.tar $(OUTDIR)/gcc-linux64.tar $(OUTDIR)/image-clang.tar $(HERE)/build-clang.sh + $(BUILD) clang + +$(OUTDIR)/bzip2-%.tar: $(OUTDIR)/image-build.tar $(TOOLCHAIN_DEPENDS) $(HERE)/build-bzip2.sh + $(BUILD) --platform $* bzip2 + +$(OUTDIR)/gdbm-%.tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-gdbm.sh + $(BUILD) --platform $* gdbm + +$(OUTDIR)/libffi-%.tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-libffi.sh + $(BUILD) --platform $* libffi + +$(OUTDIR)/ncurses-%.tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-ncurses.sh + $(BUILD) --platform $* ncurses + +$(OUTDIR)/openssl-%.tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-openssl.sh + $(BUILD) --platform $* openssl + +$(OUTDIR)/readline-%.tar: $(TOOLCHAIN_DEPENDS) $(OUTDIR)/ncurses-$(PLATFORM).tar $(HERE)/build-readline.sh + $(BUILD) --platform $* readline + +$(OUTDIR)/sqlite-$(PLATFORM).tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-sqlite.sh + $(BUILD) --platform $(PLATFORM) sqlite + +$(OUTDIR)/tcltk-$(PLATFORM).tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-tcltk.sh + $(BUILD) --platform $(PLATFORM) tcltk + +$(OUTDIR)/uuid-$(PLATFORM).tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-uuid.sh + $(BUILD) --platform $(PLATFORM) uuid + +$(OUTDIR)/xz-$(PLATFORM).tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-xz.sh + $(BUILD) --platform $(PLATFORM) xz + +$(OUTDIR)/zlib-$(PLATFORM).tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-zlib.sh + $(BUILD) --platform $(PLATFORM) zlib + +PYTHON_DEPENDS := \ + $(OUTDIR)/bzip2-$(PLATFORM).tar \ + $(OUTDIR)/gdbm-$(PLATFORM).tar \ + $(OUTDIR)/libffi-$(PLATFORM).tar \ + $(OUTDIR)/ncurses-$(PLATFORM).tar \ + $(OUTDIR)/openssl-$(PLATFORM).tar \ + $(OUTDIR)/readline-$(PLATFORM).tar \ + $(OUTDIR)/sqlite-$(PLATFORM).tar \ + $(OUTDIR)/uuid-$(PLATFORM).tar \ + $(OUTDIR)/xz-$(PLATFORM).tar \ + $(OUTDIR)/zlib-$(PLATFORM).tar \ + $(HERE)/static-modules \ + $(NULL) + +$(OUTDIR)/cpython-$(PLATFORM).tar: $(TOOLCHAIN_DEPENDS) $(HERE)/build-cpython.sh $(PYTHON_DEPENDS) + $(BUILD) --platform $(PLATFORM) cpython diff --git a/cpython-linux/README.rst b/cpython-linux/README.rst new file mode 100644 index 00000000..4d987343 --- /dev/null +++ b/cpython-linux/README.rst @@ -0,0 +1,19 @@ +This project builds CPython for Linux in a mostly deterministic and +reproducible manner. The resulting Python build is mostly self-contained +and the binaries are capable of running on many Linux distributions. + +The produced binaries perform minimal loading of shared libraries. +The required shared libraries are: + +* linux-vdso.so.1 +* libpthread.so.0 +* libdl.so.2 (required by ctypes extension) +* libutil.so.1 +* librt.so.1 +* libnsl.so.1 (required by nis extension) +* libcrypt.so.1 (required by crypt extension) +* libm.so.6 +* libc.so.6 +* ld-linux-x86-64.so.2 + +These shared libraries should be present on most modern Linux distros. diff --git a/cpython-linux/base.Dockerfile b/cpython-linux/base.Dockerfile new file mode 100644 index 00000000..726e4277 --- /dev/null +++ b/cpython-linux/base.Dockerfile @@ -0,0 +1,30 @@ +# Debian Wheezy. +FROM debian@sha256:37103c15605251b2e35b70a3214af626a55cff39abbaadccd01ff828ee7005e0 +MAINTAINER Gregory Szorc + +RUN groupadd -g 1000 build && \ + useradd -u 1000 -g 1000 -d /build -s /bin/bash -m build && \ + mkdir /tools && \ + chown -R build:build /build /tools + +ENV HOME=/build \ + SHELL=/bin/bash \ + USER=build \ + LOGNAME=build \ + HOSTNAME=builder \ + DEBIAN_FRONTEND=noninteractive + +CMD ["/bin/bash", "--login"] +WORKDIR '/build' + +RUN for s in debian_wheezy debian_wheezy-updates debian_wheezy-backports debian-security_wheezy/updates; do \ + echo "deb http://snapshot.debian.org/archive/${s%_*}/20181129T234109Z/ ${s#*_} main"; \ + done > /etc/apt/sources.list && \ + ( echo 'quiet "true";'; \ + echo 'APT::Get::Assume-Yes "true";'; \ + echo 'APT::Install-Recommends "false";'; \ + echo 'Acquire::Check-Valid-Until "false";'; \ + echo 'Acquire::Retries "5";'; \ + ) > /etc/apt/apt.conf.d/99cpython-portable + +RUN apt-get update diff --git a/cpython-linux/build-binutils.sh b/cpython-linux/build-binutils.sh new file mode 100755 index 00000000..a19ce7ae --- /dev/null +++ b/cpython-linux/build-binutils.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -e + +cd /build + +tar -xf binutils-${BINUTILS_VERSION}.tar.xz +mkdir binutils-objdir +pushd binutils-objdir + +../binutils-${BINUTILS_VERSION}/configure \ + --build=x86_64-unknown-linux-gnu \ + --prefix=/tools/host \ + --enable-plugins \ + --disable-nls \ + --with-sysroot=/ + +make -j `nproc` +make install -j `nproc` DESTDIR=/build/out + +popd diff --git a/cpython-linux/build-bzip2.sh b/cpython-linux/build-bzip2.sh new file mode 100755 index 00000000..2018492e --- /dev/null +++ b/cpython-linux/build-bzip2.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH + +tar -xf bzip2-${BZIP2_VERSION}.tar.gz + +pushd bzip2-${BZIP2_VERSION} + +make -j `nproc` install \ + AR=/tools/host/bin/${TOOLCHAIN_PREFIX}ar \ + CC=clang \ + CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" \ + LDFLAGS="${EXTRA_TARGET_LDFLAGS}" \ + PREFIX=/build/out/tools/deps diff --git a/cpython-linux/build-clang.sh b/cpython-linux/build-clang.sh new file mode 100755 index 00000000..19433d7d --- /dev/null +++ b/cpython-linux/build-clang.sh @@ -0,0 +1,182 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# We build the host/main Clang initially using GCC. Then we rebuild +# Clang using Clang. +# +# The behavior of library search paths is a bit wonky. +# +# The binutils/gcc/libstdc++ that we use to build are in a non-standard +# location: /tools/gcc. Furthermore, we want the produced Clang +# distribution to be self-contained and not have dependencies on +# a GCC install. +# +# To solve the latter requirement, we copy various GCC libraries +# and includes into the Clang install directory. When done the way +# we have, Clang automagically finds the header files. And since +# binaries have an rpath of $ORIGIN/../lib, libstdc++ and libgcc_s +# can be found at load time. +# +# However, as part of building itself, Clang executes binaries that +# it itself just built. These binaries need to load a modern libstdc++. +# (The system's libstdc++ is too old.) Since these just-built binaries +# aren't in an install location, the $ORIGIN/../lib rpath won't work. +# So, we set LD_LIBRARY_PATH when building so the modern libstdc++ +# can be located. +# +# Furthermore, Clang itself needs to link against a modern libstdc++. +# But the system library search paths take precedence when invoking +# the linker via clang. We force linking against a modern libstdc++ +# by passing -L to the linker when building Clang. +# +# All of these tricks combine to produce a Clang distribution with +# GNU libstdc++ and that uses GNU binutils. + +set -ex + +cd /build + +mkdir /tools/extra +tar -C /tools/extra --strip-components=1 -xf /build/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz + +unzip ninja-linux.zip +mv ninja /tools/extra/bin/ + +export PATH=/tools/extra/bin:/tools/host/bin:$PATH + +mkdir llvm +pushd llvm +tar --strip-components=1 -xf /build/llvm-${LLVM_VERSION}.src.tar.xz +popd + +mkdir llvm/tools/clang +pushd llvm/tools/clang +tar --strip-components=1 -xf /build/cfe-${CLANG_VERSION}.src.tar.xz +popd + +mkdir llvm/tools/lld +pushd llvm/tools/lld +tar --strip-components=1 -xf /build/lld-${LLD_VERSION}.src.tar.xz +popd + +mkdir llvm/projects/compiler-rt +pushd llvm/projects/compiler-rt +tar --strip-components=1 -xf /build/compiler-rt-${CLANG_COMPILER_RT_VERSION}.src.tar.xz +popd + +mkdir llvm/projects/libcxx +pushd llvm/projects/libcxx +tar --strip-components=1 -xf /build/libcxx-${LIBCXX_VERSION}.src.tar.xz +popd + +mkdir llvm/projects/libcxxabi +pushd llvm/projects/libcxxabi +tar --strip-components=1 -xf /build/libcxxabi-${LIBCXXABI_VERSION}.src.tar.xz +popd + +mkdir llvm-objdir +pushd llvm-objdir + +# Stage 1: Build with GCC. +mkdir stage1 +pushd stage1 +cmake \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/tools/clang-stage1 \ + -DCMAKE_C_COMPILER=/tools/host/bin/gcc \ + -DCMAKE_CXX_COMPILER=/tools/host/bin/g++ \ + -DCMAKE_ASM_COMPILER=/tools/host/bin/gcc \ + -DCMAKE_CXX_FLAGS="-Wno-cast-function-type" \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,-Bsymbolic-functions" \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic-functions" \ + -DLLVM_TARGETS_TO_BUILD=X86 \ + -DLLVM_TOOL_LIBCXX_BUILD=ON \ + -DLIBCXX_LIBCPPABI_VERSION="" \ + -DLLVM_BINUTILS_INCDIR=/tools/host/include \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + ../../llvm + +LD_LIBRARY_PATH=/tools/host/lib64 ninja install + +mkdir -p /tools/clang-stage1/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION} +cp -av /tools/host/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION}/* /tools/clang-stage1/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION}/ +cp -av /tools/host/lib64/* /tools/clang-stage1/lib/ +mkdir -p /tools/clang-stage1/lib32 +cp -av /tools/host/lib32/* /tools/clang-stage1/lib32/ +cp -av /tools/host/include/* /tools/clang-stage1/include/ + +popd + +find /tools/clang-stage1 | sort + +# Stage 2: Build with GCC built Clang. +mkdir stage2 +pushd stage2 +cmake \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/tools/clang-stage2 \ + -DCMAKE_C_COMPILER=/tools/clang-stage1/bin/clang \ + -DCMAKE_CXX_COMPILER=/tools/clang-stage1/bin/clang++ \ + -DCMAKE_ASM_COMPILER=/tools/clang-stage1/bin/clang \ + -DCMAKE_C_FLAGS="-fPIC" \ + -DCMAKE_CXX_FLAGS="-fPIC -Qunused-arguments -L/tools/clang-stage1/lib" \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,-Bsymbolic-functions -L/tools/clang-stage1/lib" \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic-functions -L/tools/clang-stage1/lib" \ + -DLLVM_TARGETS_TO_BUILD=X86 \ + -DLLVM_TOOL_LIBCXX_BUILD=ON \ + -DLIBCXX_LIBCPPABI_VERSION="" \ + -DLLVM_BINUTILS_INCDIR=/tools/host/include \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + ../../llvm + +LD_LIBRARY_PATH=/tools/clang-stage1/lib ninja install + +mkdir -p /tools/clang-stage2/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION} +cp -av /tools/host/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION}/* /tools/clang-stage2/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION}/ +cp -av /tools/host/lib64/* /tools/clang-stage2/lib/ +mkdir -p /tools/clang-stage2/lib32 +cp -av /tools/host/lib32/* /tools/clang-stage2/lib32/ +cp -av /tools/host/include/* /tools/clang-stage2/include/ + +popd + +find /tools/clang-stage2 | sort + +# Stage 3: Build with Clang built Clang. +mkdir stage3 +pushd stage3 +cmake \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/tools/clang-linux64 \ + -DCMAKE_C_COMPILER=/tools/clang-stage2/bin/clang \ + -DCMAKE_CXX_COMPILER=/tools/clang-stage2/bin/clang++ \ + -DCMAKE_ASM_COMPILER=/tools/clang-stage2/bin/clang \ + -DCMAKE_C_FLAGS="-fPIC" \ + -DCMAKE_CXX_FLAGS="-fPIC -Qunused-arguments -L/tools/clang-stage2/lib" \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,-Bsymbolic-functions -L/tools/clang-stage2/lib" \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic-functions -L/tools/clang-stage2/lib" \ + -DLLVM_TARGETS_TO_BUILD=X86 \ + -DLLVM_TOOL_LIBCXX_BUILD=ON \ + -DLIBCXX_LIBCPPABI_VERSION="" \ + -DLLVM_BINUTILS_INCDIR=/tools/host/include \ + -DLLVM_LINK_LLVM_DYLIB=ON \ + ../../llvm + +LD_LIBRARY_PATH=/tools/clang-stage2/lib DESTDIR=/build/out ninja install + +mkdir -p /build/out/tools/clang-linux64/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION} +cp -av /tools/host/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION}/* /build/out/tools/clang-linux64/lib/gcc/x86_64-unknown-linux-gnu/${GCC_VERSION}/ +cp -av /tools/host/lib64/* /build/out/tools/clang-linux64/lib/ +mkdir -p /build/out/tools/clang-linux64/lib32/ +cp -av /tools/host/lib32/* /build/out/tools/clang-linux64/lib32/ +cp -av /tools/host/include/* /build/out/tools/clang-linux64/include/ + +popd + +# Move out of objdir +popd diff --git a/cpython-linux/build-cpython.sh b/cpython-linux/build-cpython.sh new file mode 100755 index 00000000..57625a76 --- /dev/null +++ b/cpython-linux/build-cpython.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/clang-linux64/bin:/tools/host/bin:/tools/deps/bin:$PATH +export CC=clang +export CXX=clang++ + +# We force linking of external static libraries by removing the shared +# libraries. This is hacky. But we're building in a temporary container +# and it gets the job done. +find /tools/deps -name '*.so*' -exec rm {} \; + +tar -xf Python-${PYTHON_VERSION}.tar.xz + +cat Setup.local +mv Setup.local Python-${PYTHON_VERSION}/Modules/Setup.local + +pushd Python-${PYTHON_VERSION} + +# Most bits look at CFLAGS. But setup.py only looks at CPPFLAGS. +# So we need to set both. +CFLAGS="-I/tools/deps/include -I/tools/deps/include/ncurses" +CPPFLAGS=$CFLAGS +LDFLAGS="-L/tools/deps/lib64 -L/tools/deps/lib" + +CONFIGURE_FLAGS="--prefix=/install --with-openssl=/tools/deps --without-ensurepip" + +if [ -n "${CPYTHON_OPTIMIZED}" ]; then + CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --enable-optimizations --enable-lto" +fi + +CFLAGS=$CFLAGS CPPFLAGS=$CFLAGS LDFLAGS=$LDFLAGS \ + ./configure ${CONFIGURE_FLAGS} + +# Supplement produced Makefile with our modifications. +cat ../Makefile.extra >> Makefile + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out/python + +# Also copy object files so they can be linked in a custom manner by +# downstream consumers. +for d in Modules Objects Parser Programs Python; do + mkdir -p /build/out/python/build/$d + cp -av $d/*.o /build/out/python/build/$d/ +done + +# config.c defines _PyImport_Inittab and extern references to modules, which +# downstream consumers may want to strip. We bundle config.c and config.c.in so +# a custom one can be produced downstream. +# frozen.c is something similar for frozen modules. +cp -av Modules/config.c /build/out/python/build/Modules/ +cp -av Modules/config.c.in /build/out/python/build/Modules/ +cp -av Python/frozen.c /build/out/python/build/Python/ +cp /build/python-licenses.rst /build/out/python/LICENSE.rst diff --git a/cpython-linux/build-gcc.sh b/cpython-linux/build-gcc.sh new file mode 100755 index 00000000..0110d094 --- /dev/null +++ b/cpython-linux/build-gcc.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -e + +cd /build + +tar -C /tools -xf /build/binutils-linux64.tar +export PATH=/tools/host/bin:$PATH + +tar -xf gcc-${GCC_VERSION}.tar.xz +tar -xf gmp-${GMP_VERSION}.tar.xz +tar -xf isl-${ISL_VERSION}.tar.bz2 +tar -xf mpc-${MPC_VERSION}.tar.gz +tar -xf mpfr-${MPFR_VERSION}.tar.xz + +pushd gcc-${GCC_VERSION} +ln -sf ../gmp-${GMP_VERSION} gmp +ln -sf ../isl-${ISL_VERSION} isl +ln -sf ../mpc-${MPC_VERSION} mpc +ln -sf ../mpfr-${MPFR_VERSION} mpfr +popd + +mkdir gcc-objdir + +pushd gcc-objdir +../gcc-${GCC_VERSION}/configure \ + --build=x86_64-unknown-linux-gnu \ + --prefix=/tools/host \ + --enable-languages=c,c++ \ + --disable-nls \ + --disable-gnu-unique-object \ + --enable-__cxa_atexit \ + --with-sysroot=/ + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out +popd diff --git a/cpython-linux/build-gdbm.sh b/cpython-linux/build-gdbm.sh new file mode 100755 index 00000000..a2c5f146 --- /dev/null +++ b/cpython-linux/build-gdbm.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf gdbm-${GDBM_VERSION}.tar.gz + +pushd gdbm-${GDBM_VERSION} + +# CPython setup.py looks for libgdbm_compat and gdbm-ndbm.h, +# which require --enable-libgdbm-compat. +CLFAGS="${EXTRA_TARGET_CFLAGS} -fPIC" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" ./configure \ + --build=x86_64-unknown-linux-gnu \ + --target=${TARGET} \ + --prefix=/tools/deps \ + --enable-libgdbm-compat + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-libffi.sh b/cpython-linux/build-libffi.sh new file mode 100755 index 00000000..d3049fcc --- /dev/null +++ b/cpython-linux/build-libffi.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf libffi-${LIBFFI_VERSION}.tar.gz + +pushd libffi-${LIBFFI_VERSION} + +CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" ./configure \ + --build=x86_64-unknown-linux-gnu \ + --host=${TARGET} \ + --prefix=/tools/deps + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-ncurses.sh b/cpython-linux/build-ncurses.sh new file mode 100755 index 00000000..8ed7aa47 --- /dev/null +++ b/cpython-linux/build-ncurses.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf ncurses-${NCURSES_VERSION}.tar.gz + +pushd ncurses-${NCURSES_VERSION} + +CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" ./configure \ + --build=x86_64-unknown-linux-gnu \ + --host=${TARGET} \ + --prefix=/tools/deps +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-openssl.sh b/cpython-linux/build-openssl.sh new file mode 100755 index 00000000..5aa3e6c1 --- /dev/null +++ b/cpython-linux/build-openssl.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf openssl-${OPENSSL_VERSION}.tar.gz + +pushd openssl-${OPENSSL_VERSION} + +/usr/bin/perl ./Configure --prefix=/tools/deps linux-x86_64 + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-readline.sh b/cpython-linux/build-readline.sh new file mode 100755 index 00000000..0a33c38b --- /dev/null +++ b/cpython-linux/build-readline.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf readline-${READLINE_VERSION}.tar.gz + +pushd readline-${READLINE_VERSION} + +CLFAGS="${EXTRA_TARGET_CFLAGS} -fPIC" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" LDFLAGS="-L/tools/deps/lib" \ + ./configure \ + --build=x86_64-unknown-linux-gnu \ + --host=${TARGET} \ + --prefix=/tools/deps \ + --with-curses + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-sqlite.sh b/cpython-linux/build-sqlite.sh new file mode 100755 index 00000000..d611d55f --- /dev/null +++ b/cpython-linux/build-sqlite.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf sqlite-autoconf-3250300.tar.gz +pushd sqlite-autoconf-3250300 + +CFLAGS="-fPIC" CPPFLAGS="-fPIC" ./configure --prefix /tools/deps + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-tcltk.sh b/cpython-linux/build-tcltk.sh new file mode 100755 index 00000000..8a806eb7 --- /dev/null +++ b/cpython-linux/build-tcltk.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf tcl8.6.9-src.tar.gz + +pushd tcl8.6.9/unix +./configure --prefix=/tools/deps +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out +make -j `nproc` install +popd + +tar -xf libX11-1.5.0.tar.gz +pushd libX11-1.5.0 +./configure --prefix=/tools/deps +make -j `nproc` +make -j `nproc` install DEST=/build/out +make -j `nproc` install +popd + +tar -xf tk8.6.9.1-src.tar.gz +pushd tk8.6.9/unix + +./configure --prefix=/tools/deps --with-tcl=/tools/deps/lib + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-uuid.sh b/cpython-linux/build-uuid.sh new file mode 100755 index 00000000..bef4c2c1 --- /dev/null +++ b/cpython-linux/build-uuid.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf libuuid-${UUID_VERSION}.tar.gz +pushd libuuid-${UUID_VERSION} + +CFLAGS="-fPIC" CPPFLAGS="-fPIC" ./configure --prefix=/tools/deps + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-xz.sh b/cpython-linux/build-xz.sh new file mode 100755 index 00000000..b29e9163 --- /dev/null +++ b/cpython-linux/build-xz.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf xz-${XZ_VERSION}.tar.gz + +pushd xz-${XZ_VERSION} + +CFLAGS="-fPIC" CPPFLAGS="-fPIC" CCASFLAGS="-fPIC" ./configure \ + --prefix=/tools/deps \ + --disable-xz \ + --disable-xzdec \ + --disable-lzmadec \ + --disable-lzmainfo \ + --disable-lzma-links \ + --disable-scripts + +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build-zlib.sh b/cpython-linux/build-zlib.sh new file mode 100755 index 00000000..a9c6339c --- /dev/null +++ b/cpython-linux/build-zlib.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +set -ex + +cd /build + +export PATH=/tools/${TOOLCHAIN}/bin:/tools/host/bin:$PATH +export CC=clang +export CXX=clang++ + +tar -xf zlib-${ZLIB_VERSION}.tar.gz + +pushd zlib-${ZLIB_VERSION} + +CFLAGS="-fPIC" ./configure --prefix=/tools/deps +make -j `nproc` +make -j `nproc` install DESTDIR=/build/out diff --git a/cpython-linux/build.Dockerfile b/cpython-linux/build.Dockerfile new file mode 100644 index 00000000..b29f7e69 --- /dev/null +++ b/cpython-linux/build.Dockerfile @@ -0,0 +1,9 @@ +{% include 'base.Dockerfile' %} +RUN apt-get install \ + file \ + libc6-dev \ + make \ + perl \ + tar \ + xz-utils \ + unzip diff --git a/cpython-linux/build.py b/cpython-linux/build.py new file mode 100755 index 00000000..875b5ac4 --- /dev/null +++ b/cpython-linux/build.py @@ -0,0 +1,487 @@ +#!/usr/bin/env python3 +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +import argparse +import contextlib +import io +import os +import pathlib +import sys +import tarfile +import tempfile + +import docker +import jinja2 + +from pythonbuild.cpython import ( + derive_setup_local +) +from pythonbuild.downloads import ( + DOWNLOADS, +) +from pythonbuild.utils import ( + download_entry, +) + +ROOT = pathlib.Path(os.path.abspath(__file__)).parent.parent +BUILD = ROOT / 'build' +SUPPORT = ROOT / 'cpython-linux' + +LOG_PREFIX = [None] +LOG_FH = [None] + + +def log(msg): + if isinstance(msg, bytes): + msg_str = msg.decode('utf-8', 'replace') + msg_bytes = msg + else: + msg_str = msg + msg_bytes = msg.encode('utf-8', 'replace') + + print('%s> %s' % (LOG_PREFIX[0], msg_str)) + + if LOG_FH[0]: + LOG_FH[0].write(msg_bytes + b'\n') + + +def ensure_docker_image(client, fh, image_path=None): + res = client.api.build(fileobj=fh, decode=True) + + image = None + + for s in res: + if 'stream' in s: + for l in s['stream'].strip().splitlines(): + log(l) + + if 'aux' in s and 'ID' in s['aux']: + image = s['aux']['ID'] + + if not image: + raise Exception('unable to determine built Docker image') + + if image_path: + tar_path = image_path.with_suffix('.tar') + with tar_path.open('wb') as fh: + for chunk in client.images.get(image).save(): + fh.write(chunk) + + with image_path.open('w') as fh: + fh.write(image + '\n') + + return image + + +def build_docker_image(client, name): + image_path = BUILD / ('image-%s' % name) + + env = jinja2.Environment( + loader=jinja2.FileSystemLoader(str(ROOT / 'cpython-linux'))) + + tmpl = env.get_template('%s.Dockerfile' % name) + data = tmpl.render() + + return ensure_docker_image(client, io.BytesIO(data.encode('utf')), + image_path=image_path) + + +def get_image(client, name): + image_path = BUILD / ('image-%s' % name) + tar_path = image_path.with_suffix('.tar') + + with image_path.open('r') as fh: + image_id = fh.read().strip() + + try: + client.images.get(image_id) + return image_id + except docker.errors.ImageNotFound: + if tar_path.exists(): + with tar_path.open('rb') as fh: + client.api.import_image_from_stream(fh) + + return image_id + + else: + return build_docker_image(client, name) + + +def copy_file_to_container(path, container, container_path, archive_path=None): + """Copy a path on the local filesystem to a running container.""" + buf = io.BytesIO() + tf = tarfile.open('irrelevant', 'w', buf) + + tf.add(str(path), archive_path or path.name) + tf.close() + + log('copying %s to container' % path) + container.put_archive(container_path, buf.getvalue()) + + +@contextlib.contextmanager +def run_container(client, image): + container = client.containers.run( + image, command=['/bin/sleep', '86400'], detach=True) + try: + yield container + finally: + container.stop(timeout=0) + container.remove() + + +def container_exec(container, command, user='build', + environment=None): + # docker-py's exec_run() won't return the exit code. So we reinvent the + # wheel. + create_res = container.client.api.exec_create( + container.id, command, user=user, environment=environment) + + exec_output = container.client.api.exec_start(create_res['Id'], stream=True) + + for chunk in exec_output: + for l in chunk.strip().splitlines(): + log(l) + + if LOG_FH[0]: + LOG_FH[0].write(chunk) + + inspect_res = container.client.api.exec_inspect(create_res['Id']) + + if inspect_res['ExitCode'] != 0: + import pdb; pdb.set_trace() + raise Exception('exit code %d from %s' % (inspect_res['ExitCode'], + command)) + + +def install_tools_archive(container, source: pathlib.Path): + copy_file_to_container(source, container, '/build') + container_exec( + container, ['/bin/tar', '-C', '/tools', '-xf', '/build/%s' % source.name], + user='root') + + +def copy_toolchain(container, platform=None, gcc=False): + install_tools_archive(container, BUILD / 'binutils-linux64.tar') + + if gcc: + install_tools_archive(container, BUILD / 'gcc-linux64.tar') + + clang_linux64 = BUILD / 'clang-linux64.tar' + + if clang_linux64.exists(): + install_tools_archive(container, clang_linux64) + + +def copy_rust(container): + rust = download_entry('rust', BUILD) + + copy_file_to_container(rust, container, '/build') + container.exec_run(['/bin/mkdir', 'p', '/tools/rust']) + container.exec_run( + ['/bin/tar', '-C', '/tools/rust', '--strip-components', '1', + '-xf', '/build/%s' % rust.name]) + + +def download_tools_archive(container, dest, name): + data, stat = container.get_archive('/build/out/tools/%s' % name) + + with open(dest, 'wb') as fh: + for chunk in data: + fh.write(chunk) + + +def add_target_env(env, platform): + env['TARGET'] = 'x86_64-unknown-linux-gnu' + + +def simple_build(client, image, entry, platform): + archive = download_entry(entry, BUILD) + + with run_container(client, image) as container: + copy_toolchain(container, platform=platform) + copy_file_to_container(archive, container, '/build') + copy_file_to_container(SUPPORT / ('build-%s.sh' % entry), + container, '/build') + + env = { + 'TOOLCHAIN': 'clang-linux64', + '%s_VERSION' % entry.upper(): DOWNLOADS[entry]['version'], + } + + add_target_env(env, platform) + + container_exec(container, '/build/build-%s.sh' % entry, + environment=env) + dest_path = '%s-%s.tar' % (entry, platform) + download_tools_archive(container, BUILD / dest_path, 'deps') + + +def build_binutils(client, image): + """Build binutils in the Docker image.""" + archive = download_entry('binutils', BUILD) + + with run_container(client, image) as container: + copy_file_to_container(archive, container, '/build') + copy_file_to_container(SUPPORT / 'build-binutils.sh', container, + '/build') + + container_exec( + container, '/build/build-binutils.sh', + environment={ + 'BINUTILS_VERSION': DOWNLOADS['binutils']['version'], + }) + + download_tools_archive(container, BUILD / 'binutils-linux64.tar', + 'host') + + +def build_gcc(client, image): + """Build GCC in the Docker image.""" + gcc_archive = download_entry('gcc', BUILD) + gmp_archive = download_entry('gmp', BUILD) + isl_archive = download_entry('isl', BUILD) + mpc_archive = download_entry('mpc', BUILD) + mpfr_archive = download_entry('mpfr', BUILD) + + with run_container(client, image) as container: + log('copying archives to container...') + for a in (gcc_archive, gmp_archive, isl_archive, mpc_archive, + mpfr_archive): + copy_file_to_container(a, container, '/build') + + copy_file_to_container(BUILD / 'binutils-linux64.tar', container, + '/build') + copy_file_to_container(SUPPORT / 'build-gcc.sh', container, + '/build') + + container_exec( + container, '/build/build-gcc.sh', + environment={ + 'GCC_VERSION': DOWNLOADS['gcc']['version'], + 'GMP_VERSION': DOWNLOADS['gmp']['version'], + 'ISL_VERSION': DOWNLOADS['isl']['version'], + 'MPC_VERSION': DOWNLOADS['mpc']['version'], + 'MPFR_VERSION': DOWNLOADS['mpfr']['version'], + }) + + download_tools_archive(container, BUILD / 'gcc-linux64.tar', 'host') + + +def build_clang(client, image): + cmake_archive = download_entry('cmake-linux-bin', BUILD) + ninja_archive = download_entry('ninja-linux-bin', BUILD) + clang_archive = download_entry('clang', BUILD) + clang_rt_archive = download_entry('clang-compiler-rt', BUILD) + lld_archive = download_entry('lld', BUILD) + llvm_archive = download_entry('llvm', BUILD) + libcxx_archive = download_entry('libc++', BUILD) + libcxxabi_archive = download_entry('libc++abi', BUILD) + + with run_container(client, image) as container: + log('copying archives to container...') + for a in (cmake_archive, ninja_archive, clang_archive, clang_rt_archive, + lld_archive, llvm_archive, libcxx_archive, libcxxabi_archive): + copy_file_to_container(a, container, '/build') + + toolchain_platform = None + tools_path = 'clang-linux64' + suffix = 'linux64' + build_sh = 'build-clang.sh' + gcc = True + + env = { + 'CLANG_COMPILER_RT_VERSION': DOWNLOADS['clang-compiler-rt']['version'], + 'CLANG_VERSION': DOWNLOADS['clang']['version'], + 'CMAKE_VERSION': DOWNLOADS['cmake-linux-bin']['version'], + 'COMPILER_RT_VERSION': DOWNLOADS['clang-compiler-rt']['version'], + 'GCC_VERSION': DOWNLOADS['gcc']['version'], + 'LIBCXX_VERSION': DOWNLOADS['libc++']['version'], + 'LIBCXXABI_VERSION': DOWNLOADS['libc++abi']['version'], + 'LLD_VERSION': DOWNLOADS['lld']['version'], + 'LLVM_VERSION': DOWNLOADS['llvm']['version'], + } + + copy_toolchain(container, toolchain_platform, gcc=gcc) + + copy_file_to_container(SUPPORT / build_sh, container, + '/build') + + container_exec(container, '/build/%s' % build_sh, + environment=env) + + download_tools_archive(container, BUILD / ('clang-%s.tar' % suffix), + tools_path) + + +def build_readline(client, image, platform): + readline_archive = download_entry('readline', BUILD) + + with run_container(client, image) as container: + copy_toolchain(container, platform=platform) + install_tools_archive(container, BUILD / ('ncurses-%s.tar'% platform)) + copy_file_to_container(readline_archive, container, '/build') + copy_file_to_container(SUPPORT / 'build-readline.sh', container, + '/build') + + env = { + 'TOOLCHAIN': 'clang-linux64', + 'READLINE_VERSION': DOWNLOADS['readline']['version'], + } + + add_target_env(env, platform) + + container_exec(container, '/build/build-readline.sh', + environment=env) + dest_path = 'readline-%s.tar' % platform + download_tools_archive(container, BUILD / dest_path, 'deps') + + +def build_tcltk(client, image, platform): + tcl_archive = download_entry('tcl', BUILD) + tk_archive = download_entry('tk', BUILD) + x11_archive = download_entry('libx11', BUILD) + + with run_container(client, image) as container: + copy_toolchain(container, platform=platform) + + copy_file_to_container(tcl_archive, container, '/build') + copy_file_to_container(tk_archive, container, '/build') + copy_file_to_container(x11_archive, container, '/build') + copy_file_to_container(SUPPORT / 'build-tcltk.sh', container, + '/build') + + env = { + 'TOOLCHAIN': 'clang-%s' % platform, + } + + container_exec(container, '/build/build-tcltk.sh', + environment=env) + + dest_path = 'tcltk-%s.tar' % platform + download_tools_archive(container, BUILD / dest_path) + + +def build_cpython(client, image, platform): + """Build CPythin in a Docker image'""" + python_archive = download_entry('cpython-3.7', BUILD) + + with (SUPPORT / 'static-modules').open('rb') as fh: + static_modules_lines = [l.rstrip() for l in fh if not l.startswith(b'#')] + + setup_local_content, extra_make_content = derive_setup_local( + static_modules_lines, python_archive) + + with run_container(client, image) as container: + copy_toolchain(container, platform=platform) + install_tools_archive(container, BUILD / ('bzip2-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('gdbm-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('libffi-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('ncurses-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('openssl-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('readline-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('sqlite-%s.tar' % platform)) + # tk requires a bunch of X11 stuff. + #install_tools_archive(container, BUILD / ('tcltk-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('uuid-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('xz-%s.tar' % platform)) + install_tools_archive(container, BUILD / ('zlib-%s.tar' % platform)) + #copy_rust(container) + copy_file_to_container(python_archive, container, '/build') + copy_file_to_container(SUPPORT / 'build-cpython.sh', container, + '/build') + copy_file_to_container(ROOT / 'python-licenses.rst', container, '/build') + + # TODO copy latest pip/setuptools. + + with tempfile.NamedTemporaryFile('wb') as fh: + fh.write(setup_local_content) + fh.flush() + + copy_file_to_container(fh.name, container, + '/build', + archive_path='Setup.local') + + with tempfile.NamedTemporaryFile('wb') as fh: + fh.write(extra_make_content) + fh.flush() + + copy_file_to_container(fh.name, container, + '/build', + archive_path='Makefile.extra') + + env = { + 'CPYTHON_OPTIMIZED': '1', + 'PYTHON_VERSION': DOWNLOADS['cpython-3.7']['version'], + } + + container_exec(container, '/build/build-cpython.sh', + environment=env) + dest_path = BUILD / ('cpython-%s.tar' % platform) + + data, stat = container.get_archive('/build/out/python') + + with dest_path.open('wb') as fh: + for chunk in data: + fh.write(chunk) + + +def main(): + BUILD.mkdir(exist_ok=True) + + try: + client = docker.from_env() + client.ping() + except Exception as e: + print('unable to connect to Docker: %s' % e) + return 1 + + parser = argparse.ArgumentParser() + parser.add_argument('--platform') + parser.add_argument('action') + + args = parser.parse_args() + + action = args.action + + log_path = BUILD / ('build.%s.log' % action) + LOG_PREFIX[0] = action + if args.platform: + log_path = BUILD / ('build.%s-%s.log' % (action, args.platform)) + LOG_PREFIX[0] = '%s-%s' % (action, args.platform) + + with log_path.open('wb') as log_fh: + LOG_FH[0] = log_fh + if action.startswith('image-'): + build_docker_image(client, action[6:]) + + elif action == 'binutils': + build_binutils(client, get_image(client, 'gcc')) + + elif action == 'clang': + build_clang(client, get_image(client, 'clang')) + + elif action == 'gcc': + build_gcc(client, get_image(client, 'gcc')) + + elif action == 'readline': + build_readline(client, get_image(client, 'build'), platform=args.platform) + + elif action in ('bzip2', 'gdbm', 'libffi', 'ncurses', 'openssl', 'sqlite', 'uuid', 'xz', 'zlib'): + simple_build(client, get_image(client, 'build'), action, platform=args.platform) + + elif action == 'tcltk': + build_tcltk(client, get_image(client, 'build'), platform=args.platform) + + elif action == 'cpython': + build_cpython(client, get_image(client, 'build'), platform=args.platform) + + else: + print('unknown build action: %s' % action) + return 1 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/cpython-linux/clang.Dockerfile b/cpython-linux/clang.Dockerfile new file mode 100644 index 00000000..57f4da59 --- /dev/null +++ b/cpython-linux/clang.Dockerfile @@ -0,0 +1,9 @@ +{% include 'base.Dockerfile' %} +RUN apt-get install \ + libc6-dev \ + patch \ + python \ + tar \ + xz-utils \ + unzip \ + zlib1g-dev diff --git a/cpython-linux/gcc.Dockerfile b/cpython-linux/gcc.Dockerfile new file mode 100644 index 00000000..2db62cf6 --- /dev/null +++ b/cpython-linux/gcc.Dockerfile @@ -0,0 +1,14 @@ +{% include 'base.Dockerfile' %} +RUN apt-get install \ + autoconf \ + automake \ + bison \ + build-essential \ + gawk \ + gcc \ + gcc-multilib \ + libtool \ + make \ + tar \ + xz-utils \ + unzip diff --git a/cpython-linux/static-modules b/cpython-linux/static-modules new file mode 100644 index 00000000..1e34d6b2 --- /dev/null +++ b/cpython-linux/static-modules @@ -0,0 +1,35 @@ +# Setup.dist doesn't have entries for all modules. This file defines +# what's missing. The content here is reconstructed from logic in +# setup.py and what was observed to execute in a normal build via setup.py. +# We should audit this every time we upgrade CPython. + +_bz2 _bz2module.c -lbz2 +_crypt _cryptmodule.c -lcrypt +_curses _cursesmodule.c -I/tools/deps/include/ncurses -L/tools/deps/lib -lncurses +_curses_panel _curses_panel.c -I/tools/deps/include/ncurses -L/tools/deps/lib -lpanel -lncurses +_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c -I/tools/deps/lib/libffi-3.2.1/include -lffi -ldl +_ctypes_test _ctypes/_ctypes_test.c -I/tools/deps/lib/libffi-3.2.1/include -lm +_decimal _decimal/_decimal.c _decimal/libmpdec/basearith.c _decimal/libmpdec/constants.c _decimal/libmpdec/context.c _decimal/libmpdec/convolute.c _decimal/libmpdec/crt.c _decimal/libmpdec/difradix2.c _decimal/libmpdec/fnt.c _decimal/libmpdec/fourstep.c _decimal/libmpdec/io.c _decimal/libmpdec/memory.c _decimal/libmpdec/mpdecimal.c _decimal/libmpdec/numbertheory.c _decimal/libmpdec/sixstep.c _decimal/libmpdec/transpose.c -DCONFIG_64=1 -DASM=1 -IModules/_decimal/libmpdec +_dbm _dbmmodule.c -DHAVE_NDBM_H -I/tools/deps/include -L/tools/deps/lib -lgdbm_compat +_elementtree _elementtree.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat +_gdbm _gdbmmodule.c -DHAVE_NDBM_H -I/tools/deps/include -L/tools/deps/lib -lgdbm +_hashlib _hashopenssl.c -I/tools/deps/include -L/tools/deps/lib -lssl -lcrypto +_json _json.c +_lsprof _lsprof.c rotatingtree.c +_lzma _lzmamodule.c -I/tools/deps/include -L/tools/deps/lib -llzma +# TODO check setup.py logic for semaphore.c and possibly fix missing +# dependency. +_multiprocessing _multiprocessing/multiprocessing.c _multiprocessing/semaphore.c +_opcode _opcode.c +_queue _queuemodule.c +_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -I/tools/deps/include -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -L/tools/deps/lib -lsqlite3 +_ssl _ssl.c -I/tools/deps/include -lssl -lcrypto +_testbuffer _testbuffer.c +_testimportmultiple _testimportmultiple.c +_testmultiphase _testmultiphase.c +_uuid _uuidmodule.c -I/tools/deps/include/uuid -luuid +_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c +ossaudiodev ossaudiodev.c +pyexpat pyexpat.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat +readline readline.c -I/tools/deps/include -I/tools/deps/include/ncurses -L/tools/deps/lib -lreadline -lncurses +xxlimited xxlimited.c -DPy_LIMITED_API=0x03050000 \ No newline at end of file diff --git a/python-licenses.rst b/python-licenses.rst new file mode 100644 index 00000000..8f5ed914 --- /dev/null +++ b/python-licenses.rst @@ -0,0 +1,1920 @@ +======== +Licenses +======== + +This document describes the licenses of all software distributed with the +bundled application. + +bzip2 +===== + +This program, "bzip2", the associated library "libbzip2", and all +documentation, are copyright (C) 1996-2010 Julian R Seward. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Julian Seward, jseward@bzip.org +bzip2/libbzip2 version 1.0.6 of 6 September 2010 + +cpython +======= + +A. HISTORY OF THE SOFTWARE +-------------------------- + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +--------------------------------------------------------------- + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Python Software Foundation; All +Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +gdbm +==== + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007, 2011 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + +libffi +====== + +libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others. +See source files for details. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +liblzma +======= + +liblzma is in the public domain. + +libuuid +======= + +This library is free software; you can redistribute it and/or +modify it under the terms of the Modified BSD License. + +The complete text of the license is available at the +Documentation/licenses/COPYING.BSD-3 file. + +ncurses +======= + +Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, distribute with modifications, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name(s) of the above copyright +holders shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization. + +-- vile:txtmode fc=72 +-- $Id: COPYING,v 1.6 2018/01/01 12:00:00 tom Exp $ + +openssl +======= + + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a double license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +readline +======== + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + +sqlite +====== + +All of the code and documentation in SQLite has been dedicated to the public +domain by the authors. All code authors, and representatives of the companies +they work for, have signed affidavits dedicating their contributions to the +public domain and originals of those signed affidavits are stored in a firesafe +at the main offices of Hwaci. Anyone is free to copy, modify, publish, use, +compile, sell, or distribute the original SQLite code, either in source code form +or as a compiled binary, for any purpose, commercial or non-commercial, and by +any means. + +The previous paragraph applies to the deliverable code and documentation in +SQLite - those parts of the SQLite library that you actually bundle and ship +with a larger application. Some scripts used as part of the build process (for +example the "configure" scripts generated by autoconf) might fall under other +open-source licenses. Nothing from these build scripts ever reaches the final +deliverable SQLite library, however, and so the licenses associated with those +scripts should not be a factor in assessing your rights to copy and use the +SQLite library. + +All of the deliverable code in SQLite has been written from scratch. No code has +been taken from other projects or from the open internet. Every line of code can +be traced back to its original author, and all of those authors have public +domain dedications on file. So the SQLite code base is clean and is +uncontaminated with licensed code from other projects. + +zlib +==== + + (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* receiving +lengthy legal documents to sign. The sources are provided for free but without +warranty of any kind. The library has been entirely written by Jean-loup +Gailly and Mark Adler; it does not include third-party code. + +If you redistribute modified sources, we would appreciate that you include in +the file ChangeLog history information documenting your changes. Please read +the FAQ for more information on the distribution of modified source versions. diff --git a/pythonbuild/__init__.py b/pythonbuild/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pythonbuild/cpython.py b/pythonbuild/cpython.py new file mode 100644 index 00000000..da20caba --- /dev/null +++ b/pythonbuild/cpython.py @@ -0,0 +1,139 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +import os +import re +import tarfile + +# Module entries from Setup.dist that we can copy verbatim without +# issue. +STATIC_MODULES = { + b'_asyncio', + b'_bisect', + b'_blake2', + b'_codecs_cn', + b'_codecs_hk', + b'_codecs_iso2022', + b'_codecs_jp', + b'_codecs_kr', + b'_codecs_tw', + b'_contextvars', + b'_csv', + b'_datetime', + b'_heapq', + b'_md5', + b'_multibytecodec', + b'_pickle', + b'_posixsubprocess', + b'_random', + b'_sha1', + b'_sha256', + b'_sha512', + b'_sha3', + b'_socket', + b'_struct', + b'_testcapi', + b'_weakref', + b'_xxtestfuzz', + b'array', + b'audioop', + b'binascii', + b'cmath', + b'fcntl', + b'grp', + b'math', + b'mmap', + b'nis', + b'parser', + b'resource', + b'select', + b'spwd', + b'syslog', + b'termios', + b'unicodedata', + b'xxlimited', + b'zlib', +} + +# Modules we don't (yet) support building. +UNSUPPORTED_MODULES = { + b'_tkinter', +} + + +def derive_setup_local(static_modules_lines, cpython_source_archive, disabled=None): + """Derive the content of the Modules/Setup.local file.""" + # makesetup parses lines with = as extra config options. There appears + # to be no easy way to define e.g. -Dfoo=bar in Setup.local. We hack + # around this by producing a Makefile supplement that overrides the build + # rules for certain targets to include these missing values. + extra_cflags = {} + + disabled = disabled or set() + disabled |= UNSUPPORTED_MODULES + + with tarfile.open(str(cpython_source_archive)) as tf: + ifh = tf.extractfile('Python-3.7.1/Modules/Setup.dist') + source_lines = ifh.readlines() + + found_shared = False + + dest_lines = [] + make_lines = [] + + for line in source_lines: + line = line.rstrip() + + if line == b'#*shared*': + found_shared = True + dest_lines.append(b'*static*') + + if not found_shared: + continue + + if line.startswith(tuple(b'#%s' % k for k in STATIC_MODULES)): + line = line[1:] + + if b'#' in line: + line = line[:line.index(b'#')] + + module = line.split()[0] + if module in disabled: + continue + + dest_lines.append(line) + + RE_DEFINE = re.compile(b'-D[^=]+=[^\s]+') + + for line in static_modules_lines: + # makesetup parses lines with = as extra config options. There appears + # to be no easy way to define e.g. -Dfoo=bar in Setup.local. We hack + # around this by detecting the syntax we'd like to support and move the + # variable defines to a Makefile supplement that overrides variables for + # specific targets. + for m in RE_DEFINE.finditer(line): + sources = [w for w in line.split() if w.endswith(b'.c')] + for source in sources: + obj = b'Modules/%s.o' % os.path.basename(source)[:-2] + + extra_cflags.setdefault(obj, []).append(m.group(0)) + + line = RE_DEFINE.sub(b'', line) + + if b'=' in line: + raise Exception('= appears in EXTRA_MODULES line; will confuse ' + 'makesetup: %s' % line.decode('utf-8')) + dest_lines.append(line) + + dest_lines.append(b'\n*disabled*\n') + dest_lines.extend(sorted(disabled)) + + dest_lines.append(b'') + + for target in sorted(extra_cflags): + make_lines.append( + b'%s: PY_STDMODULE_CFLAGS += %s' % + (target, b' '.join(extra_cflags[target]))) + + return b'\n'.join(dest_lines), b'\n'.join(make_lines) diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py new file mode 100644 index 00000000..87ad27dc --- /dev/null +++ b/pythonbuild/downloads.py @@ -0,0 +1,175 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +DOWNLOADS = { + 'binutils': { + 'url': 'ftp://ftp.gnu.org/gnu/binutils/binutils-2.31.tar.xz', + 'size': 20445772, + 'sha256': '231036df7ef02049cdbff0681f4575e571f26ea8086cf70c2dcd3b6c0f4216bf', + 'version': '2.31', + }, + 'bzip2': { + 'url': 'https://ftp.sunet.se/mirror/archive/ftp.sunet.se/pub/Linux/distributions/bifrost/download/src/bzip2-1.0.6.tar.gz', + 'size': 782025, + 'sha256': 'a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd', + 'version': '1.0.6', + }, + 'clang': { + 'url': 'http://releases.llvm.org/7.0.0/cfe-7.0.0.src.tar.xz', + 'size': 12541904, + 'sha256': '550212711c752697d2f82c648714a7221b1207fd9441543ff4aa9e3be45bba55', + 'version': '7.0.0', + }, + 'clang-compiler-rt': { + 'url': 'http://releases.llvm.org/7.0.0/compiler-rt-7.0.0.src.tar.xz', + 'size': 1815168, + 'sha256': 'bdec7fe3cf2c85f55656c07dfb0bd93ae46f2b3dd8f33ff3ad6e7586f4c670d6', + 'version': '7.0.0', + }, + 'cmake-linux-bin': { + 'url': 'https://github.com/Kitware/CMake/releases/download/v3.13.0/cmake-3.13.0-Linux-x86_64.tar.gz', + 'size': 38391207, + 'sha256': '1c6612f3c6dd62959ceaa96c4b64ba7785132de0b9cbc719eea6fe1365cc8d94', + 'version': '3.13.0', + }, + 'cpython-3.7': { + 'url': 'https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz', + 'size': 16960060, + 'sha256': 'fa7e2b8e8c9402f192ad56dc4f814089d1c4466c97d780f5e5acc02c04243d6d', + 'version': '3.7.1', + }, + 'gcc': { + 'url': 'https://ftp.gnu.org/gnu/gcc/gcc-8.2.0/gcc-8.2.0.tar.xz', + 'size': 63460876, + 'sha256': '196c3c04ba2613f893283977e6011b2345d1cd1af9abeac58e916b1aab3e0080', + 'version': '8.2.0', + }, + 'gdbm': { + 'url': 'ftp://ftp.gnu.org/gnu/gdbm/gdbm-1.18.1.tar.gz', + 'size': 941863, + 'sha256': '86e613527e5dba544e73208f42b78b7c022d4fa5a6d5498bf18c8d6f745b91dc', + 'version': '1.18.1', + }, + 'gmp': { + 'url': 'https://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.xz', + 'size': 1946336, + 'sha256': '87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912', + 'version': '6.1.2', + }, + 'isl': { + 'url': 'ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2', + 'size': 1658291, + 'sha256': '6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b', + 'version': '0.18', + }, + 'libc++': { + 'url': 'http://releases.llvm.org/7.0.0/libcxx-7.0.0.src.tar.xz', + 'size': 1652496, + 'sha256': '9b342625ba2f4e65b52764ab2061e116c0337db2179c6bce7f9a0d70c52134f0', + 'version': '7.0.0', + }, + 'libc++abi': { + 'url': 'http://releases.llvm.org/7.0.0/libcxxabi-7.0.0.src.tar.xz', + 'size': 535792, + 'sha256': '9b45c759ff397512eae4d938ff82827b1bd7ccba49920777e5b5e460baeb245f', + 'version': '7.0.0', + }, + 'libffi': { + 'url': 'ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz', + 'size': 940837, + 'sha256': 'd06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37', + 'version': '3.2.1', + }, + 'libx11': { + 'url': 'https://www.x.org/releases/X11R7.7/src/lib/libX11-1.5.0.tar.gz', + 'size': 3073820, + 'sha256': '2ddc05170baf70dd650ee6108c5882eb657cafaf61a5b5261badb26703122518', + }, + 'lld': { + 'url': 'http://releases.llvm.org/7.0.0/lld-7.0.0.src.tar.xz', + 'size': 915692, + 'sha256': 'fbcf47c5e543f4cdac6bb9bbbc6327ff24217cd7eafc5571549ad6d237287f9c', + 'version': '7.0.0', + }, + 'llvm': { + 'url': 'http://releases.llvm.org/7.0.0/llvm-7.0.0.src.tar.xz', + 'size': 28324368, + 'sha256': '8bc1f844e6cbde1b652c19c1edebc1864456fd9c78b8c1bea038e51b363fe222', + 'version': '7.0.0', + }, + 'mpc': { + 'url': 'http://www.multiprecision.org/downloads/mpc-1.0.3.tar.gz', + 'size': 669925, + 'sha256': '617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3', + 'version': '1.0.3', + }, + 'mpfr': { + 'url': 'https://ftp.gnu.org/gnu/mpfr/mpfr-3.1.6.tar.xz', + 'size': 1133672, + 'sha256': '7a62ac1a04408614fccdc506e4844b10cf0ad2c2b1677097f8f35d3a1344a950', + 'version': '3.1.6', + }, + 'ncurses': { + 'url': 'https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz', + 'size': 3365395, + 'sha256': 'aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17', + 'version': '6.1', + }, + 'ninja-linux-bin': { + 'url': 'https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip', + 'size': 77854, + 'sha256': 'd2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07', + }, + 'openssl': { + 'url': 'https://www.openssl.org/source/openssl-1.1.1a.tar.gz', + 'size': 8350547, + 'sha256': 'fc20130f8b7cbd2fb918b2f14e2f429e109c31ddd0fb38fc5d71d9ffed3f9f41', + 'version': '1.1.1a', + }, + 'readline': { + 'url': 'ftp://ftp.gnu.org/gnu/readline/readline-6.3.tar.gz', + 'size': 2468560, + 'sha256': '56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43', + 'version': '6.3', + }, + 'rust': { + 'url': 'https://static.rust-lang.org/dist/rust-1.30.1-x86_64-unknown-linux-gnu.tar.gz', + 'size': 236997689, + 'sha256': 'a01a493ed8946fc1c15f63e74fc53299b26ebf705938b4d04a388a746dfdbf9e', + }, + 'sqlite': { + 'url': 'https://www.sqlite.org/2018/sqlite-autoconf-3250300.tar.gz', + 'size': 2764429, + 'sha256': '00ebf97be13928941940cc71de3d67e9f852698233cd98ce2d178fd08092f3dd', + 'version': '3250300', + }, + 'tcl': { + 'url': 'https://prdownloads.sourceforge.net/tcl/tcl8.6.9-src.tar.gz', + 'size': 10000896, + 'sha256': 'ad0cd2de2c87b9ba8086b43957a0de3eb2eb565c7159d5f53ccbba3feb915f4e', + }, + 'tk': { + 'url': 'https://prdownloads.sourceforge.net/tcl/tk8.6.9.1-src.tar.gz', + 'size': 4364603, + 'sha256': '8fcbcd958a8fd727e279f4cac00971eee2ce271dc741650b1fc33375fb74ebb4', + }, + 'uuid': { + 'url': 'https://sourceforge.net/projects/libuuid/files/libuuid-1.0.3.tar.gz', + 'size': 318256, + 'sha256': '46af3275291091009ad7f1b899de3d0cea0252737550e7919d17237997db5644', + 'version': '1.0.3', + }, + 'xz': { + 'url': 'https://tukaani.org/xz/xz-5.2.4.tar.gz', + 'size': 1572354, + 'sha256': 'b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145', + 'version': '5.2.4', + }, + 'zlib': { + 'url': 'https://zlib.net/zlib-1.2.11.tar.gz', + 'size': 607698, + 'sha256': 'c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1', + 'version': '1.2.11', + }, +} diff --git a/pythonbuild/utils.py b/pythonbuild/utils.py new file mode 100644 index 00000000..ff3077b8 --- /dev/null +++ b/pythonbuild/utils.py @@ -0,0 +1,127 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +import gzip +import hashlib +import os +import pathlib +import tarfile +import urllib.request + +from .downloads import ( + DOWNLOADS, +) + + +def hash_path(p: pathlib.Path): + h = hashlib.sha256() + + with p.open('rb') as fh: + while True: + chunk = fh.read(65536) + if not chunk: + break + + h.update(chunk) + + return h.hexdigest() + + +class IntegrityError(Exception): + """Represents an integrity error when downloading a URL.""" + + +def secure_download_stream(url, size, sha256): + """Securely download a URL to a stream of chunks. + + If the integrity of the download fails, an IntegrityError is + raised. + """ + h = hashlib.sha256() + length = 0 + + with urllib.request.urlopen(url) as fh: + if not url.endswith('.gz') and fh.info().get('Content-Encoding') == 'gzip': + fh = gzip.GzipFile(fileobj=fh) + + while True: + chunk = fh.read(65536) + if not chunk: + break + + h.update(chunk) + length += len(chunk) + + yield chunk + + digest = h.hexdigest() + + if length != size: + raise IntegrityError('size mismatch on %s: wanted %d; got %d' % ( + url, size, length)) + + if digest != sha256: + raise IntegrityError('sha256 mismatch on %s: wanted %s; got %s' % ( + url, sha256, digest)) + + +def download_to_path(url: str, path: pathlib.Path, size: int, sha256: str): + """Download a URL to a filesystem path, possibly with verification.""" + + # We download to a temporary file and rename at the end so there's + # no chance of the final file being partially written or containing + # bad data. + print('downloading %s to %s' % (url, path)) + + if path.exists(): + good = True + + if path.stat().st_size != size: + print('existing file size is wrong; removing') + good = False + + if good: + if hash_path(path) != sha256: + print('existing file hash is wrong; removing') + good = False + + if good: + print('%s exists and passes integrity checks' % path) + return + + path.unlink() + + tmp = path.with_name('%s.tmp' % path.name) + + try: + with tmp.open('wb') as fh: + for chunk in secure_download_stream(url, size, sha256): + fh.write(chunk) + except IntegrityError: + tmp.unlink() + raise + + tmp.rename(path) + print('successfully downloaded %s' % url) + + +def download_entry(key: str, dest_path: pathlib.Path) -> pathlib.Path: + entry = DOWNLOADS[key] + url = entry['url'] + + local_path = dest_path / pathlib.Path(url[url.index('/'):]).name + download_to_path(url, local_path, entry['size'], entry['sha256']) + + return local_path + + +def create_tar_from_directory(fh, base_path: pathlib.Path): + with tarfile.open(name='', mode='w', fileobj=fh, dereference=True) as tf: + for root, dirs, files in os.walk(base_path): + dirs.sort() + + for f in sorted(files): + full = base_path / root / f + rel = full.relative_to(base_path) + tf.add(full, rel) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..b574465e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,146 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile --generate-hashes --output-file requirements.txt requirements.txt.in +# +certifi==2018.11.29 \ + --hash=sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7 \ + --hash=sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033 \ + # via requests +cffi==1.11.5 \ + --hash=sha256:151b7eefd035c56b2b2e1eb9963c90c6302dc15fbd8c1c0a83a163ff2c7d7743 \ + --hash=sha256:1553d1e99f035ace1c0544050622b7bc963374a00c467edafac50ad7bd276aef \ + --hash=sha256:1b0493c091a1898f1136e3f4f991a784437fac3673780ff9de3bcf46c80b6b50 \ + --hash=sha256:2ba8a45822b7aee805ab49abfe7eec16b90587f7f26df20c71dd89e45a97076f \ + --hash=sha256:3bb6bd7266598f318063e584378b8e27c67de998a43362e8fce664c54ee52d30 \ + --hash=sha256:3c85641778460581c42924384f5e68076d724ceac0f267d66c757f7535069c93 \ + --hash=sha256:3eb6434197633b7748cea30bf0ba9f66727cdce45117a712b29a443943733257 \ + --hash=sha256:495c5c2d43bf6cebe0178eb3e88f9c4aa48d8934aa6e3cddb865c058da76756b \ + --hash=sha256:4c91af6e967c2015729d3e69c2e51d92f9898c330d6a851bf8f121236f3defd3 \ + --hash=sha256:57b2533356cb2d8fac1555815929f7f5f14d68ac77b085d2326b571310f34f6e \ + --hash=sha256:770f3782b31f50b68627e22f91cb182c48c47c02eb405fd689472aa7b7aa16dc \ + --hash=sha256:79f9b6f7c46ae1f8ded75f68cf8ad50e5729ed4d590c74840471fc2823457d04 \ + --hash=sha256:7a33145e04d44ce95bcd71e522b478d282ad0eafaf34fe1ec5bbd73e662f22b6 \ + --hash=sha256:857959354ae3a6fa3da6651b966d13b0a8bed6bbc87a0de7b38a549db1d2a359 \ + --hash=sha256:87f37fe5130574ff76c17cab61e7d2538a16f843bb7bca8ebbc4b12de3078596 \ + --hash=sha256:95d5251e4b5ca00061f9d9f3d6fe537247e145a8524ae9fd30a2f8fbce993b5b \ + --hash=sha256:9d1d3e63a4afdc29bd76ce6aa9d58c771cd1599fbba8cf5057e7860b203710dd \ + --hash=sha256:a36c5c154f9d42ec176e6e620cb0dd275744aa1d804786a71ac37dc3661a5e95 \ + --hash=sha256:a6a5cb8809091ec9ac03edde9304b3ad82ad4466333432b16d78ef40e0cce0d5 \ + --hash=sha256:ae5e35a2c189d397b91034642cb0eab0e346f776ec2eb44a49a459e6615d6e2e \ + --hash=sha256:b0f7d4a3df8f06cf49f9f121bead236e328074de6449866515cea4907bbc63d6 \ + --hash=sha256:b75110fb114fa366b29a027d0c9be3709579602ae111ff61674d28c93606acca \ + --hash=sha256:ba5e697569f84b13640c9e193170e89c13c6244c24400fc57e88724ef610cd31 \ + --hash=sha256:be2a9b390f77fd7676d80bc3cdc4f8edb940d8c198ed2d8c0be1319018c778e1 \ + --hash=sha256:ca1bd81f40adc59011f58159e4aa6445fc585a32bb8ac9badf7a2c1aa23822f2 \ + --hash=sha256:d5d8555d9bfc3f02385c1c37e9f998e2011f0db4f90e250e5bc0c0a85a813085 \ + --hash=sha256:e55e22ac0a30023426564b1059b035973ec82186ddddbac867078435801c7801 \ + --hash=sha256:e90f17980e6ab0f3c2f3730e56d1fe9bcba1891eeea58966e89d352492cc74f4 \ + --hash=sha256:ecbb7b01409e9b782df5ded849c178a0aa7c906cf8c5a67368047daab282b184 \ + --hash=sha256:ed01918d545a38998bfa5902c7c00e0fee90e957ce036a4000a88e3fe2264917 \ + --hash=sha256:edabd457cd23a02965166026fd9bfd196f4324fe6032e866d0f3bd0301cd486f \ + --hash=sha256:fdf1c1dc5bafc32bc5d08b054f94d659422b05aba244d6be4ddc1c72d9aa70fb \ + # via zstandard +chardet==3.0.4 \ + --hash=sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae \ + --hash=sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691 \ + # via requests +click==7.0 \ + --hash=sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13 \ + --hash=sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7 \ + # via pip-tools +docker-pycreds==0.4.0 \ + --hash=sha256:6ce3270bcaf404cc4c3e27e4b6c70d3521deae82fb508767870fdbf772d584d4 \ + --hash=sha256:7266112468627868005106ec19cd0d722702d2b7d5912a28e19b826c3d37af49 \ + # via docker +docker==3.6.0 \ + --hash=sha256:145c673f531df772a957bd1ebc49fc5a366bcd55efa0e64bbd029f5cc7a1fd8e \ + --hash=sha256:666611862edded75f6049893f779bff629fdcd4cd21ccf01d648626e709adb13 +idna==2.8 \ + --hash=sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407 \ + --hash=sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c \ + # via requests +jinja2==2.10 \ + --hash=sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd \ + --hash=sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4 +markupsafe==1.1.0 \ + --hash=sha256:048ef924c1623740e70204aa7143ec592504045ae4429b59c30054cb31e3c432 \ + --hash=sha256:130f844e7f5bdd8e9f3f42e7102ef1d49b2e6fdf0d7526df3f87281a532d8c8b \ + --hash=sha256:19f637c2ac5ae9da8bfd98cef74d64b7e1bb8a63038a3505cd182c3fac5eb4d9 \ + --hash=sha256:1b8a7a87ad1b92bd887568ce54b23565f3fd7018c4180136e1cf412b405a47af \ + --hash=sha256:1c25694ca680b6919de53a4bb3bdd0602beafc63ff001fea2f2fc16ec3a11834 \ + --hash=sha256:1f19ef5d3908110e1e891deefb5586aae1b49a7440db952454b4e281b41620cd \ + --hash=sha256:1fa6058938190ebe8290e5cae6c351e14e7bb44505c4a7624555ce57fbbeba0d \ + --hash=sha256:31cbb1359e8c25f9f48e156e59e2eaad51cd5242c05ed18a8de6dbe85184e4b7 \ + --hash=sha256:3e835d8841ae7863f64e40e19477f7eb398674da6a47f09871673742531e6f4b \ + --hash=sha256:4e97332c9ce444b0c2c38dd22ddc61c743eb208d916e4265a2a3b575bdccb1d3 \ + --hash=sha256:525396ee324ee2da82919f2ee9c9e73b012f23e7640131dd1b53a90206a0f09c \ + --hash=sha256:52b07fbc32032c21ad4ab060fec137b76eb804c4b9a1c7c7dc562549306afad2 \ + --hash=sha256:52ccb45e77a1085ec5461cde794e1aa037df79f473cbc69b974e73940655c8d7 \ + --hash=sha256:5c3fbebd7de20ce93103cb3183b47671f2885307df4a17a0ad56a1dd51273d36 \ + --hash=sha256:5e5851969aea17660e55f6a3be00037a25b96a9b44d2083651812c99d53b14d1 \ + --hash=sha256:5edfa27b2d3eefa2210fb2f5d539fbed81722b49f083b2c6566455eb7422fd7e \ + --hash=sha256:7d263e5770efddf465a9e31b78362d84d015cc894ca2c131901a4445eaa61ee1 \ + --hash=sha256:83381342bfc22b3c8c06f2dd93a505413888694302de25add756254beee8449c \ + --hash=sha256:857eebb2c1dc60e4219ec8e98dfa19553dae33608237e107db9c6078b1167856 \ + --hash=sha256:98e439297f78fca3a6169fd330fbe88d78b3bb72f967ad9961bcac0d7fdd1550 \ + --hash=sha256:bf54103892a83c64db58125b3f2a43df6d2cb2d28889f14c78519394feb41492 \ + --hash=sha256:d9ac82be533394d341b41d78aca7ed0e0f4ba5a2231602e2f05aa87f25c51672 \ + --hash=sha256:e982fe07ede9fada6ff6705af70514a52beb1b2c3d25d4e873e82114cf3c5401 \ + --hash=sha256:edce2ea7f3dfc981c4ddc97add8a61381d9642dc3273737e756517cc03e84dd6 \ + --hash=sha256:efdc45ef1afc238db84cb4963aa689c0408912a0239b0721cb172b4016eb31d6 \ + --hash=sha256:f137c02498f8b935892d5c0172560d7ab54bc45039de8805075e19079c639a9c \ + --hash=sha256:f82e347a72f955b7017a39708a3667f106e6ad4d10b25f237396a7115d8ed5fd \ + --hash=sha256:fb7c206e01ad85ce57feeaaa0bf784b97fa3cad0d4a5737bc5295785f5c613a1 \ + # via jinja2 +pip-tools==3.1.0 \ + --hash=sha256:31b43e5f8d605fc84f7506199025460abcb98a29d12cc99db268f73e39cf55e5 \ + --hash=sha256:b1ceca03b4a48346b2f6870565abb09d8d257d5b1524b4c6b222185bf26c3870 +pycparser==2.19 \ + --hash=sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3 \ + # via cffi +requests==2.21.0 \ + --hash=sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e \ + --hash=sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b \ + # via docker +six==1.12.0 \ + --hash=sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c \ + --hash=sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73 \ + # via docker, docker-pycreds, pip-tools, websocket-client +urllib3==1.24.1 \ + --hash=sha256:61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39 \ + --hash=sha256:de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22 \ + # via requests +websocket-client==0.54.0 \ + --hash=sha256:8c8bf2d4f800c3ed952df206b18c28f7070d9e3dcbd6ca6291127574f57ee786 \ + --hash=sha256:e51562c91ddb8148e791f0155fdb01325d99bb52c4cdbb291aee7a3563fd0849 \ + # via docker +zstandard==0.10.2 \ + --hash=sha256:08114ac056944e7f70c0faf99d0afbce08b078eacf8ee6698985654c7e725234 \ + --hash=sha256:087276799ddf3200b4724e3d6f57b11ba975d9243b4af9e95721397d795a2497 \ + --hash=sha256:0c21feac9f7c850a457b1c707c3cc4f3b8f475a3c9120f8cec82ebc3b215b80a \ + --hash=sha256:0fe6403a01e996a7247239691101148dc4071ccf7fe12b680d7b6c91a04aefbb \ + --hash=sha256:1383412acd5356ff543c434723f2e7794c77e1ed4efc1062464cc2112c09af50 \ + --hash=sha256:2acd18eeac4fcecef8c1b95d4ffaa606222aa1ba0d4372e829dc516b0504e6ef \ + --hash=sha256:302bd7b3bc7281015cd6f975207755c534551d0a32c79147518f2de0459dbef4 \ + --hash=sha256:390acfced0106fb12247e12c2aa399836e6686f5ba9daec332957ff830f215cd \ + --hash=sha256:43ec51075547d498ec6e7952e459c3817e610d6e4ca68f4fa43a16ccea01d496 \ + --hash=sha256:53f89a65d52d6fb56b2c5dd0445f30ca25852f344ba20de325ce6767dd842fca \ + --hash=sha256:5f4f650b83b8085862de9e555d87f6053ca577b4070f4c6610a870116c4dd1f4 \ + --hash=sha256:72ef2361d90a717457376351acb5b1b0c189a09dbd95adcb51907a96b79a6add \ + --hash=sha256:7ef5c7ede8e8cda2a37c0ecab456f4cfae2c42049f51b24edb5303dbfe318ea6 \ + --hash=sha256:86c9dee0fe6d4ea5bf394767929fdf5f924d161d9a6d23adcd58a690c5e160b0 \ + --hash=sha256:8b587c9a17f4b050274d9b7f9284d5fae0a8d6a8021f88f779345593326bc33d \ + --hash=sha256:91025801859a60b7761dea6a8b645f25be6d3639ef828423f094d90b3f60850e \ + --hash=sha256:9d2940e2801cc768d2cb71e71dca3b025ca3737e9d1d0fad0c95b2e7db0c947a \ + --hash=sha256:aa520b90eede823632013a319e91652d8226a6309a104cffdc7e00d5a2b5e66b \ + --hash=sha256:b10fba39049595827f228e77e7b5070cb39c46466bf8fef51da73220a20cc717 \ + --hash=sha256:c794b5c21485fb3232f5693995ba1a497267b1aecb70b218107cf131f8dc1d3d \ + --hash=sha256:d05516bc197c5b7b2aa2f834ea7c5ee9fd9aa3034f4193cc05d899b18251aa9c \ + --hash=sha256:d085c2c676f03357e5d6b11dbbf4e8c1b0d20b1066ac87e6cccc45d4b6c19675 \ + --hash=sha256:dd40e26aaee67b9078618b0fce3d5f209e328852f2c72c6772cf6352f57d2ed1 \ + --hash=sha256:e7b84c10ed30c1c997d81ef271945372fba9e18ac58d77a17d43fd9c42392ed4 \ + --hash=sha256:e982d8af9618d45b25456f1f80e6d628295772d74d755f9a46b90711b7a56067 \ + --hash=sha256:ef24c8ec97f93b2bdf1080553cdf38ea9ab195846b679cdcfe683c945ed2f1ee \ + --hash=sha256:f46c5021c3663f82c2ff994295a8574638d56a831ca2a26d736d47fbcf4f9187 diff --git a/requirements.txt.in b/requirements.txt.in new file mode 100644 index 00000000..21301a0d --- /dev/null +++ b/requirements.txt.in @@ -0,0 +1,4 @@ +docker +jinja2 +pip-tools +zstandard