Skip to content

Commit

Permalink
Use External_Project for bpf_conformance (#367)
Browse files Browse the repository at this point in the history
Use External_Project in cmake rather than a git submodule.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
  • Loading branch information
hawkinsw authored Nov 28, 2023
1 parent 274cf83 commit 3c0c5ac
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 45 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,6 @@ jobs:
lcov \
boost
# Build the bpf_conformance suite separately as it doesn't build in arm64.
- name: Configure bpf_conformance
run: |
export CCACHE_DIR="$(pwd)/ccache"
cmake \
-G Ninja \
-S external/bpf_conformance \
-B build_bpf_conformance
- name: Build bpf_conformance
run: |
export CCACHE_DIR="$(pwd)/ccache"
cmake \
--build build_bpf_conformance \
--config ${{ inputs.build_type }}
- name: Configure uBPF
run: |
export CCACHE_DIR="$(pwd)/ccache"
Expand All @@ -170,8 +152,6 @@ jobs:
-DUBPF_DISABLE_RETPOLINES=${{ inputs.disable_retpolines }} \
-DUBPF_ENABLE_TESTS=true \
-DUBPF_ENABLE_INSTALL=true \
-DUBPF_SKIP_EXTERNAL=true \
-DBPF_CONFORMANCE_RUNNER="$(pwd)/build_bpf_conformance/bin/bpf_conformance_runner" \
${arch_flags}
- name: Build uBPF
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ jobs:
- name: Run the bpf_conformance tests (Windows)
run: |
cd .\build\bin\${{ inputs.build_type }}
$BPF_CONFORMANCE_RUNNER = "..\..\external\bpf_conformance\bin\${{ inputs.build_type }}\bpf_conformance_runner.exe"
$BPF_CONFORMANCE_RUNNER = "..\..\external\bin\${{ inputs.build_type }}\bpf_conformance_runner.exe"
& $BPF_CONFORMANCE_RUNNER --test_file_directory ..\tests --plugin_path ubpf_plugin.exe --plugin_options --jit
if ($LastExitCode -ne 0) { throw "Test failed"; }
& $BPF_CONFORMANCE_RUNNER --test_file_directory ..\tests --plugin_path ubpf_plugin.exe --plugin_options --interpret
if ($LastExitCode -ne 0) { throw "Test failed"; }
& $BPF_CONFORMANCE_RUNNER --exclude lock_ --test_file_directory ..\..\external\bpf_conformance\tests --plugin_path ubpf_plugin.exe --plugin_options --jit
& $BPF_CONFORMANCE_RUNNER --exclude lock_ --test_file_directory ..\..\external\tests --plugin_path ubpf_plugin.exe --plugin_options --jit
if ($LastExitCode -ne 0) { throw "Test failed"; }
& $BPF_CONFORMANCE_RUNNER --exclude lock_ --test_file_directory ..\..\external\bpf_conformance\tests --plugin_path ubpf_plugin.exe --plugin_options --interpret
& $BPF_CONFORMANCE_RUNNER --exclude lock_ --test_file_directory ..\..\external\tests --plugin_path ubpf_plugin.exe --plugin_options --interpret
if ($LastExitCode -ne 0) { throw "Test failed"; }
- name: Generate the TGZ package
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "vm/compat/libraries/win-c/src"]
path = vm/compat/libraries/win-c/src
url = https://github.com/takamin/win-c
[submodule "external/bpf_conformance"]
path = external/bpf_conformance
url = https://github.com/Alan-Jowett/bpf_conformance.git
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@
# the LICENSE file found in the root directory of this source tree.
#

include(ExternalProject)
cmake_minimum_required(VERSION 3.16)
project("ubpf")

if (UBPF_INSTALL_GIT_HOOKS AND EXISTS "${PROJECT_SOURCE_DIR}/.git/hooks")
# Install Git pre-commit hook
file(COPY scripts/pre-commit scripts/commit-msg
DESTINATION "${PROJECT_SOURCE_DIR}/.git/hooks")
endif()

include("cmake/platform.cmake")
include("cmake/settings.cmake")
include("cmake/options.cmake")
Expand All @@ -30,7 +25,11 @@ add_subdirectory("vm")
if(UBPF_ENABLE_TESTS)
add_subdirectory("ubpf_plugin")
if (NOT UBPF_SKIP_EXTERNAL)
add_subdirectory("external")
ExternalProject_Add(Conformance GIT_REPOSITORY "https://github.com/Alan-Jowett/bpf_conformance.git"
GIT_SUBMODULES_RECURSE true
GIT_TAG main
INSTALL_COMMAND ""
BINARY_DIR ${CMAKE_BINARY_DIR}/external/)
endif()
add_subdirectory("bpf")
add_subdirectory("aarch64_test")
Expand Down
9 changes: 0 additions & 9 deletions external/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion external/bpf_conformance
Submodule bpf_conformance deleted from 063f44
4 changes: 2 additions & 2 deletions ubpf_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ target_link_libraries(
ubpf_settings
)

file(GLOB external_files ${CMAKE_SOURCE_DIR}/external/bpf_conformance/tests/*.data)
file(GLOB external_files ${CMAKE_SOURCE_DIR}/external/tests/*.data)
file(GLOB local_files ${CMAKE_SOURCE_DIR}/tests/*.data)

set(files ${external_files} ${local_files})

if(NOT BPF_CONFORMANCE_RUNNER)
set(BPF_CONFORMANCE_RUNNER ${CMAKE_BINARY_DIR}/external/bpf_conformance/bin/bpf_conformance_runner)
set(BPF_CONFORMANCE_RUNNER ${CMAKE_BINARY_DIR}/external/bin/bpf_conformance_runner)
else()
message(STATUS "Using custom bpf_conformance_runner: ${BPF_CONFORMANCE_RUNNER}")
endif()
Expand Down

0 comments on commit 3c0c5ac

Please sign in to comment.