The CI status badge is inaccurate since commit e9141fa396 ("ci: reduce
usage and add Python 3.12 beta") because the "real" CI on the main
branch got moved to a new workflow and the existing one became a
reusable workflow_call/workflow_dispatch. Combine the push workflow back
into the reusable workflow.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
With 3.12 beta, there are 7 Python versions to test, which is making the
test matrix too large. To reduce the amount of CI test runs that occur,
by default we will only run 2: the oldest and newest released Python
versions. To further reduce the CI test runs, we will eliminate CI runs
when a branch is pushed (only main will be tested).
The "ci" action becomes a reusable workflow, which gets called by other
possible workflows:
1. pull_request.yml: On pull request, only the 2 default Python versions
are tested. The "test-all-python-versions" label can be applied to
pull requests to override this.
2. push.yml: On push to main, all Python versions are tested.
3. vmtest-build.yml: After the vmtest kernels are built
4. On manual request: the user has the option to specify
Signed-off-by: Stephen Brennan <stephen@brennan.io>
In order to hopefully not have jobs time out, split it into jobs by
architecture and flavor, but limit the parallelism to leave room for
actual test runs. Some of the very old kernel versions don't work on the
other architectures, but we can look into that later.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
I changed the default workflow permissions to be restrictive, but I
forgot that the vmtest build needs to upload assets. Add write
permissions for the contents scope, which seems to cover asset uploads.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
This should fix the "HTTP Error 403: rate limit exceeded" errors we've
been seeing. (I don't know if GitHub Actions used to do this
automatically or they started being stricter about rate limits.)
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Building the test kernel module is failing in the CI with:
./tools/objtool/objtool: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./tools/objtool/objtool)
./tools/objtool/objtool: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./tools/objtool/objtool)
This is because we're building the kernel with Ubuntu 22.04 and building
the test kernel module on Ubuntu 20.04, and 22.04's glibc is newer than
20.04.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
ubuntu-latest was just bumped to Ubuntu 22.04, and actions/setup-python
doesn't package Python 3.6 for Ubuntu 22.04. I'd love to drop Python 3.6
support, but some enterprise distros (e.g., CentOS 8) are still on 3.6.
So, for now, let's stay on Ubuntu 20.04 so that we can keep testing
Python 3.6.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
We don't specifically need BusyBox; we just need a reasonable Linux
userspace, which we can assume is already available on the host, whether
it's coreutils+util-linux, BusyBox, or something else.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
We currently don't have any tests for the BPF helpers or the
bpf_inspect.py tool. As a result, the latter is broken on newer kernel
versions. Before we can add tests, we need the vmtest kernel to support
BPF.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
This adds an --enable-compiler-warnings flag that:
* Defines a canonical list of warnings that we enforce. For now, this is
-Wall -Wformat-overflow=2 -Wformat-truncation=2, but we can add to it
going forward.
* Enables warnings by default.
* Allows erroring on warnings. We recommend that developers use this and
use it for the CI.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Now that pre-commit is added, replace the manual commands for mypy,
isort, and black with equivalent pre-commit commands. This allows us to
avoid duplicating linter arguments. It also allows us to pin the linters
used in CI by way of the .pre-commit-config.yaml file, ensuring
reproducible lint errors.
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
With mypy 0.920, two warnings appear on current main:
$ mypy --strict --no-warn-return-any drgn _drgn.pyi
drgn/helpers/linux/__init__.py:36: error: Need type annotation for "__all__" (hint: "__all__: List[<type>] = ...")
drgn/helpers/linux/__init__.py:38: error: unused "type: ignore" comment
Found 2 errors in 1 file (checked 33 source files)
The "unused" type:ignore directive was necessary for prior versions, so
add --no-warn-unused-ignores, so that we pass on multiple versions.
Apply a List[str] annotation to the __all__ variable to silence the
other error.
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
Draft pull requests can have temporary commits, so it doesn't make much
sense to check for sign-offs. Skip the check on drafts, making sure it
runs when a draft is changed to a normal pull request.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
actions/virtual-environments@15a610677b
changed the default version of Clang from 10 to 11, but `apt-get install
libomp-dev` still installs libomp-10-dev. Ideally, the correct version
of libomp would already be pre-installed (see
actions/virtual-environments#3506), but for now make sure we install the
correct version.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
This reverts commit 1cc3868955. The
previous commit (hopefully) works around the libomp bugs that caused
Clang builds to fail.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Clang tests are hitting this assertion in libomp (libomp5-10
1:10.0.0-4ubuntu1):
Assertion failure at kmp_tasking.cpp(501): taskdata->td_flags.tasktype == 1.
OMP: Error #13: Assertion failure at kmp_tasking.cpp(501).
OMP: Hint Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see https://bugs.llvm.org/.
Disable Clang builds until we figure out what's going on.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
With the added Clang tests, apparently vmtest is generating excessive
traffic on Dropbox. Disable it on GitHub Actions until I can work out a
new solution.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Everytime I try to build drgn with Clang, there are a few things that
need fixing. Let's test it so that it stays in good shape.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
We currently bundle a version of elfutils with patches to export
additional stack tracing functionality. This has a few drawbacks:
- Most of drgn's build time is actually building elfutils.
- Distributions don't like packages that bundle verions of other
packages.
- elfutils, and thus drgn, can't be built with clang.
Now that we've replaced the elfutils DWARF unwinder with our own, we
don't need the patches, so we can drop the bundled elfutils and fix
these issues.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Apparently the package index can be out of date on the newly brought up
VM, leading to 404s, so make sure to update it first.
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Travis CI is no longer offering free open source CI, so migrate to
GitHub Actions. The only downside is that GitHub Actions doesn't support
nested virtualization, but we can work around that by falling back to
slow emulation.
Signed-off-by: Omar Sandoval <osandov@osandov.com>