Skip to content

Commit 189b7b2

Browse files
committed
Toggle P4-14 for CI build.
Signed-off-by: fruffy <[email protected]>
1 parent ad5f087 commit 189b7b2

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

.github/workflows/ci-test-debian.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
CTEST_PARALLEL_LEVEL: 4
2323
IMAGE_TYPE: test
2424
BUILD_GENERATOR: Ninja
25+
SUPPORT_P4_14: ON
26+
2527
steps:
2628
- uses: actions/checkout@v5
2729
with:

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ ARG COMPILE_WITH_CLANG=OFF
3737
ARG ENABLE_SANITIZERS=OFF
3838
# Only execute the steps necessary to successfully run CMake.
3939
ARG CMAKE_ONLY=OFF
40+
# Support P4-14 in the compiler (legacy).
41+
ARG SUPPORT_P4_14=OFF
4042
# Build with -ftrivial-auto-var-init=pattern to catch more bugs caused by
4143
# uninitialized variables.
4244
ARG BUILD_AUTO_VAR_INIT_PATTERN=OFF

backends/bmv2/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ add_custom_target(linkbmv2
144144
add_dependencies(p4c_driver linkbmv2)
145145

146146
if (SUPPORT_P4_14)
147-
add_custom_target(linkp414test
147+
add_custom_target(linkp414bmv2
148148
COMMAND ${CMAKE_COMMAND} -E create_symlink ${P4C_BINARY_DIR_PATH_REL}/p4_14include ${CMAKE_CURRENT_BINARY_DIR}/p4_14include
149149
DEPENDS update_includes
150150
)

frontends/common/parseInput.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ const IR::P4Program *parseP4String(const char *sourceFile, unsigned sourceLine,
4141
result =
4242
parseV1Program<std::istringstream &, P4V1::Converter>(stream, sourceFile, sourceLine);
4343
else
44-
#else
45-
result = P4ParserDriver::parse(stream, sourceFile, sourceLine);
4644
#endif
45+
result = P4ParserDriver::parse(stream, sourceFile, sourceLine);
4746

4847
if (::P4::errorCount() > 0) {
4948
::P4::error(ErrorType::ERR_OVERLIMIT, "%1% errors encountered, aborting compilation",

tools/ci-build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ P4C_DIR=$(readlink -f ${THIS_DIR}/..)
5252
: "${ENABLE_EBPF:=ON}"
5353
# P4TC is enabled by default.
5454
: "${ENABLE_P4TC:=ON}"
55+
# P4-14 is disabled by default.
56+
: "${SUPPORT_P4_14:=OFF}"
5557
# P4TC STF is only enabled when running p4tc tagged PRs.
5658
: "${INSTALL_STF_P4TC_DEPENDENCIES:=OFF}"
5759
# This is the list of back ends that can be enabled.
@@ -341,6 +343,8 @@ CMAKE_FLAGS+="-DENABLE_WERROR=${ENABLE_WERROR} "
341343
CMAKE_FLAGS+="-DENABLE_SANITIZERS=${ENABLE_SANITIZERS} "
342344
# Enable auto var initialization with pattern.
343345
CMAKE_FLAGS+="-DBUILD_AUTO_VAR_INIT_PATTERN=${BUILD_AUTO_VAR_INIT_PATTERN} "
346+
# Enable P4-14 support.
347+
CMAKE_FLAGS+="-DSUPPORT_P4_14=${SUPPORT_P4_14} "
344348
# Assemble the enabled back ends as a single CMake variable.
345349
build_cmake_enabled_backend_string
346350
CMAKE_FLAGS+="${CMAKE_ENABLE_BACKENDS} "

0 commit comments

Comments
 (0)