Commit Graph

36 Commits

Author SHA1 Message Date
Jake Hillion
6c90103278 circleci: clean up codegen v1 runs
Remove the CodeGen v1 sections of the CI config because both OID and OIL use
CodeGen v2.

We were missing running any test that wasn't `Oi{d,l}Integration.*` before.
This now runs the unit tests again and requires a minor fix to one unit test.

Test plan:
- CI
2024-01-03 17:29:59 +00:00
Alastair Robertson
c874f72ae2 OID: Make CodeGen v2 (TypeGraph) the default 2023-12-14 17:42:03 +00:00
952d3e75c8 ci: move formatting checks to nix 2023-12-14 15:31:07 +00:00
Jake Hillion
3871d92abb collapse TreeBuilderV2 features
Summary:

Currently there are two features between CodeGen v2 (TypeGraph) and TreeBuilder
v2. These are TypedDataSegment and TreeBuilderTypeChecking. Each of these
features currently has a full set of tests run in the CI and each have specific
exclusions.

Collapse these features into TreeBuilder v2. This allows for significantly
simplified testing as any OIL tests run under TreeBuilder v2 and any OID tests
run under TreeBuilder v1.

The reasoning behind this is I no longer intend to partially roll out this
feature. Full TreeBuilder v2 applies different conditions to containers than
the intermediate states, and writing these only to have them never deployed is
a waste of time.

