Skip to content

Commit 5851b6a

Browse files
committed
chore(ci,cmake): bump libs and driver to latest master.
Also, make use of install-zig action provided by libs. Signed-off-by: Federico Di Pierro <[email protected]>
1 parent 49e4282 commit 5851b6a

File tree

4 files changed

+150
-132
lines changed

4 files changed

+150
-132
lines changed

.github/actions/install-zig/action.yml

-41
This file was deleted.

.github/workflows/reusable_build_packages.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272

7373
- name: Install zig
7474
if: inputs.sanitizers == false
75-
uses: ./.github/actions/install-zig
75+
uses: falcosecurity/libs/.github/actions/install-zig@master
7676

7777
- name: Prepare project
7878
run: |

cmake/modules/driver.cmake

+41-35
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
#
33
# Copyright (C) 2023 The Falco Authors.
44
#
5-
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
6-
# the License. You may obtain a copy of the License at
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
# in compliance with the License. You may obtain a copy of the License at
77
#
88
# http://www.apache.org/licenses/LICENSE-2.0
99
#
10-
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
11-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
12-
# specific language governing permissions and limitations under the License.
10+
# Unless required by applicable law or agreed to in writing, software distributed under the License
11+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
# or implied. See the License for the specific language governing permissions and limitations under
13+
# the License.
1314
#
1415

