refactor: replace ./make (python3) with ./mk (makefile) (#343)

This pull request fixes https://github.com/ooni/probe/issues/1471. We have replaced the original build script (`./make`) with the `./mk` makefile (executable using `#!/usr/bin/make -f`). We concluded supporting direct builds from Windows is not worth the effort and halving the code we need to maintain is probably a good plus. Both macOS and Linux install GNU make at `/usr/bin/make`, so we should be okay in the common use cases.

I significantly simplified the management of Go versioning by requiring the user to manage it and by enforcing that we are using the desired Go version. This speeds up builds and works in sane operating systems that use the last version of a specific package. Otherwise, it's possible to use the `go get golang.org/dl/go${version}` feature.

The remaining question mark was related to updating the Android SDK. I have determined that a good course of action is pinning to the latest CLI tools and always forcing the CLI tools to install the latest required packages (e.g., the NDK).
This commit is contained in:
Simone Basso
2021-05-11 16:15:13 +02:00
committed by GitHub
parent 6841db6cb0
commit b2209bb637
11 changed files with 668 additions and 1480 deletions
+4 -1
View File
@@ -8,5 +8,8 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.16.4"
- uses: actions/checkout@v2
- run: ./make --disable-embedding-psiphon-config -t ./MOBILE/android/oonimkall.aar
- run: ./mk OONI_PSIPHON_TAGS="" ./MOBILE/android/oonimkall.aar
+4 -1
View File
@@ -8,5 +8,8 @@ jobs:
test:
runs-on: macos-10.15
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.16.4"
- uses: actions/checkout@v2
- run: ./make --disable-embedding-psiphon-config -t ./MOBILE/ios/oonimkall.framework.zip
- run: ./mk OONI_PSIPHON_TAGS="" XCODE_VERSION=12.4 ./MOBILE/ios/oonimkall.framework.zip
+6 -5
View File
@@ -13,11 +13,11 @@ jobs:
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- uses: actions/checkout@v2
- run: ./make --disable-embedding-psiphon-config -t ./CLI/linux/amd64/ooniprobe
- run: ./mk OONI_PSIPHON_TAGS="" ./CLI/linux/amd64/ooniprobe
env:
DOCKER_CLI_EXPERIMENTAL: enabled
- run: ./smoketest.sh ./CLI/linux/amd64/ooniprobe
- run: ./make --disable-embedding-psiphon-config -t debian_amd64
- run: ./mk OONI_PSIPHON_TAGS="" DEBIAN_TILDE_VERSION=$GITHUB_RUN_NUMBER ./debian/amd64
- run: sudo apt-get install -y --no-install-recommends git python3 python3-requests python3-gnupg s3cmd
- run: |
for deb in *.deb; do
@@ -35,12 +35,13 @@ jobs:
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- uses: actions/checkout@v2
- run: sudo apt-get install qemu-user-static
- run: ./make --disable-embedding-psiphon-config -t ./CLI/linux/arm64/ooniprobe
- run: sudo apt-get update -q
- run: sudo apt-get install -y qemu-user-static
- run: ./mk OONI_PSIPHON_TAGS="" ./CLI/linux/arm64/ooniprobe
env:
DOCKER_CLI_EXPERIMENTAL: enabled
- run: ./smoketest.sh ./CLI/linux/arm64/ooniprobe
- run: ./make --disable-embedding-psiphon-config -t debian_arm64
- run: ./mk OONI_PSIPHON_TAGS="" DEBIAN_TILDE_VERSION=$GITHUB_RUN_NUMBER ./debian/arm64
- run: sudo apt-get install -y --no-install-recommends git python3 python3-requests python3-gnupg s3cmd
- run: |
for deb in *.deb; do
+4 -1
View File
@@ -8,6 +8,9 @@ jobs:
build:
runs-on: "macos-10.15"
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.16.4"
- uses: actions/checkout@v2
- run: ./make --disable-embedding-psiphon-config -t ./CLI/darwin/amd64/ooniprobe
- run: ./mk OONI_PSIPHON_TAGS="" ./CLI/darwin/amd64/ooniprobe
- run: ./smoketest.sh ./CLI/darwin/amd64/ooniprobe
+4 -1
View File
@@ -10,8 +10,11 @@ jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.16.4"
- uses: actions/checkout@v2
- run: ./make --disable-embedding-psiphon-config -t miniooni
- run: ./mk OONI_PSIPHON_TAGS="" ./CLI/miniooni
- run: ./CLI/linux/amd64/miniooni --yes -nNi https://example.com web_connectivity
+4 -1
View File
@@ -8,9 +8,12 @@ jobs:
build:
runs-on: "ubuntu-20.04"
steps:
- uses: actions/setup-go@v1
with:
go-version: "1.16.4"
- uses: actions/checkout@v2
- run: sudo apt install mingw-w64
- run: ./make --disable-embedding-psiphon-config -t ./CLI/windows/amd64/ooniprobe.exe
- run: ./mk OONI_PSIPHON_TAGS="" MINGW_W64_VERSION="9.3-win32" ./CLI/windows/amd64/ooniprobe.exe
- uses: actions/upload-artifact@v2
with:
name: ooniprobe.exe