Skip to content

Commit

Permalink
Update build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Girod committed Feb 15, 2022
1 parent b13ad68 commit d921e01
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 8 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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."
Expand Down
11 changes: 6 additions & 5 deletions build.md
Original file line number Diff line number Diff line change
@@ -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
-----
Expand All @@ -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.

0 comments on commit d921e01

Please sign in to comment.