Commit Graph

23 Commits

Author SHA1 Message Date
Arturo Filastò
d6def35286
cli: add support for passing proxy command line parameter (#981)
This implements the bare minimum needed to have circumvention proxy support in OONI Probe CLI.

The reference issue is https://github.com/ooni/probe/issues/1955. (Most of that issue is implemented, save for the fact that currently we do not have support for `http` and `https` proxies.)

While there, add to `Makefile` a rule for correctly building `ooniprobe` and `miniooni` for "this system" (i.e., the default `GOOS` and `GOARCH` on a system), because we needed this for testing this patch and we needed to figure out the commands instead.
2022-11-15 09:55:05 +01:00
Simone Basso
89a584f93b
fix(go-build-alpine): honour OONI_PSIPHON_TAGS (#968)
Closes https://github.com/ooni/probe/issues/2334.

While there, reinstate integration tests, which were also lost in a previous refactoring. However, only run those tests for linux/amd64 because we can be confident that the Go compiler is WAI for all archs we support.

While there, always use bash for running end-to-end tests.

H/T @ainghazal for discovering and reporting this bug.
2022-10-03 11:55:47 +02:00
Simone Basso
196ac55493
fix: attempt to make linux builds faster (#911)
This work aims to make Linux builds faster to make https://github.com/ooni/probe/issues/2249 more convenient. Since those builds runs inside Docker, the problem to solve here is to save/restore the Go caches notwithstanding Docker. Because Docker runs as root, we need to modify the build a bit to run as a normal user. Otherwise, we will not be able to save the Go cache using actions/cache@v3. (Other approaches such as using `sudo` are possible but running the build as an unprivileged user actually looks cleaner, so I chose to do that.) While there, add a `.editorconfig`.
2022-08-30 21:13:33 +02:00
Simone Basso
0d57899f46
feat: stop cross compiling miniooni (#908)
See https://github.com/ooni/probe/issues/2119

While there, shrink the Makefile to only export the minimum
set of rules to comfortable build using GHA.
2022-08-30 11:36:59 +02:00
Simone Basso
d48d44b880
feat: build miniooni and ooniprobe for android (#907)
This diff introduces a build script, makefile rules, and github actions
rules to build and public android CLI releases.

See https://github.com/ooni/probe/issues/1723
2022-08-30 09:37:15 +02:00
Simone Basso
ffc2527fc5
fix: repair broken linux-static build (#902)
The issue here is that the repository is owned by the user who
runs the command and the container runs as root.

Part of https://github.com/ooni/probe/issues/2130
2022-08-29 15:45:41 +02:00
Simone Basso
37632f60d9
fix: repair releasing miniooni and ooniprobe-windows (#900)
It seems several CI builds failed for [v3.16.0-alpha](https://github.com/ooni/probe-cli/releases/tag/v3.16.0-alpha). Let's aim to repair miniooni and ooniprobe-windows for now. The other failing builds seem more tricky. (Android fails with an unsupported NDK while Linux fails with issues accessing the git repository from Docker, probably because the  the user running inside Docker is not the user that owns the repository.)
2022-08-29 00:48:46 +02:00
Simone Basso
5c0368c862
refactor(mk): move build rules into separate scripts (#855)
See https://github.com/ooni/probe/issues/2218
2022-08-17 13:16:53 +02:00
Simone Basso
fdbf871103
[forwardport] ci/cd: publish binaries onto a release when we create a tag (#609) (#611)
This diff forwardports 856e436e20d511a4f0d618546da7921fa9f8c5f6 to the master branch

Original commit message:

- - -

This pull request changes `mk` and github workflows to build and publish binaries on tag. We also update the documentation to explain this new branching model. Basically, we have release branches where we produce binary packages and we add extra code, on tag, to publish such packages inside a release.

We discussed removing most secrets from builds in this repository and having a different tool/repository that takes in input also secrets for doing follow-up actions after publishing. As a consequence, this pull request also removes all pieces of code that require secrets. The next step is to reinstate this code in this new repository/tool.

The existing code in `mk` also implemented caching. This feature was useful when doing local builds because it reduced the time required to obtain binary releases. With builds running as part of GitHub actions, we don't need caching because we spawn parallel machines to build binaries. Therefore, let us also remove caching, which makes the code simpler. (Caching in itself is hard and in https://github.com/ooni/probe/issues/1875 I noted that, for example, caching of the `ooni/go` repository was leading to some unwanted behaviour when changing the branch. Without caching, this behaviour is gone and we always generally use fresh information to produce builds.) Of course, this means that local builds are now slower, but I do not think this is a problem _because_ we want to use GitHub actions for building in the common case.

Reference issues: https://github.com/ooni/probe/issues/1879 and https://github.com/ooni/probe/issues/1875.

The final aspect to mention to conclude this description is an implementation one:

```
          gh release create -p $tag --target $GITHUB_SHA || true
```

The code above uses `|| true` because there could already be a release. So, basically, it means that, if a release does not already exist, then we're going to create one. Otherwise, it does not matter because there's already a release.
2021-11-23 15:56:25 +01:00
Simone Basso
7f0fb5e619
feat: publish miniooni binaries into releases (#607)
This is the miniooni related part of https://github.com/ooni/probe/issues/1879.

This diff will require backport to the release/3.11 branch.
2021-11-22 13:40:36 +01:00
Simone Basso
638acb0830
fix: build ooniprobe for linux using debian/amd64 (#552) (#553)
In https://github.com/ooni/probe/issues/1741, we observed that
every attempt to use `docker --platform` along with `debian` for
packaging ooniprobe fails with `SEGFAULT`, except when using
the `debian:oldstable` container.

To fix this issue, in this diff we fix Debian packaging to run on
any debian system (`debian:stable` in our case) provided that we
have `qemu-user-static` installed on the system and the system is
a Debian (or Debian-derived) system.

The trick here is to use `dpkg-buildpackage -a $deb_arch`. We
also need to disable a few `debian/rules` that we don't actually
need anyway.

Closes https://github.com/ooni/probe/issues/1741.

This cherry-picks 36a5bf34f99f382a081efd642dd472888a57602b
from the stable branch into the master branch.
2021-10-22 15:14:11 +02:00
Simone Basso
e9da23f123
fix(debian): make sure we can publish all archs (#350)
We are mostly good to declare a stable release. We still need to deal with https://github.com/ooni/probe/issues/1484.

In this PR, we fix the aforementioned issue. These are the changes:

1. we remove the vendored `debops-ci`, and we pull it directly from `ooni/sysadmin`
2. we introduce a new script, `./CLI/linux/pubdebian`, to publish packages
3. we modify `./mk` to allow for publishing debian packages built outside of CI

The latter point has been quite useful in debugging what was wrong.
2021-05-19 13:54:19 +02:00
Simone Basso
f77f54bcc9
feat: build and publish debian/{armhf,i386} (#344)
* feat: build and publish debian/{armhf,i386}

Part of https://github.com/ooni/probe/issues/807

* zap temporary build
2021-05-11 20:16:27 +02:00
Simone Basso
b2209bb637
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).
2021-05-11 16:15:13 +02:00
Simone Basso
3109d56aef
feat(gha): build debian package using ./make (#331)
Part of https://github.com/ooni/probe/issues/1466. We're building both `arm64` and `amd64`. We are still not publishing `arm64` packages, which is what is asked in the original issue, but we're really close to doing that.
2021-05-06 22:13:09 +02:00
Simone Basso
c258a0fedd
CLI, debian, make: misc cleanup and changes (#336)
This PR	groups misc cleanup and changes from https://github.com/ooni/probe-cli/pull/331.

* CLI/linux/build: add documentation

* debian/.gitignore: ignore generated files

* debian/TODO: unnecessary at this point

* debian/ooniprobe-cli.service: remove commented out lines

* debian/rules: remove unnecessary actions

* make: reindent and fix spelling

* smoketest.sh: don't run in verbose mode

Part of https://github.com/ooni/probe/issues/1466
2021-05-06 21:20:45 +02:00
Simone Basso
0f98caf3b4
feat(make): sign more generated binaries (#330)
* doc(make): add not about qemu-user-static

While still investigating https://github.com/ooni/probe/issues/1466

* feat(make): sign more generated binaries

While there, fix an annoying bug where the context manager
was suppressing exceptions that occurred.

Work part of https://github.com/ooni/probe/issues/1466.
2021-05-05 14:26:19 +02:00
Simone Basso
eb43c7994a
feat(make): build ooniprobe for darwin, windows, and linux (#328)
In https://github.com/ooni/probe/issues/1466, a user is asking
about arm64 builds for Debian. We already had some code for that
in https://github.com/ooni/probe-cli/pull/311. Let us adapt the
code to the `./make` script to have arm64 builds.

While there, also adapt the code for darwin and windows.
2021-05-05 12:12:34 +02:00
Simone Basso
764293795e
feat(make): build miniooni (#322)
This change is useful to move forward with blessing a new
release (https://github.com/ooni/probe/issues/1439).
2021-04-29 19:24:25 +02:00
Simone Basso
90d15c1c09
refactor: build miniooni from toplevel (#203)
* refactor: build miniooni from toplevel

Of course, also move the specific test checking whether we are
still able of building miniooni.

Part of https://github.com/ooni/probe/issues/1335

* build for current branch just to confirm

* fix: correct the path where linux/arm binary is

* okay, it works, we can remove the special rule
2021-02-02 15:34:03 +01:00
Simone Basso
4b557a0899
build.sh: build windows/386 and linux/386, update Debian packaging (#193)
* feat(build.sh): build for windows/386

Part of https://github.com/ooni/probe/issues/1315

* fix(build.sh): docker pull so we have latest image

Part of https://github.com/ooni/probe/issues/1315

* fix(build.sh): apk update && apk upgrade to have latest packages

It does not currently seem necessary. But let's be defensive.

Part of https://github.com/ooni/probe/issues/1315.

* fix(windows.yml): for now disable windows/386

It's working locally but not remotely on Windows. We need to
figure out how to install the 386 compiler.

Part of https://github.com/ooni/probe/issues/1315.

* feat(build.sh): build for windows/386

Part of https://github.com/ooni/probe/issues/1315.

* fix(linux.yml): try to enable experimental docker flags

Related to https://github.com/ooni/probe/issues/1315.

See also https://github.com/actions/virtual-environments/issues/368#issuecomment-713588127.

* fix(debian): try to have single workflow with experimental docker

More commits probably needed.

Part of https://github.com/ooni/ooni.org/issues/677.

* remove restriction on the branch name

* maybe we need a pattern also for branches

* less stringent constraints

* consolidated debian workflow into a single workflow

* further fix the debian workflow

* only run debian action for specific branches or tags

* fix(build.sh): package the 386 windows version properly
2021-01-20 13:09:37 +01:00
Simone Basso
770a822fd4 fix(build.sh): name macOS files after the darwin platform
This was what we used to do in the past. Spotted by @sarathms.
2020-08-24 19:24:46 +02:00
Simone Basso
4c65147009
WIP: Start preparing release v3.0.7 (#147)
* Use ooni/probe-engine 0.16.0
* Update all the other dependencies
* Use GitHub Actions rather than Travis CI
* Automatically build and test binaries on the target OS (for Windows, macOS, Linux on amd64)
* Make sure we correctly measure coverage
* Make sure we use `-race` when running tests
* Remove unnecessary scripts
* Make sure the README is up-to-date
* Write small script to update binary data and add GitHub Actions checks for it
* Notice that we needed to run ./updatebindata.sh and run it
* Self documenting instructions regarding cross compiling
* Set version number to v3.0.7-beta

Part of https://github.com/ooni/probe-engine/issues/748
2020-08-22 11:20:50 +02:00