Commit Graph

34 Commits

Author SHA1 Message Date
Omar Sandoval
3bd0c37177 CI: combine Main Branch Push CI back into CI workflow
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>
2023-08-18 10:18:04 -07:00
Stephen Brennan
e9141fa396 ci: reduce usage and add Python 3.12 beta
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>
2023-06-15 17:31:57 -07:00
Omar Sandoval
860a9555e9 CI: actually install pahole
The package is called dwarves.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2023-02-18 01:48:52 -08:00
Omar Sandoval
768a070461 CI: install pahole
This is required for building the test kernel module.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2023-02-18 01:47:52 -08:00
Omar Sandoval
4697b4ce0e CI: build vmtest kernels for all architectures
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>
2023-02-16 17:58:14 -08:00
Omar Sandoval
4f437b395d vmtest.manage: support building other architectures
Note that this will now always use the kernel.org compilers even for the
host architecture.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2023-02-16 02:23:04 -08:00
Omar Sandoval
9ee9877727 CI: cancel previous runs when PR is force-pushed
This way, older versions don't block the queue for newer versions and
contributors get faster feedback on their latest version.

Based on
https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2023-01-27 11:29:02 -08:00
Omar Sandoval
9dbf5d03fa CI: update GitHub action versions to silence Node.js warnings
Runs have been getting warnings like the following:

  Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-python@v2

The guilty actions all have new versions that use Node.js 16.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2023-01-05 10:41:30 -08:00
Omar Sandoval
58e7d751e7 vmtest: add content write permissions to vmtest build job
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>
2022-12-29 00:17:46 -08:00
Omar Sandoval
9ced57a6e1 CI: set GITHUB_TOKEN environment variable
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>
2022-12-20 21:45:44 -08:00
Omar Sandoval
344facf0b7 vmtest: build with Ubuntu 20.04
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>
2022-11-21 11:59:28 -08:00
Omar Sandoval
eac49edf79 CI: pin to Ubuntu 20.04
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>
2022-11-21 11:21:22 -08:00
Omar Sandoval
818da5b890 CI: add Python 3.11
Python 3.11 was released in October. No changes to drgn are required.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-11-21 01:15:00 -08:00
Omar Sandoval
b535b8f82e vmtest: don't use BusyBox
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>
2022-08-01 11:23:26 -07:00
Omar Sandoval
ca6c2b8734 vmtest: kbuild: add BPF kernel config options
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>
2022-07-19 23:47:32 -07:00
Omar Sandoval
24609a3a2e libdrgn: add autoconf option to enable compiler warnings
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>
2022-03-01 15:38:05 -08:00
Stephen Brennan
fb99f6dbe6 ci: Use pre-commit to run linters
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>
2022-01-14 13:31:16 -08:00
Stephen Brennan
f1cc88378a Silence mypy warnings
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>
2021-12-16 14:46:27 -08:00
Omar Sandoval
6fb304e99a Skip DCO check for draft pull requests
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>
2021-12-13 12:14:42 -08:00
Omar Sandoval
d36b12c682 CI: add Python 3.10
Python 3.10 was released in October. No changes to drgn are required.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-11-03 17:38:31 -07:00
Omar Sandoval
b4a82c30ab Add GitHub action to check for DCO sign-off on pull requests
Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-09-28 12:32:15 -07:00
Omar Sandoval
3c68b25215 CI: install pyroute2
This is needed to test #117.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-09-01 15:11:25 -07:00
Omar Sandoval
dd0885bacd CI: install correct version of libomp
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>
2021-06-01 17:52:00 -07:00
Omar Sandoval
fcb46d5ab8 Revert "CI: temporarily disable Clang"
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>
2021-05-06 16:56:42 -07:00
Omar Sandoval
1cc3868955 CI: temporarily disable Clang
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>
2021-05-06 01:43:46 -07:00
Omar Sandoval
a1dc80bc38 CI: reenable vmtest
Now that the vmtest kernels have a new home on GitHub, reenable vmtest
for the CI workflow.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-05-05 01:15:40 -07:00
Omar Sandoval
47c8e0e53e vmtest: fix vmtest kernel build command
Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-05-05 00:34:11 -07:00
Omar Sandoval
ebca2d2f8a CI: add action to build vmtest kernels weekly
The previous commit mentioned this action but forgot to add it.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-05-05 00:30:34 -07:00
Omar Sandoval
738261290f CI: temporarily disable vmtest
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>
2021-04-04 23:06:19 -07:00
Omar Sandoval
c7dc814978 CI: build with -Wall -Werror
This is the documented way that drgn should be built for development, so
let's enforce it.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-04-02 17:28:09 -07:00
Omar Sandoval
113b2700a8 CI: test with GCC and Clang
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>
2021-04-02 17:28:05 -07:00
Omar Sandoval
4c5c5f3842 Remove bundled version of elfutils
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>
2021-03-16 00:52:09 -07:00
Omar Sandoval
85a5605e37 CI: run apt-get update before apt-get install
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>
2021-01-08 11:22:42 -08:00
Omar Sandoval
1631c11f37 Migrate to GitHub Actions
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>
2021-01-01 02:59:50 -08:00