object-introspection/oi/type_graph
Jake Hillion fe9b4b232a 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-16 12:29:31 +01:00
..
AddChildren.cpp Update to clang/llvm 15 (#342) 2023-09-14 06:02:32 -07:00
AddChildren.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
AddPadding.cpp clang-format: disable bin packing 2023-11-13 18:19:53 +00:00
AddPadding.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
AlignmentCalc.cpp Correct packing calculation (#485) 2024-02-15 10:56:01 -08:00
AlignmentCalc.h TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
ClangTypeParser.cpp ignore virtual base classes (#497) 2024-06-05 15:32:32 +01:00
ClangTypeParser.h Support type::Attributed in Clang Parser (#496) 2024-04-23 18:11:58 +01:00
ClangTypeParserTest.cpp tests: add ClangTypeParserTest 2024-02-23 16:51:51 +00:00
CMakeLists.txt nix: add building oid to the flake 2024-08-16 12:29:31 +01:00
DrgnExporter.cpp incomplete: name type in compiler errors 2024-01-09 15:08:25 +00:00
DrgnExporter.h oilgen: migrate to source parsing (#421) 2023-12-19 13:26:25 -08:00
DrgnParser.cpp tbv2: support capture-thrift-isset 2024-01-16 19:09:46 +00:00
DrgnParser.h TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
EnforceCompatibility.cpp CodeGen v2: Enable independent running without CodeGen v1 2023-12-15 14:57:24 +00:00
EnforceCompatibility.h move all internal logic to oi::detail namespace 2023-07-26 18:01:38 +01:00
Flattener.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
Flattener.h TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
IdentifyContainers.cpp container_info: switch to boost::regex (#465) 2024-01-23 10:58:58 -08:00
IdentifyContainers.h TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
KeyCapture.cpp Make KeyCapture work with nested typedefs (#473) 2024-01-31 17:03:05 +00:00
KeyCapture.h TypeGraph: Add KeyCapture pass 2023-09-28 19:42:49 -07:00
NameGen.cpp incomplete: name type in compiler errors 2024-01-09 15:08:25 +00:00
NameGen.h incomplete: name type in compiler errors 2024-01-09 15:08:25 +00:00
NodeTracker.h Type Graph: Replace MutationTracker with the more general ResultTracker 2023-12-14 13:43:19 +00:00
PassManager.cpp TypeGraph: Remove NodeTracker from the TypeGraph class 2023-08-24 15:01:45 +01:00
PassManager.h TypeGraph: Remove NodeTracker from the TypeGraph class 2023-08-24 15:01:45 +01:00
Printer.cpp Make KeyCapture work with nested typedefs (#473) 2024-01-31 17:03:05 +00:00
Printer.h oilgen: migrate to source parsing (#421) 2023-12-19 13:26:25 -08:00
Prune.cpp TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
Prune.h TypeGraph: Fix handling for classes which inherit from containers 2023-12-14 18:02:45 +00:00
RemoveMembers.cpp ignore fully qualified types 2024-02-08 05:45:07 -08:00
RemoveMembers.h ignore fully qualified types 2024-02-08 05:45:07 -08:00
RemoveTopLevelPointer.cpp oilgen: migrate to source parsing (#421) 2023-12-19 13:26:25 -08:00
RemoveTopLevelPointer.h oilgen: migrate to source parsing (#421) 2023-12-19 13:26:25 -08:00
TopoSorter.cpp Make KeyCapture work with nested typedefs (#473) 2024-01-31 17:03:05 +00:00
TopoSorter.h tbv2: fix pointer codegen 2024-01-18 16:22:18 +00:00
TypeGraph.cpp Remove Primitive::Kind::Incomplete 2023-10-04 11:23:28 -06:00
TypeGraph.h TypeGraph: Remove NodeTracker from the TypeGraph class 2023-08-24 15:01:45 +01:00
TypeIdentifier.cpp container_info: switch to boost::regex (#465) 2024-01-23 10:58:58 -08:00
TypeIdentifier.h name contained types properly in treebuilder v2 2023-08-25 16:25:14 +01:00
Types.cpp incomplete: name type in compiler errors 2024-01-09 15:08:25 +00:00
Types.h Make KeyCapture work with nested typedefs (#473) 2024-01-31 17:03:05 +00:00
Visitor.h Make KeyCapture work with nested typedefs (#473) 2024-01-31 17:03:05 +00:00