Test Plan:
- it builds
- CI
2023-11-13 19:43:03 +00:00
Alastair Robertson
d01c32c657 CI: Skip some OIL capture keys tests on Clang 2023-09-28 19:42:49 -07:00
Jake Hillion
8bad704d9c Implement Container V2 for fbstring 2023-09-27 18:16:36 -07:00
Jake Hillion
a6d74a20a6 Update to clang/llvm 15 (#342)
Summary:

Update to clang-15 compiler and libraries as clang-12 is ancient.

The changes to oilgen are necessary because the new internal toolchain is being more picky about linking PIC to PIC. In certain modes we build with PIC, but try to link a non-PIC oilgen artifact. Add the ability to build the oilgen artifacts with PIC which sorts this.

Reviewed By: ttreyer

Differential Revision: D46220858
2023-09-14 06:02:32 -07:00
Alastair Robertson
79d1d55b03 CI: Set installs to noninteractive so they don't hang waiting for user input 2023-08-01 17:30:38 +01:00
Alastair Robertson
6fbb60826f
EnforceCompatibility: Stub out void pointers
CodeGen v1 does not record anything for pointers to incomplete types.
Not even the address, as is done for other pointers.

Introduce a new Primitive type "Incomplete". This behaves identically to
"Void", but allows us to tell whether a type was defined as void or if
it ended up like that because of incomplete DWARF information.
2023-07-31 14:28:05 +01:00
Alastair Robertson
884b9a6e95 CodeGen: Don't measure the sizes of union members
In general, we can't tell which member is active in a union so it is not
safe to try and measure any of them.

Explicitly set the alignment of unions (and structs/classes) in CodeGen
if it is available, as the C++ compiler can no longer infer it from the
members.
2023-07-26 11:16:30 +01:00
Alastair Robertson
c3fec2624b Integration tests: Add tests for unrestricted unions
i.e. unions with non-POD members

We can't examine untagged unions, but we should be able to support
looking inside tagged unions at some point in the future.
2023-07-14 15:48:01 +01:00
Jake Hillion
270da07e72 ci: enable tree-builder-type-checking tests 2023-07-13 16:05:24 +01:00
Alastair Robertson
3e8464e691 RemoveIgnored: Set names for removed members to AddPadding::MemberPrefix
This means they will be treated as padding, so CodeGen will not try to
store any data for them.
2023-07-12 14:40:10 +01:00
Jake Hillion
17633983b5 create strict mode and enable it for tests 2023-07-07 16:09:46 +01:00
Jake Hillion
608880e156 typed data segment: fix vector handler for custom allocators 2023-07-05 19:06:18 +01:00
Jake Hillion
099be82459 thrift isset: add type handler 2023-07-05 17:52:42 +01:00
Jake Hillion
8e48c6ca52 ci: enable testing for typed data segment 2023-06-29 17:31:29 +01:00
Jake Hillion
ceafce8e1a ci: retry tests once on failure 2023-06-28 16:37:11 +01:00
Alastair Robertson
26fd44c26c CI: Fix code coverage collection
Multiple jobs are not allowed to persist the same files to a workspace.

This commit takes the lazy approach of splitting the type-graph and
non-type-graph jobs into different workspaces and creating a second
coverage job to avoid the conflict.
2023-06-28 16:11:50 +01:00
Alastair Robertson
04715e2015 TypeGraph: Create dummy containers
These represent types which don't store any interesting data for us to
measure, but which are required by a real container so can not be
replaced with our own generated class types.

std::allocator often has bad DWARF, so it must be replaced after the
DWARF is fixed up in Flattener. The others could be replaced earlier in
the transformation process if desired, but I've left them all together
for simplicity for now.

This fixes the folly::fbstring tests.
2023-06-28 16:11:50 +01:00
Alastair Robertson
4dc9007166 Integration tests: Set up CI testing for TypeGraph
CTest can't forward command line arguments to the test runner, so add
the option to using an environment variable to enable features instead.

CMake issue tracking the feature that would have been needed:
  https://gitlab.kitware.com/cmake/cmake/-/issues/20470

Tests which aren't passing yet have been disabled in CI.
2023-06-27 16:40:54 +01:00
Alastair Robertson
3120e8173c Code Coverage: Reduce irrelevant partial branch matches
The C++ compiler generates implicit branches for exception handling,
which is particularly common when calling standard library functions.

It's not generally useful to have tests for the case when
std::vector::push_back fails due to an out-of-memory condition, so in
this PR we use a feature in the latest lcov release to filter out these
compiler-generated branches.

Our code coverage numbers consequently go way up!
2023-06-23 13:03:36 +01:00
Alastair Robertson
6019a37dde CodeCov: Collect coverage from all source files
The "src" directory got renamed to "oi" and the previous rule stopped
matching our source code. By changing to collect coverage for everything
except for "build" and "extern", we should avoid this problem in the
future.
2023-05-24 16:52:16 +01:00
Alastair Robertson
5c691f27f7 Enable -Werror for Clang builds in CI
Don't enable for local dev builds or for GCC CI builds, as every
compiler version has a different set of warnings and trying to make them
all pass is a neverending task.
2023-05-23 10:36:42 +01:00
Alastair Robertson
5971643101 Pass in CodeCov.io token through CI env var
CodeCov's docs say that a token isn't required for a public repository,
but our uploads have been broken for a few weeks at this point and
passing in the token fixes them...
2023-04-21 14:42:15 +01:00
Jake Hillion
f47628ae2d add test for folly::fbstring 2023-04-06 15:11:09 +01:00
Alastair Robertson
daa3cb06ec Build with tests by default 2023-04-05 15:53:15 +01:00
Jon Haslam
ac7a1d4aba
reduce race window for breakpoint trap in prologue (#85) 2023-03-04 08:06:19 +00:00
Jake Hillion
b1c43c2b42 update folly and enable ci usage 2023-02-24 10:31:59 -08:00
Jake Hillion
31f4382178 ci: bump repeat-until-pass to 4 2023-02-08 17:13:58 +00:00
Alastair Robertson
13bbe2e1bb Code coverage: Checkout repo before running
Apparently this is needed for CodeCov.io to work.
2023-02-03 16:52:36 +00:00
Alastair Robertson
397b798235 CI: Add code coverage reporting
Add CODE_COVERAGE option to enable coverage instrumentation in builds.

Add new CI job to upload coverage reports to CodeCov.io.

Reports can be found by navigating the codecov.io UI, or by going to
the URL printed at the end of the "Code Coverage" CI job. More CodeCov
integration could be set up later once we have coverage reporting on the
main branch.
2023-02-03 12:16:56 +00:00
Alastair Robertson
3468db7b0a CI: Parallelise tests
This reduces the time to run tests from 5-9 minutes down to 3-4 minutes.

`nproc` is returning `1` on the CI node which is processing our
config.yml. In the absense of a better way of getting the number of CPUs
on our executor, just hardcode it.

We actually have 16 cores on our 2xlarge executors, but higher
parallelism in tests appears to cause oid to sometimes fail with SIGILL.
I'm still investigating this problem.
2023-02-02 15:02:39 +00:00
Alastair Robertson
b00958378b CI: Split build and test into separate jobs
This will give us more flexibility later, e.g. allowing different steps
for GCC and Clang (as needed for code coverage), or letting us
parallelise our tests across multiple machines.
2023-02-02 14:21:41 +00:00
Alastair Robertson
6f786b4348 CI: Output junit result format directly from CTest
Remove the conversion script we were previously using.
2023-02-02 11:00:58 +00:00
Jon Haslam
db90326c4b Initial commit 2022-12-19 06:37:51 -08:00