2022-12-19 14:37:51 +00:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
workflows:
|
2023-02-01 18:03:42 +00:00
|
|
|
object-introspection:
|
2022-12-19 14:37:51 +00:00
|
|
|
jobs:
|
2023-02-01 18:03:42 +00:00
|
|
|
- build:
|
|
|
|
name: build-gcc
|
2022-12-19 14:37:51 +00:00
|
|
|
cc: /usr/bin/gcc
|
|
|
|
cxx: /usr/bin/g++
|
2023-05-22 11:02:47 +01:00
|
|
|
warnings_as_errors: "OFF"
|
2023-06-26 16:34:52 +01:00
|
|
|
- test:
|
2023-12-14 16:39:16 +00:00
|
|
|
name: test-gcc
|
2023-06-26 16:34:52 +01:00
|
|
|
requires:
|
|
|
|
- build-gcc
|
2024-02-23 16:26:03 +00:00
|
|
|
exclude_regex: ".*inheritance_polymorphic.*|.*arrays_member_int0|ClangTypeParserTest.*"
|
2023-02-03 09:47:57 +00:00
|
|
|
- coverage:
|
2023-06-28 09:37:24 +01:00
|
|
|
name: coverage
|
2023-02-03 09:47:57 +00:00
|
|
|
requires:
|
|
|
|
- test-gcc
|
2023-02-01 18:03:42 +00:00
|
|
|
|
|
|
|
- build:
|
|
|
|
name: build-clang
|
2022-12-19 14:37:51 +00:00
|
|
|
cc: /usr/bin/clang-12
|
|
|
|
cxx: /usr/bin/clang++-12
|
2023-05-22 11:02:47 +01:00
|
|
|
warnings_as_errors: "ON"
|
2023-06-26 16:34:52 +01:00
|
|
|
- test:
|
2023-12-14 16:39:16 +00:00
|
|
|
name: test-clang
|
2023-06-26 16:34:52 +01:00
|
|
|
requires:
|
|
|
|
- build-clang
|
2023-06-26 19:00:51 +01:00
|
|
|
# Tests disabled due to bad DWARF generated by the old clang compiler in CI
|
2024-02-07 15:41:52 +00:00
|
|
|
exclude_regex: ".*inheritance_polymorphic.*|.*arrays_member_int0|.*fbstring.*|.*std_string_*|.*multi_arg_tb_.*|.*ignored_member|OilIntegration.fbstring_.*|OilIntegration.capture_keys_string|OilIntegration.capture_keys_multi_level"
|
2022-12-19 14:37:51 +00:00
|
|
|
|
2023-02-01 18:03:42 +00:00
|
|
|
executors:
|
|
|
|
ubuntu-docker:
|
2022-12-19 14:37:51 +00:00
|
|
|
docker:
|
|
|
|
- image: ubuntu:jammy
|
2023-02-01 18:03:42 +00:00
|
|
|
resource_class: small
|
|
|
|
big-boy:
|
|
|
|
machine:
|
|
|
|
image: ubuntu-2204:2022.10.2
|
|
|
|
resource_class: 2xlarge
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
# TODO this job could be run in Docker
|
|
|
|
executor: big-boy
|
2022-12-19 14:37:51 +00:00
|
|
|
parameters:
|
|
|
|
cc:
|
|
|
|
type: string
|
|
|
|
cxx:
|
|
|
|
type: string
|
2023-05-22 11:02:47 +01:00
|
|
|
warnings_as_errors:
|
|
|
|
type: string
|
2022-12-19 14:37:51 +00:00
|
|
|
environment:
|
|
|
|
CC: << parameters.cc >>
|
|
|
|
CXX: << parameters.cxx >>
|
2023-02-03 09:47:57 +00:00
|
|
|
working_directory:
|
|
|
|
/tmp/object-introspection
|
2022-12-19 14:37:51 +00:00
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Install dependencies
|
|
|
|
command: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y \
|
|
|
|
bison \
|
|
|
|
build-essential \
|
|
|
|
clang-12 \
|
2023-09-14 11:40:11 +01:00
|
|
|
clang-15 \
|
2022-12-19 14:37:51 +00:00
|
|
|
cmake \
|
|
|
|
flex \
|
|
|
|
gawk \
|
|
|
|
libboost-all-dev \
|
|
|
|
libbz2-dev \
|
|
|
|
libcap2-bin \
|
2023-09-14 11:40:11 +01:00
|
|
|
libclang-15-dev \
|
2022-12-19 14:37:51 +00:00
|
|
|
libcurl4-gnutls-dev \
|
|
|
|
libdouble-conversion-dev \
|
|
|
|
libdw-dev \
|
|
|
|
libfmt-dev \
|
|
|
|
libgflags-dev \
|
|
|
|
libgmock-dev \
|
|
|
|
libgoogle-glog-dev \
|
|
|
|
libgtest-dev \
|
|
|
|
libjemalloc-dev \
|
|
|
|
libmsgpack-dev \
|
nix: add building oid to the flake
OI's build is challenging and has often been a problem for the Open Source
community. It requires an extremely specific set of dependencies that are very
hard to achieve on most systems. There are frequent breakages, like when
updating to CentOS Stream 9, or when trying to update the CI's clang from
clang-12 to clang-15 - OI requires the clang libraries to be version 15 but
can't be compiled with it on the CI!
This changes provides a mostly working build environment with `nix`. This
environment is pinned to a specific nixpkgs revision using `flake.lock`, and
only updates when we explicitly tell it to.
Summary of changes:
- Update CMakeLists.txt required version to 3.24. This allows specifying
`FIND_PACKAGE_ARGS` in `FetchContent`, meaning we can use system packages.
This is available on most up to date distros (3.30.2 is current).
- Extends `flake.nix` to be able to build OI. Adds instructions for building
and developing OI using `nix`.
- Partially runs the tests in GitHub Actions. A huge amount must be excluded
because of incompatibilites between the clangStdenv compiler and drgn. We
have similar, though fewer, issues when building with the clang-12/libstdcxx
mix on the Ubuntu 22.04 CircleCI, though this is at least reproducible.
- Updates CircleCI to build CMake from source as we don't have a newer image
available. Also add some newly found dependencies (not sure how it was
working without them before).
Test plan:
This change requires less testing than previous build related changes because
it deprecates most of the build types.
- The internal BUCK build is unaffected. No special testing.
- The semi-internal CMake build is gone. Use Nix.
- The Nix build for clang-15 and some tests are continuously tested in GitHub
actions.
- Tested the set of Nix commands in the README. All work except the one that
points to GitHub as this must be merged first.
- The existing CircleCI runs on Ubuntu 20.04 are maintained.
- Unable to test the new `test-report.yml` as it must be merged due to the
permissions it needs. Will follow up with testing after this is merged. See:
https://github.com/dorny/test-reporter?tab=readme-ov-file#recommended-setup-for-public-repositories
The list of exclusions for GitHub Actions/nix testing is currently very long, I
think 29% of the tests. This should be stable and reproducible though, and
likely needs deep changes to OI to fix. That's why fixes are excluded from this
PR. It's all to do with the forked drgn not being able to parse clang's newer
DWARF output, and can't be fixed by rolling back as we required a relatively
new libcxx.
2024-08-15 15:48:08 +01:00
|
|
|
libomp-12-dev \
|
|
|
|
liburing-dev \
|
2022-12-19 14:37:51 +00:00
|
|
|
libzstd-dev \
|
2023-09-14 11:40:11 +01:00
|
|
|
llvm-15-dev \
|
2022-12-19 14:37:51 +00:00
|
|
|
ninja-build \
|
|
|
|
pkg-config \
|
2023-02-01 18:06:31 +00:00
|
|
|
python3-setuptools
|
2022-12-19 14:37:51 +00:00
|
|
|
pip3 install toml
|
nix: add building oid to the flake
OI's build is challenging and has often been a problem for the Open Source
community. It requires an extremely specific set of dependencies that are very
hard to achieve on most systems. There are frequent breakages, like when
updating to CentOS Stream 9, or when trying to update the CI's clang from
clang-12 to clang-15 - OI requires the clang libraries to be version 15 but
can't be compiled with it on the CI!
This changes provides a mostly working build environment with `nix`. This
environment is pinned to a specific nixpkgs revision using `flake.lock`, and
only updates when we explicitly tell it to.
Summary of changes:
- Update CMakeLists.txt required version to 3.24. This allows specifying
`FIND_PACKAGE_ARGS` in `FetchContent`, meaning we can use system packages.
This is available on most up to date distros (3.30.2 is current).
- Extends `flake.nix` to be able to build OI. Adds instructions for building
and developing OI using `nix`.
- Partially runs the tests in GitHub Actions. A huge amount must be excluded
because of incompatibilites between the clangStdenv compiler and drgn. We
have similar, though fewer, issues when building with the clang-12/libstdcxx
mix on the Ubuntu 22.04 CircleCI, though this is at least reproducible.
- Updates CircleCI to build CMake from source as we don't have a newer image
available. Also add some newly found dependencies (not sure how it was
working without them before).
Test plan:
This change requires less testing than previous build related changes because
it deprecates most of the build types.
- The internal BUCK build is unaffected. No special testing.
- The semi-internal CMake build is gone. Use Nix.
- The Nix build for clang-15 and some tests are continuously tested in GitHub
actions.
- Tested the set of Nix commands in the README. All work except the one that
points to GitHub as this must be merged first.
- The existing CircleCI runs on Ubuntu 20.04 are maintained.
- Unable to test the new `test-report.yml` as it must be merged due to the
permissions it needs. Will follow up with testing after this is merged. See:
https://github.com/dorny/test-reporter?tab=readme-ov-file#recommended-setup-for-public-repositories
The list of exclusions for GitHub Actions/nix testing is currently very long, I
think 29% of the tests. This should be stable and reproducible though, and
likely needs deep changes to OI to fix. That's why fixes are excluded from this
PR. It's all to do with the forked drgn not being able to parse clang's newer
DWARF output, and can't be fixed by rolling back as we required a relatively
new libcxx.
2024-08-15 15:48:08 +01:00
|
|
|
|
|
|
|
# Ubuntu 22.04 CMake is too old and we don't have a newer image yet
|
|
|
|
git clone --depth 1 --branch v3.30.2 https://github.com/Kitware/CMake.git /tmp/cmake
|
|
|
|
(cd /tmp/cmake && cmake -B build/ -G Ninja && cmake --build build/)
|
2022-12-19 14:37:51 +00:00
|
|
|
environment:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
2023-02-01 18:03:42 +00:00
|
|
|
- checkout
|
2022-12-19 14:37:51 +00:00
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: |
|
nix: add building oid to the flake
OI's build is challenging and has often been a problem for the Open Source
community. It requires an extremely specific set of dependencies that are very
hard to achieve on most systems. There are frequent breakages, like when
updating to CentOS Stream 9, or when trying to update the CI's clang from
clang-12 to clang-15 - OI requires the clang libraries to be version 15 but
can't be compiled with it on the CI!
This changes provides a mostly working build environment with `nix`. This
environment is pinned to a specific nixpkgs revision using `flake.lock`, and
only updates when we explicitly tell it to.
Summary of changes:
- Update CMakeLists.txt required version to 3.24. This allows specifying
`FIND_PACKAGE_ARGS` in `FetchContent`, meaning we can use system packages.
This is available on most up to date distros (3.30.2 is current).
- Extends `flake.nix` to be able to build OI. Adds instructions for building
and developing OI using `nix`.
- Partially runs the tests in GitHub Actions. A huge amount must be excluded
because of incompatibilites between the clangStdenv compiler and drgn. We
have similar, though fewer, issues when building with the clang-12/libstdcxx
mix on the Ubuntu 22.04 CircleCI, though this is at least reproducible.
- Updates CircleCI to build CMake from source as we don't have a newer image
available. Also add some newly found dependencies (not sure how it was
working without them before).
Test plan:
This change requires less testing than previous build related changes because
it deprecates most of the build types.
- The internal BUCK build is unaffected. No special testing.
- The semi-internal CMake build is gone. Use Nix.
- The Nix build for clang-15 and some tests are continuously tested in GitHub
actions.
- Tested the set of Nix commands in the README. All work except the one that
points to GitHub as this must be merged first.
- The existing CircleCI runs on Ubuntu 20.04 are maintained.
- Unable to test the new `test-report.yml` as it must be merged due to the
permissions it needs. Will follow up with testing after this is merged. See:
https://github.com/dorny/test-reporter?tab=readme-ov-file#recommended-setup-for-public-repositories
The list of exclusions for GitHub Actions/nix testing is currently very long, I
think 29% of the tests. This should be stable and reproducible though, and
likely needs deep changes to OI to fix. That's why fixes are excluded from this
PR. It's all to do with the forked drgn not being able to parse clang's newer
DWARF output, and can't be fixed by rolling back as we required a relatively
new libcxx.
2024-08-15 15:48:08 +01:00
|
|
|
/tmp/cmake/build/bin/cmake -G Ninja -B build/ -DWITH_FLAKY_TESTS=Off -DCODE_COVERAGE=On -DWARNINGS_AS_ERRORS=<< parameters.warnings_as_errors >>
|
|
|
|
ninja -C build/
|
2023-02-01 18:03:42 +00:00
|
|
|
# Testing rubbish:
|
|
|
|
cp test/ci.oid.toml build/testing.oid.toml
|
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- build/*
|
|
|
|
- extern/*
|
2024-02-23 16:26:03 +00:00
|
|
|
- include/*
|
2023-02-01 18:03:42 +00:00
|
|
|
- types/*
|
2022-12-19 14:37:51 +00:00
|
|
|
|
2023-02-01 18:03:42 +00:00
|
|
|
test:
|
|
|
|
executor: big-boy
|
2023-06-26 16:34:52 +01:00
|
|
|
parameters:
|
|
|
|
oid_test_args:
|
|
|
|
type: string
|
|
|
|
default: ""
|
|
|
|
tests_regex:
|
|
|
|
type: string
|
|
|
|
default: ".*"
|
|
|
|
exclude_regex:
|
|
|
|
type: string
|
|
|
|
default: ""
|
2023-02-03 09:47:57 +00:00
|
|
|
working_directory:
|
|
|
|
/tmp/object-introspection
|
2023-02-01 18:03:42 +00:00
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: Install dependencies
|
|
|
|
command: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y \
|
2023-09-14 11:40:11 +01:00
|
|
|
clang-15 \
|
2023-02-23 23:32:15 +00:00
|
|
|
libboost-all-dev \
|
2023-04-05 21:56:55 +01:00
|
|
|
libfmt-dev \
|
nix: add building oid to the flake
OI's build is challenging and has often been a problem for the Open Source
community. It requires an extremely specific set of dependencies that are very
hard to achieve on most systems. There are frequent breakages, like when
updating to CentOS Stream 9, or when trying to update the CI's clang from
clang-12 to clang-15 - OI requires the clang libraries to be version 15 but
can't be compiled with it on the CI!
This changes provides a mostly working build environment with `nix`. This
environment is pinned to a specific nixpkgs revision using `flake.lock`, and
only updates when we explicitly tell it to.
Summary of changes:
- Update CMakeLists.txt required version to 3.24. This allows specifying
`FIND_PACKAGE_ARGS` in `FetchContent`, meaning we can use system packages.
This is available on most up to date distros (3.30.2 is current).
- Extends `flake.nix` to be able to build OI. Adds instructions for building
and developing OI using `nix`.
- Partially runs the tests in GitHub Actions. A huge amount must be excluded
because of incompatibilites between the clangStdenv compiler and drgn. We
have similar, though fewer, issues when building with the clang-12/libstdcxx
mix on the Ubuntu 22.04 CircleCI, though this is at least reproducible.
- Updates CircleCI to build CMake from source as we don't have a newer image
available. Also add some newly found dependencies (not sure how it was
working without them before).
Test plan:
This change requires less testing than previous build related changes because
it deprecates most of the build types.
- The internal BUCK build is unaffected. No special testing.
- The semi-internal CMake build is gone. Use Nix.
- The Nix build for clang-15 and some tests are continuously tested in GitHub
actions.
- Tested the set of Nix commands in the README. All work except the one that
points to GitHub as this must be merged first.
- The existing CircleCI runs on Ubuntu 20.04 are maintained.
- Unable to test the new `test-report.yml` as it must be merged due to the
permissions it needs. Will follow up with testing after this is merged. See:
https://github.com/dorny/test-reporter?tab=readme-ov-file#recommended-setup-for-public-repositories
The list of exclusions for GitHub Actions/nix testing is currently very long, I
think 29% of the tests. This should be stable and reproducible though, and
likely needs deep changes to OI to fix. That's why fixes are excluded from this
PR. It's all to do with the forked drgn not being able to parse clang's newer
DWARF output, and can't be fixed by rolling back as we required a relatively
new libcxx.
2024-08-15 15:48:08 +01:00
|
|
|
libgflags-dev \
|
|
|
|
libgoogle-glog-dev \
|
|
|
|
libjemalloc-dev \
|
|
|
|
libomp-12-dev \
|
|
|
|
llvm-15-dev
|
2023-08-01 16:58:06 +01:00
|
|
|
environment:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
2022-12-19 14:37:51 +00:00
|
|
|
- run:
|
|
|
|
name: Test
|
|
|
|
environment:
|
|
|
|
# disable drgn multithreading as tests are already run in parallel
|
|
|
|
OMP_NUM_THREADS: 1
|
|
|
|
command: |
|
|
|
|
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
2023-06-26 16:34:52 +01:00
|
|
|
OID_TEST_ARGS='<< parameters.oid_test_args >>' ctest \
|
|
|
|
--test-dir build/test/ \
|
|
|
|
--test-action Test \
|
|
|
|
-j 16 \
|
|
|
|
--tests-regex '<< parameters.tests_regex >>' \
|
|
|
|
--exclude-regex '<< parameters.exclude_regex >>' \
|
|
|
|
--no-compress-output \
|
|
|
|
--output-on-failure \
|
|
|
|
--schedule-random \
|
|
|
|
--timeout 60 \
|
2023-06-28 16:08:07 +01:00
|
|
|
--repeat until-pass:2 \
|
2023-02-01 18:06:31 +00:00
|
|
|
--output-junit results.xml
|
2022-12-19 14:37:51 +00:00
|
|
|
- store_test_results:
|
2023-02-01 18:06:31 +00:00
|
|
|
path: build/test/results.xml
|
2023-02-03 09:47:57 +00:00
|
|
|
- persist_to_workspace:
|
|
|
|
# Save code coverage data
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- build/*
|
|
|
|
|
|
|
|
coverage:
|
|
|
|
executor: ubuntu-docker
|
|
|
|
working_directory:
|
|
|
|
/tmp/object-introspection
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Install dependencies
|
|
|
|
command: |
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y \
|
2023-06-21 21:03:48 +01:00
|
|
|
build-essential \
|
|
|
|
cpanminus \
|
2023-02-03 09:47:57 +00:00
|
|
|
curl \
|
|
|
|
git \
|
2023-06-21 21:03:48 +01:00
|
|
|
gpg
|
|
|
|
# Install lcov 2.0 - required for the "--filter branch" option.
|
|
|
|
# This improves C++ branch coverage by excluding compiler-generated
|
|
|
|
# branches, which primarily come from exception handling in
|
|
|
|
# standard library functions.
|
|
|
|
cpanm --notest Capture::Tiny DateTime
|
|
|
|
pushd /tmp
|
|
|
|
curl -sLO https://github.com/linux-test-project/lcov/releases/download/v2.0/lcov-2.0.tar.gz
|
|
|
|
tar -xf lcov-2.0.tar.gz
|
|
|
|
cd lcov-2.0
|
|
|
|
make install
|
|
|
|
popd
|
2023-08-01 16:58:06 +01:00
|
|
|
environment:
|
|
|
|
DEBIAN_FRONTEND: noninteractive
|
2023-02-03 16:26:22 +00:00
|
|
|
- checkout
|
2023-02-03 09:47:57 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: .
|
|
|
|
- run:
|
|
|
|
name: Code Coverage
|
|
|
|
when: always
|
|
|
|
command: |
|
2023-06-21 21:03:48 +01:00
|
|
|
lcov --capture --directory . --filter branch --no-external --ignore-errors mismatch --ignore-errors source --rc lcov_branch_coverage=1 --output-file coverage.info
|
2023-05-24 16:14:19 +01:00
|
|
|
# Empirically, extract-then-remove is faster than remove-then-extract
|
|
|
|
lcov --extract coverage.info '/tmp/object-introspection/*' --rc lcov_branch_coverage=1 --output-file coverage.info
|
|
|
|
lcov --remove coverage.info '/tmp/object-introspection/build/*' '/tmp/object-introspection/extern/*' --rc lcov_branch_coverage=1 --output-file coverage.info
|
2023-02-03 09:47:57 +00:00
|
|
|
lcov --list --rc lcov_branch_coverage=1 coverage.info
|
|
|
|
|
|
|
|
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
|
|
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov
|
|
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
|
|
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
|
|
|
|
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
|
|
|
|
shasum -a 256 -c codecov.SHA256SUM
|
|
|
|
chmod +x codecov
|
|
|
|
|
|
|
|
# It appears that codecov wants to scan through all directories
|
|
|
|
# other than "build", looking for files to upload, even if we
|
|
|
|
# specify a file name on the command line.
|
|
|
|
#
|
|
|
|
# "extern" is huge and makes uploading the coverage report take
|
|
|
|
# forever. Delete it for a speedup.
|
|
|
|
rm -rf extern
|
|
|
|
|
2023-04-21 13:50:29 +01:00
|
|
|
./codecov -Z -f coverage.info -t $CODECOV_TOKEN
|