Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent compiling backend tests if dependencies are not installed #4973

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the cache stallness in CHECK_DEPENDENCIES function
- The current implementation of the above function may suffer from stallness.
- Required changes are made to avoid this.
- Some minor typos are also fixed.

Signed-off-by: ParthShitole <f20212907@goa.bits-pilani.ac.in>
  • Loading branch information
ParthShitole authored and akulkarni committed Oct 27, 2024
commit 43252ef39a4e16933e1b79c0fed164126fbc7ec5
2 changes: 1 addition & 1 deletion backends/ebpf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ if(TEST_DEPENDENCY_PRESENT)
# We do not have support for dynamic addition of tables in the test framework
p4c_add_test_with_args("ebpf" ${EBPF_DRIVER_TEST} TRUE "testdata/p4_16_samples/ebpf_conntrack_extern.p4" "testdata/p4_16_samples/ebpf_conntrack_extern.p4" "--extern-file ${P4C_SOURCE_DIR}/testdata/extern_modules/extern-conntrack-ebpf.c" "")
else()
message(WARNING "Skipped adding Tests due to missing dependencies" " Please install the dependencies and try again")
message(WARNING "Skipped adding Tests due to missing dependencies." " Please install the dependencies and try again")
endif()

message(STATUS "Done with configuring BPF back end")
14 changes: 7 additions & 7 deletions cmake/P4CUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -430,30 +430,30 @@ function(CHECK_DEPENDENCIES OUT_VAR TEST_DEPENDENCY_PROGRAMS TEST_DEPENDENCY_LIB
set(ALL_FOUND TRUE)

foreach(PROG ${TEST_DEPENDENCY_PROGRAMS})
find_program(PROG_PATH ${PROG})
if (NOT PROG_PATH)
find_program(${PROG}_PROG_PATH ${PROG} NO_CACHE)
if (NOT ${PROG}_PROG_PATH)
message(WARNING "Missing program ${PROG}."
" Please install ${PROG} and ensure it is in your PATH.")
set(ALL_FOUND FALSE)
else()
message(STATUS "Found program ${PROG} at ${PROG_PATH}")
message(STATUS "Found program ${PROG}")
endif()
endforeach()

foreach(LIB ${TEST_DEPENDENCY_LIBRARIES})
if (ARGC GREATER 3)
set(HINTS_DIRS_ARG ${ARGV4})
find_library(LIB_PATH ${LIB} HINTS ${HINTS_DIRS})
find_library(${LIB}_LIB_PATH NAMES ${LIB} NO_CACHE HINTS ${HINTS_DIRS})
else()
find_library(LIB_PATH ${LIB})
find_library(${LIB}_LIB_PATH NAMES ${LIB} NO_CACHE)
endif()

if (NOT LIB_PATH)
if (NOT ${LIB}_LIB_PATH)
message(WARNING "Missing library ${LIB}."
" Please install ${LIB}.")
set(ALL_FOUND FALSE)
else()
message(STATUS "Found library ${LIB} at ${LIB_PATH}")
message(STATUS "Found library ${LIB}")
endif()
endforeach()

Expand Down
Loading