1516
set(DRIVER_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/driver-repo")
@@ -18,37 +19,42 @@ set(DRIVER_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR}/driver-repo")
1819
file(MAKE_DIRECTORY ${DRIVER_CMAKE_WORKING_DIR})
1920

2021
if(DRIVER_SOURCE_DIR)
21-
set(DRIVER_VERSION "0.0.0-local")
22-
message(STATUS "Using local version for driver: '${DRIVER_SOURCE_DIR}'")
22+
set(DRIVER_VERSION "0.0.0-local")
23+
message(STATUS "Using local version for driver: '${DRIVER_SOURCE_DIR}'")
2324
else()
24-
# DRIVER_REPO accepts a repository name (<org name>/<repo name>) alternative to the falcosecurity/libs repository.
25-
# In case you want to test against a fork of falcosecurity/libs just pass the variable -
26-
# ie., `cmake -DDRIVER_REPO=<your-gh-handle>/libs ..`
27-
if (NOT DRIVER_REPO)
28-
set(DRIVER_REPO "falcosecurity/libs")
29-
endif()
30-
31-
# DRIVER_VERSION accepts a git reference (branch name, commit hash, or tag) to the falcosecurity/libs repository
32-
# which contains the driver source code under the `/driver` directory.
33-
# The chosen driver version must be compatible with the given FALCOSECURITY_LIBS_VERSION.
34-
# In case you want to test against another driver version (or branch, or commit) just pass the variable -
35-
# ie., `cmake -DDRIVER_VERSION=dev ..`
36-
if(NOT DRIVER_VERSION)
37-
set(DRIVER_VERSION "7.3.0+driver")
38-
set(DRIVER_CHECKSUM "SHA256=8f572d9a83feda635a3fa53b859d61e37af127c241e35068aadee3bc50d212c0")
39-
endif()
40-
41-
# cd /path/to/build && cmake /path/to/source
42-
execute_process(COMMAND "${CMAKE_COMMAND}"
43-
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
44-
-DDRIVER_REPO=${DRIVER_REPO}
45-
-DDRIVER_VERSION=${DRIVER_VERSION}
46-
-DDRIVER_CHECKSUM=${DRIVER_CHECKSUM}
47-
${DRIVER_CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${DRIVER_CMAKE_WORKING_DIR})
48-
49-
# cmake --build .
50-
execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${DRIVER_CMAKE_WORKING_DIR}")
51-
set(DRIVER_SOURCE_DIR "${DRIVER_CMAKE_WORKING_DIR}/driver-prefix/src/driver")
25+
# DRIVER_REPO accepts a repository name (<org name>/<repo name>) alternative to the
26+
# falcosecurity/libs repository. In case you want to test against a fork of falcosecurity/libs
27+
# just pass the variable - ie., `cmake -DDRIVER_REPO=<your-gh-handle>/libs ..`
28+
if(NOT DRIVER_REPO)
29+
set(DRIVER_REPO "falcosecurity/libs")
30+
endif()
31+
32+
# DRIVER_VERSION accepts a git reference (branch name, commit hash, or tag) to the
33+
# falcosecurity/libs repository which contains the driver source code under the `/driver`
34+
# directory. The chosen driver version must be compatible with the given
35+
# FALCOSECURITY_LIBS_VERSION. In case you want to test against another driver version (or
36+
# branch, or commit) just pass the variable - ie., `cmake -DDRIVER_VERSION=dev ..`
37+
if(NOT DRIVER_VERSION)
38+
set(DRIVER_VERSION "8baec4b102662200b3a382722f01276748125e0f")
39+
set(DRIVER_CHECKSUM
40+
"SHA256=e2750d337f7e28780bd7b4d2efa6ea7a99f43aed2815fd0f7529bfac1a10f429"
41+
)
42+
endif()
43+
44+
# cd /path/to/build && cmake /path/to/source
45+
execute_process(
46+
COMMAND
47+
"${CMAKE_COMMAND}" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" -DDRIVER_REPO=${DRIVER_REPO}
48+
-DDRIVER_VERSION=${DRIVER_VERSION} -DDRIVER_CHECKSUM=${DRIVER_CHECKSUM}
49+
${DRIVER_CMAKE_SOURCE_DIR}
50+
WORKING_DIRECTORY ${DRIVER_CMAKE_WORKING_DIR}
51+
)
52+
53+
# cmake --build .
54+
execute_process(
55+
COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${DRIVER_CMAKE_WORKING_DIR}"
56+
)
57+
set(DRIVER_SOURCE_DIR "${DRIVER_CMAKE_WORKING_DIR}/driver-prefix/src/driver")
5258
endif()
5359

5460
add_definitions(-D_GNU_SOURCE)

cmake/modules/falcosecurity-libs.cmake

+108-55
Original file line numberDiff line numberDiff line change
@@ -2,92 +2,142 @@
22
#
33
# Copyright (C) 2023 The Falco Authors.
44
#
5-
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
6-
# the License. You may obtain a copy of the License at
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6+
# in compliance with the License. You may obtain a copy of the License at
77
#
88
# http://www.apache.org/licenses/LICENSE-2.0
99
#
10-
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
11-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
12-
# specific language governing permissions and limitations under the License.
10+
# Unless required by applicable law or agreed to in writing, software distributed under the License
11+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12+
# or implied. See the License for the specific language governing permissions and limitations under
13+
# the License.
1314
#
1415

15-
set(FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/falcosecurity-libs-repo")
16+
set(FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR
17+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/falcosecurity-libs-repo"
18+
)
1619
set(FALCOSECURITY_LIBS_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR}/falcosecurity-libs-repo")
1720

1821
file(MAKE_DIRECTORY ${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR})
1922

2023
# explicitly disable the bundled driver, since we pull it separately
21-
set(USE_BUNDLED_DRIVER OFF CACHE BOOL "")
24+
set(USE_BUNDLED_DRIVER
25+
OFF
26+
CACHE BOOL ""
27+
)
2228

2329
if(FALCOSECURITY_LIBS_SOURCE_DIR)
24-
set(FALCOSECURITY_LIBS_VERSION "0.0.0-local")
25-
message(STATUS "Using local version of falcosecurity/libs: '${FALCOSECURITY_LIBS_SOURCE_DIR}'")
30+
set(FALCOSECURITY_LIBS_VERSION "0.0.0-local")
31+
message(STATUS "Using local version of falcosecurity/libs: '${FALCOSECURITY_LIBS_SOURCE_DIR}'")
2632
else()
27-
# FALCOSECURITY_LIBS_REPO accepts a repository name (<org name>/<repo name>) alternative to the falcosecurity/libs repository.
28-
# In case you want to test against a fork of falcosecurity/libs just pass the variable -
29-
# ie., `cmake -DFALCOSECURITY_LIBS_REPO=<your-gh-handle>/libs ..`
30-
if (NOT FALCOSECURITY_LIBS_REPO)
31-
set(FALCOSECURITY_LIBS_REPO "falcosecurity/libs")
32-
endif()
33-
34-
# FALCOSECURITY_LIBS_VERSION accepts a git reference (branch name, commit hash, or tag) to the falcosecurity/libs repository.
35-
# In case you want to test against another falcosecurity/libs version (or branch, or commit) just pass the variable -
36-
# ie., `cmake -DFALCOSECURITY_LIBS_VERSION=dev ..`
37-
if(NOT FALCOSECURITY_LIBS_VERSION)
38-
set(FALCOSECURITY_LIBS_VERSION "e7bbd50cd04d83e088be675f10e638de732388da")
39-
#set(FALCOSECURITY_LIBS_CHECKSUM "SHA256=aedc4120d335ee2ebf7f3c2e6346fc985ca09a49d14ff7c6249a033e47d160bf")
40-
endif()
41-
42-
# cd /path/to/build && cmake /path/to/source
43-
execute_process(COMMAND "${CMAKE_COMMAND}"
44-
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
45-
-DFALCOSECURITY_LIBS_REPO=${FALCOSECURITY_LIBS_REPO}
46-
-DFALCOSECURITY_LIBS_VERSION=${FALCOSECURITY_LIBS_VERSION}
47-
-DFALCOSECURITY_LIBS_CHECKSUM=${FALCOSECURITY_LIBS_CHECKSUM}
48-
${FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR})
49-
50-
# cmake --build .
51-
execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}")
52-
set(FALCOSECURITY_LIBS_SOURCE_DIR "${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}/falcosecurity-libs-prefix/src/falcosecurity-libs")
33+
# FALCOSECURITY_LIBS_REPO accepts a repository name (<org name>/<repo name>) alternative to the
34+
# falcosecurity/libs repository. In case you want to test against a fork of falcosecurity/libs
35+
# just pass the variable - ie., `cmake -DFALCOSECURITY_LIBS_REPO=<your-gh-handle>/libs ..`
36+
if(NOT FALCOSECURITY_LIBS_REPO)
37+
set(FALCOSECURITY_LIBS_REPO "falcosecurity/libs")
38+
endif()
39+
40+
# FALCOSECURITY_LIBS_VERSION accepts a git reference (branch name, commit hash, or tag) to the
41+
# falcosecurity/libs repository. In case you want to test against another falcosecurity/libs
42+
# version (or branch, or commit) just pass the variable - ie., `cmake
43+
# -DFALCOSECURITY_LIBS_VERSION=dev ..`
44+
if(NOT FALCOSECURITY_LIBS_VERSION)
45+
set(FALCOSECURITY_LIBS_VERSION "8baec4b102662200b3a382722f01276748125e0f")
46+
set(FALCOSECURITY_LIBS_CHECKSUM
47+
"SHA256=e2750d337f7e28780bd7b4d2efa6ea7a99f43aed2815fd0f7529bfac1a10f429"
48+
)
49+
endif()
50+
51+
# cd /path/to/build && cmake /path/to/source
52+
execute_process(
53+
COMMAND
54+
"${CMAKE_COMMAND}" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}"
55+
-DFALCOSECURITY_LIBS_REPO=${FALCOSECURITY_LIBS_REPO}
56+
-DFALCOSECURITY_LIBS_VERSION=${FALCOSECURITY_LIBS_VERSION}
57+
-DFALCOSECURITY_LIBS_CHECKSUM=${FALCOSECURITY_LIBS_CHECKSUM}
58+
${FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR}
59+
WORKING_DIRECTORY ${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}
60+
)
61+
62+
# cmake --build .
63+
execute_process(
64+
COMMAND "${CMAKE_COMMAND}" --build .
65+
WORKING_DIRECTORY "${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}"
66+
)
67+
set(FALCOSECURITY_LIBS_SOURCE_DIR
68+
"${FALCOSECURITY_LIBS_CMAKE_WORKING_DIR}/falcosecurity-libs-prefix/src/falcosecurity-libs"
69+
)
5370
endif()
5471

5572
set(LIBS_PACKAGE_NAME "falcosecurity")
5673

5774
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
58-
add_definitions(-D_GNU_SOURCE)
75+
add_definitions(-D_GNU_SOURCE)
5976
endif()
6077

6178
if(MUSL_OPTIMIZED_BUILD)
62-
add_definitions(-DMUSL_OPTIMIZED)
79+
add_definitions(-DMUSL_OPTIMIZED)
6380
endif()
6481

6582
set(SCAP_HOST_ROOT_ENV_VAR_NAME "HOST_ROOT")
6683
set(SCAP_HOSTNAME_ENV_VAR "FALCO_HOSTNAME")
6784
set(SINSP_AGENT_CGROUP_MEM_PATH_ENV_VAR "FALCO_CGROUP_MEM_PATH")
6885

6986
if(NOT LIBS_DIR)
70-
set(LIBS_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR}")
87+
set(LIBS_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR}")
7188
endif()
7289

7390
# configure gVisor support
74-
set(BUILD_LIBSCAP_GVISOR ${BUILD_FALCO_GVISOR} CACHE BOOL "")
91+
set(BUILD_LIBSCAP_GVISOR
92+
${BUILD_FALCO_GVISOR}
93+
CACHE BOOL ""
94+
)
7595

7696
# configure modern BPF support
77-
set(BUILD_LIBSCAP_MODERN_BPF ${BUILD_FALCO_MODERN_BPF} CACHE BOOL "")
97+
set(BUILD_LIBSCAP_MODERN_BPF
98+
${BUILD_FALCO_MODERN_BPF}
99+
CACHE BOOL ""
100+
)
78101

79102
# explicitly disable the tests/examples of this dependency
80-
set(CREATE_TEST_TARGETS OFF CACHE BOOL "")
81-
set(BUILD_LIBSCAP_EXAMPLES OFF CACHE BOOL "")
82-
83-
set(USE_BUNDLED_TBB ON CACHE BOOL "")
84-
set(USE_BUNDLED_JSONCPP ON CACHE BOOL "")
85-
set(USE_BUNDLED_VALIJSON ON CACHE BOOL "")
86-
set(USE_BUNDLED_RE2 ON CACHE BOOL "")
87-
set(USE_BUNDLED_UTHASH ON CACHE BOOL "")
103+
set(CREATE_TEST_TARGETS
104+
OFF
105+
CACHE BOOL ""
106+
)
107+
set(BUILD_LIBSCAP_EXAMPLES
108+
OFF
109+
CACHE BOOL ""
110+
)
111+
112+
set(USE_BUNDLED_TBB
113+
ON
114+
CACHE BOOL ""
115+
)
116+
set(USE_BUNDLED_JSONCPP
117+
ON
118+
CACHE BOOL ""
119+
)
120+
set(USE_BUNDLED_VALIJSON
121+
ON
122+
CACHE BOOL ""
123+
)
124+
set(USE_BUNDLED_RE2
125+
ON
126+
CACHE BOOL ""
127+
)
128+
set(USE_BUNDLED_UTHASH
129+
ON
130+
CACHE BOOL ""
131+
)
88132
if(USE_DYNAMIC_LIBELF)
89-
set(USE_BUNDLED_LIBELF OFF CACHE BOOL "")
90-
set(USE_SHARED_LIBELF ON CACHE BOOL "")
133+
set(USE_BUNDLED_LIBELF
134+
OFF
135+
CACHE BOOL ""
136+
)
137+
set(USE_SHARED_LIBELF
138+
ON
139+
CACHE BOOL ""
140+
)
91141
endif()
92142

93143
list(APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR}/cmake/modules")
@@ -96,15 +146,18 @@ include(CheckSymbolExists)
96146
check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY)
97147

98148
if(HAVE_STRLCPY)
99-
message(STATUS "Existing strlcpy and strlcat found, will *not* use local definition by setting -DHAVE_STRLCPY and -DHAVE_STRLCAT.")
100-
add_definitions(-DHAVE_STRLCPY)
101-
add_definitions(-DHAVE_STRLCAT)
149+
message(
150+
STATUS
151+
"Existing strlcpy and strlcat found, will *not* use local definition by setting -DHAVE_STRLCPY and -DHAVE_STRLCAT."
152+
)
153+
add_definitions(-DHAVE_STRLCPY)
154+
add_definitions(-DHAVE_STRLCAT)
102155
else()
103-
message(STATUS "No strlcpy and strlcat found, will use local definition")
156+
message(STATUS "No strlcpy and strlcat found, will use local definition")
104157
endif()
105158

106159
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
107-
include(driver)
160+
include(driver)
108161
endif()
109162
include(libscap)
110163
include(libsinsp)

0 commit comments

Comments
 (0)