-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
79dca16
commit c7682c4
Showing
12 changed files
with
640 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: nix fmt | ||
run: |- | ||
nix --experimental-features 'nix-command flakes' fmt | ||
git diff --exit-code | ||
build-test: | ||
runs-on: 16-core-ubuntu | ||
strategy: | ||
matrix: | ||
llvm_version: [15] | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: cachix/install-nix-action@v27 | ||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: build (LLVM ${{ matrix.llvm_version }}) | ||
# Run the build manually in `nix develop` to keep non-outputs around | ||
run: | | ||
nix develop .#oid-llvm${{ matrix.llvm_version }} --command cmake -B build -G Ninja -DWITH_FLAKY_TESTS=Off -DFORCE_BOOST_STATIC=Off | ||
nix develop .#oid-llvm${{ matrix.llvm_version }} --command ninja -C build | ||
- name: test (LLVM ${{ matrix.llvm_version }}) | ||
env: | ||
# disable drgn multithreading as tests are already run in parallel | ||
OMP_NUM_THREADS: 1 | ||
run: | | ||
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope | ||
nix develop .#oid-llvm${{ matrix.llvm_version }} --command ./tools/config_gen.py -c clang++ build/testing.oid.toml | ||
nix develop .#oid-llvm${{ matrix.llvm_version }} --command ctest \ | ||
--test-dir build/test/ \ | ||
--test-action Test \ | ||
--parallel \ | ||
--no-compress-output \ | ||
--schedule-random \ | ||
--timeout 60 \ | ||
--repeat until-pass:2 \ | ||
--exclude-from-file ../../.github/workflows/tests_failing_under_nix.txt \ | ||
--output-junit results.xml | ||
- name: upload results | ||
uses: actions/upload-artifact@v4 | ||
if: success() || failure() | ||
with: | ||
name: test-results-${{ matrix.llvm_version }} | ||
path: build/test/results.xml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'Test Report' | ||
on: | ||
workflow_run: | ||
workflows: ['CI'] | ||
types: | ||
- completed | ||
permissions: | ||
contents: read | ||
actions: read | ||
checks: write | ||
jobs: | ||
report: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dorny/test-reporter@v1 | ||
with: | ||
artifact: test-results-15 | ||
name: CTest Tests | ||
path: results.xml | ||
reporter: jest-junit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
AddChildrenTest.InheritancePolymorphic | ||
ClangTypeParserTest.MemberAlignment | ||
ClangTypeParserTest.SimpleStruct | ||
DrgnParserTest.ClassTemplateInt | ||
DrgnParserTest.Container | ||
DrgnParserTest.TemplateEnumValue | ||
DrgnParserTest.TemplateEnumValueGaps | ||
DrgnParserTest.TemplateEnumValueNegative | ||
OidIntegration.alignment_wrapper_member_alignment | ||
OidIntegration.alignment_wrapper_member_lower | ||
OidIntegration.alignment_wrapper_member_override | ||
OidIntegration.alignment_wrapper_struct | ||
OidIntegration.alignment_wrapper_two_members | ||
OidIntegration.alignment_wrapper_union_member | ||
OidIntegration.anonymous_anon_struct | ||
OidIntegration.anonymous_anon_typedef | ||
OidIntegration.anonymous_anon_union | ||
OidIntegration.anonymous_nested_anon_struct | ||
OidIntegration.anonymous_regular_struct | ||
OidIntegration.arrays_member_int0 | ||
OidIntegration.arrays_member_int10 | ||
OidIntegration.arrays_multidim | ||
OidIntegration.arrays_multidim_legacy | ||
OidIntegration.bitfields_enum | ||
OidIntegration.bitfields_mixed | ||
OidIntegration.bitfields_single | ||
OidIntegration.bitfields_straddle_bytes | ||
OidIntegration.bitfields_within_bytes | ||
OidIntegration.bitfields_zero_bits | ||
OidIntegration.cycles_raw_ptr | ||
OidIntegration.cycles_raw_ptr_wrapped | ||
OidIntegration.cycles_shared_ptr | ||
OidIntegration.cycles_unique_ptr | ||
OidIntegration.enums_params_scoped_enum_val | ||
OidIntegration.enums_params_scoped_enum_val_cast | ||
OidIntegration.enums_params_scoped_enum_val_gaps | ||
OidIntegration.enums_params_scoped_enum_val_negative | ||
OidIntegration.enums_params_unscoped_enum_val_cast | ||
OidIntegration.fbstring_empty | ||
OidIntegration.fbstring_heap_allocated | ||
OidIntegration.fbstring_inline | ||
OidIntegration.fbstring_string_pooled_unique | ||
OidIntegration.folly_f14_fast_map_a | ||
OidIntegration.folly_f14_fast_set_a | ||
OidIntegration.folly_f14_node_map_a | ||
OidIntegration.folly_f14_node_set_a | ||
OidIntegration.folly_f14_value_map_a | ||
OidIntegration.folly_f14_value_set_a | ||
OidIntegration.folly_f14_vector_map_a | ||
OidIntegration.folly_f14_vector_set_a | ||
OidIntegration.folly_small_vector_int_always_heap | ||
OidIntegration.folly_small_vector_int_default_empty | ||
OidIntegration.folly_small_vector_int_default_inlined | ||
OidIntegration.folly_small_vector_int_default_overflow | ||
OidIntegration.folly_small_vector_vector_3_empty | ||
OidIntegration.folly_small_vector_vector_3_inlined | ||
OidIntegration.folly_small_vector_vector_3_overflow | ||
OidIntegration.folly_sorted_vector_map_int_int_empty | ||
OidIntegration.folly_sorted_vector_map_int_int_reserve | ||
OidIntegration.folly_sorted_vector_map_int_int_some | ||
OidIntegration.ignored_member | ||
OidIntegration.ignored_roottype | ||
OidIntegration.ignored_subtype | ||
OidIntegration.inheritance_access_private | ||
OidIntegration.inheritance_access_protected | ||
OidIntegration.inheritance_access_public | ||
OidIntegration.inheritance_access_public_as_base | ||
OidIntegration.inheritance_multiple_a | ||
OidIntegration.inheritance_polymorphic_a_as_a | ||
OidIntegration.inheritance_polymorphic_b_as_a | ||
OidIntegration.inheritance_polymorphic_b_as_b | ||
OidIntegration.inheritance_polymorphic_c_as_a | ||
OidIntegration.inheritance_polymorphic_c_as_b | ||
OidIntegration.inheritance_polymorphic_c_as_c | ||
OidIntegration.inheritance_polymorphic_diamond_child_as_child | ||
OidIntegration.inheritance_polymorphic_diamond_child_as_middle1 | ||
OidIntegration.inheritance_polymorphic_diamond_child_as_middle1_root | ||
OidIntegration.inheritance_polymorphic_diamond_child_as_middle2 | ||
OidIntegration.inheritance_polymorphic_diamond_child_as_middle2_root | ||
OidIntegration.inheritance_polymorphic_diamond_middle1_as_middle1 | ||
OidIntegration.inheritance_polymorphic_diamond_middle1_as_root | ||
OidIntegration.inheritance_polymorphic_diamond_middle2_as_middle2 | ||
OidIntegration.inheritance_polymorphic_diamond_middle2_as_root | ||
OidIntegration.inheritance_polymorphic_diamond_root_as_root | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_a_as_a | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_a_no_polymorphic | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_b_as_a | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_b_as_b | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_b_no_polymorphic | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_c_as_a | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_c_as_b | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_c_as_c | ||
OidIntegration.inheritance_polymorphic_non_dynamic_base_c_no_polymorphic | ||
OidIntegration.multi_arg_tb_all_fail_crashes | ||
OidIntegration.multi_arg_tb_fail_first_arg | ||
OidIntegration.namespaces_queue | ||
OidIntegration.namespaces_stack | ||
OidIntegration.packed_a | ||
OidIntegration.padding_bool_padding | ||
OidIntegration.padding_nested_padding | ||
OidIntegration.pointers_feature_config | ||
OidIntegration.pointers_feature_flag_disabled | ||
OidIntegration.pointers_incomplete_containing_struct | ||
OidIntegration.pointers_incomplete_containing_struct_no_follow | ||
OidIntegration.pointers_incomplete_shared_ptr | ||
OidIntegration.pointers_incomplete_shared_ptr_null | ||
OidIntegration.pointers_incomplete_unique_ptr | ||
OidIntegration.pointers_incomplete_unique_ptr_null | ||
OidIntegration.pointers_struct_primitive_ptrs | ||
OidIntegration.pointers_struct_primitive_ptrs_no_follow | ||
OidIntegration.pointers_struct_primitive_ptrs_null | ||
OidIntegration.pointers_struct_vector_ptr | ||
OidIntegration.pointers_struct_vector_ptr_no_follow | ||
OidIntegration.pointers_struct_vector_ptr_null | ||
OidIntegration.pointers_vector_of_pointers | ||
OidIntegration.primitives_long_double | ||
OidIntegration.simple_class | ||
OidIntegration.simple_struct | ||
OidIntegration.simple_union | ||
OidIntegration.sorted_vector_set_no_ints | ||
OidIntegration.sorted_vector_set_some_ints | ||
OidIntegration.std_array_uint64_length_0 | ||
OidIntegration.std_array_uint64_length_1 | ||
OidIntegration.std_array_uint64_length_8 | ||
OidIntegration.std_array_vector_length_1 | ||
OidIntegration.std_array_vector_length_2 | ||
OidIntegration.std_conditional_a | ||
OidIntegration.std_deque_del_allocator_a | ||
OidIntegration.std_deque_deque_int_empty | ||
OidIntegration.std_deque_deque_int_some | ||
OidIntegration.std_deque_int_empty | ||
OidIntegration.std_deque_int_some | ||
OidIntegration.std_list_del_allocator_a | ||
OidIntegration.std_list_int_empty | ||
OidIntegration.std_list_int_some | ||
OidIntegration.std_list_list_int_empty | ||
OidIntegration.std_list_list_int_some | ||
OidIntegration.std_list_struct_some | ||
OidIntegration.std_map_custom_comparator_a | ||
OidIntegration.std_multimap_custom_comparator_a | ||
OidIntegration.std_multiset_custom_comparator_a | ||
OidIntegration.std_optional_uint64_empty | ||
OidIntegration.std_optional_uint64_present | ||
OidIntegration.std_optional_vector_empty | ||
OidIntegration.std_optional_vector_present | ||
OidIntegration.std_pair_uint64_uint32 | ||
OidIntegration.std_pair_uint64_uint64 | ||
OidIntegration.std_pair_vector_vector | ||
OidIntegration.std_priority_queue_adapter_deque_empty | ||
OidIntegration.std_priority_queue_adapter_deque_some | ||
OidIntegration.std_priority_queue_int_empty | ||
OidIntegration.std_priority_queue_int_some | ||
OidIntegration.std_queue_adapter_vector_empty | ||
OidIntegration.std_queue_adapter_vector_some | ||
OidIntegration.std_queue_int_empty | ||
OidIntegration.std_queue_int_some | ||
OidIntegration.std_queue_queue_int_empty | ||
OidIntegration.std_queue_queue_int_some | ||
OidIntegration.std_reference_wrapper_int | ||
OidIntegration.std_reference_wrapper_vector | ||
OidIntegration.std_set_custom_comparator_a | ||
OidIntegration.std_smart_ptr_shared_ptr_const_uint64_empty | ||
OidIntegration.std_smart_ptr_shared_ptr_const_vector_empty | ||
OidIntegration.std_smart_ptr_shared_ptr_uint64_empty | ||
OidIntegration.std_smart_ptr_shared_ptr_uint64_present | ||
OidIntegration.std_smart_ptr_shared_ptr_vector_empty | ||
OidIntegration.std_smart_ptr_shared_ptr_vector_present | ||
OidIntegration.std_smart_ptr_shared_ptr_void_empty | ||
OidIntegration.std_smart_ptr_shared_ptr_void_present | ||
OidIntegration.std_smart_ptr_unique_ptr_const_uint64_empty | ||
OidIntegration.std_smart_ptr_unique_ptr_const_vector_empty | ||
OidIntegration.std_smart_ptr_unique_ptr_uint64_empty | ||
OidIntegration.std_smart_ptr_unique_ptr_uint64_present | ||
OidIntegration.std_smart_ptr_unique_ptr_vector_empty | ||
OidIntegration.std_smart_ptr_unique_ptr_vector_present | ||
OidIntegration.std_smart_ptr_unique_ptr_void_empty | ||
OidIntegration.std_smart_ptr_unique_ptr_void_present | ||
OidIntegration.std_smart_ptr_weak_ptr_int64_empty | ||
OidIntegration.std_smart_ptr_weak_ptr_int64_expired | ||
OidIntegration.std_smart_ptr_weak_ptr_int64_expired_chase | ||
OidIntegration.std_smart_ptr_weak_ptr_int64_present | ||
OidIntegration.std_smart_ptr_weak_ptr_int64_present_chase | ||
OidIntegration.std_smart_ptr_weak_ptr_int64_void_empty | ||
OidIntegration.std_stack_adapter_vector_empty | ||
OidIntegration.std_stack_adapter_vector_some | ||
OidIntegration.std_stack_int_empty | ||
OidIntegration.std_stack_int_some | ||
OidIntegration.std_stack_stack_int_empty | ||
OidIntegration.std_stack_stack_int_some | ||
OidIntegration.std_string_empty | ||
OidIntegration.std_string_heap_allocated | ||
OidIntegration.std_string_sso | ||
OidIntegration.std_tuple_uint64_uint64 | ||
OidIntegration.std_unordered_map_custom_operator_a | ||
OidIntegration.std_unordered_multimap_custom_operator_a | ||
OidIntegration.std_unordered_multiset_custom_operator_a | ||
OidIntegration.std_unordered_set_custom_operator_a | ||
OidIntegration.std_variant_256_params_256 | ||
OidIntegration.std_variant_256_params_empty | ||
OidIntegration.std_variant_char_int64_1 | ||
OidIntegration.std_variant_char_int64_2 | ||
OidIntegration.std_variant_empty | ||
OidIntegration.std_variant_optional | ||
OidIntegration.std_variant_vector_int_1 | ||
OidIntegration.std_variant_vector_int_2 | ||
OidIntegration.std_vector_del_allocator_a | ||
OidIntegration.std_vector_int_empty | ||
OidIntegration.std_vector_int_some | ||
OidIntegration.std_vector_reserve | ||
OidIntegration.std_vector_struct_some | ||
OidIntegration.std_vector_vector_int_empty | ||
OidIntegration.std_vector_vector_int_some | ||
OidIntegration.templates_int | ||
OidIntegration.templates_two | ||
OidIntegration.templates_value | ||
OidIntegration.templates_vector | ||
OidIntegration.typedefed_parent_multilevel_typedef_parent | ||
OidIntegration.typedefed_parent_simple_typedef_parent | ||
OidIntegration.typedefs_anonymous | ||
OidIntegration.typedefs_container | ||
OidIntegration.unions_alignment | ||
OidIntegration.unions_int | ||
OidIntegration.unions_tagged_int | ||
OidIntegration.unions_tagged_unordered_map | ||
OidIntegration.unions_tagged_vector | ||
OidIntegration.unions_unordered_map | ||
OidIntegration.unions_vector | ||
OilIntegration.folly_f14_fast_map_a | ||
OilIntegration.folly_f14_fast_set_a | ||
OilIntegration.folly_f14_node_map_a | ||
OilIntegration.folly_f14_node_set_a | ||
OilIntegration.folly_f14_value_map_a | ||
OilIntegration.folly_f14_value_set_a | ||
OilIntegration.folly_f14_vector_map_a | ||
OilIntegration.folly_f14_vector_set_a |
Oops, something went wrong.