From d921e01662c25df0ab021baf6b4e92c030148a84 Mon Sep 17 00:00:00 2001 From: Laurent Girod Date: Tue, 15 Feb 2022 12:58:48 +0100 Subject: [PATCH] Update build instructions --- Vagrantfile | 8 ++++++++ build.md | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 91f0af9..743ef38 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,6 +1,13 @@ # -*- mode: ruby -*- # vi: set ft=ruby : +$install_qemu = <<-EOF +echo 'Install QEMU.' +export DEBIAN_FRONTEND="noninteractive" +apt-get update +apt-get install -y qemu binfmt-support qemu-user-static +EOF + $change_vsyscall = <<-EOF echo 'Enable vsyscall emulation.' sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="\(.\+\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 vsyscall=emulate"/g' /etc/default/grub @@ -11,6 +18,7 @@ Vagrant.configure("2") do |config| config.vm.box = "generic/debian10" config.vm.synced_folder ".", "/host" config.vm.provision :docker + config.vm.provision "shell", inline: $install_qemu config.vm.provision "shell", inline: $change_vsyscall config.trigger.after [:provision] do |t| t.name = "Reboot to have vsyscall emulation." diff --git a/build.md b/build.md index 959c10c..0dc3c57 100644 --- a/build.md +++ b/build.md @@ -1,9 +1,8 @@ Wheels Building =============== -Petrelic is distributed as wheels with the libraries [Relic](https://github.com/relic-toolkit/relic) and [GMP](https://gmplib.org/) embedded. The wheels are build with `manylinux1` and the libraries are embedded by using auditwheel. +Petrelic is distributed as wheels with the libraries [Relic](https://github.com/relic-toolkit/relic) and [GMP](https://gmplib.org/) embedded. The wheels are build with `manylinux2014` and the libraries are embedded by auditwheel, QEMU is used to build non-native wheels. -The `manylinux1` Docker container rely on the legacy `vsyscall` API from the Linux Kernel. To ease the creation of wheels, a Vagrant configuration to build a VM with the emulation enabled is provided. Steps ----- @@ -22,12 +21,14 @@ Steps bash build.sh ``` -* The script will create a temporary directory, download the sources of the dependencies and start a `manylinux1` Docker container. Inside the container, a second script will run to compile the dependencies and build the wheels for the supported Python versions. At the end, the first script will copy the wheels into the `/host` directory they will therefore be available from the host. +* The script will download the sources of the dependencies and start a `manylinux2014` Docker container for each supported architecture (currently x86\_64 and aarch64). Inside the container, a second script will compile the dependencies and build the wheels for the supported Python versions (currently 3.7, 3.8, 3.9, and 3.10). -* Remains to logout from the vagrant VM and shut it down. +Once the script finished building the wheels, the build script will copy the wheels to the `wheelhouse` directory on the host. + +* You can now logout from the vagrant VM and shut it down. ``` vagrant halt ``` -* The wheels are contained in the `wheelhouse` directory. +* The produced wheels will be contained in the `wheelhouse` directory.