diff --git a/.github/workflows/ci-test-ubuntu.yml b/.github/workflows/ci-test-ubuntu.yml index 828faa66d..5b6d1da85 100644 --- a/.github/workflows/ci-test-ubuntu.yml +++ b/.github/workflows/ci-test-ubuntu.yml @@ -60,7 +60,7 @@ jobs: - name: Run tests run: | # FIXME: Move these into a separate test suite. - ENABLE_BF_ASM=TRUE make -C build tna_counter install + make -C build tna_counter install export SDE=`pwd` export SDE_INSTALL="`pwd`/install" diff --git a/cmake/P4Build.cmake b/cmake/P4Build.cmake index 3c9f43529..fbb6e68d5 100644 --- a/cmake/P4Build.cmake +++ b/cmake/P4Build.cmake @@ -80,7 +80,7 @@ function(P4_BUILD_TARGET t arch target p4program) separate_arguments(COMPUTED_P4PPFLAGS UNIX_COMMAND ${P4PPFLAGS}) # compile the p4 program add_custom_command(OUTPUT ${output_files} - COMMAND ${P4C} --std ${P4_LANG} --target ${target} --arch ${arch} --enable-bf-asm ${rt_commands} -o ${CMAKE_CURRENT_BINARY_DIR}/${t}/${target} ${COMPUTED_P4PPFLAGS} ${COMPUTED_P4FLAGS} ${P4FLAGS_INTERNAL} -g ${p4program} + COMMAND ${P4C} --std ${P4_LANG} --target ${target} --arch ${arch} ${rt_commands} -o ${CMAKE_CURRENT_BINARY_DIR}/${t}/${target} ${COMPUTED_P4PPFLAGS} ${COMPUTED_P4FLAGS} ${P4FLAGS_INTERNAL} -g ${p4program} COMMAND ${P4C-GEN-BFRT-CONF} --name ${t} --device ${chiptype} --testdir ./${t}/${target} --installdir share/${target}pd/${t} --pipe `${P4C-MANIFEST-CONFIG} --pipe ./${t}/${target}/manifest.json` DEPENDS ${p4program} bf-p4c @@ -159,7 +159,7 @@ function(P4_BUILD_PD_TARGET t arch target p4program) separate_arguments(COMPUTED_PDFLAGS UNIX_COMMAND ${PDFLAGS}) # compile the p4 program add_custom_command(OUTPUT ${t}/${target}/manifest.json - COMMAND ${P4C} --std ${P4_LANG} --target ${target} --arch ${arch} --enable-bf-asm --no-bf-rt-schema -o ${CMAKE_CURRENT_BINARY_DIR}/${t}/${target} ${COMPUTED_P4PPFLAGS} ${COMPUTED_P4FLAGS} ${P4FLAGS_INTERNAL} -g ${p4program} + COMMAND ${P4C} --std ${P4_LANG} --target ${target} --arch ${arch} --no-bf-rt-schema -o ${CMAKE_CURRENT_BINARY_DIR}/${t}/${target} ${COMPUTED_P4PPFLAGS} ${COMPUTED_P4FLAGS} ${P4FLAGS_INTERNAL} -g ${p4program} DEPENDS ${p4program} bf-p4c ) diff --git a/p4studio/utils/processes.py b/p4studio/utils/processes.py index 1d9309b50..d6b9850bf 100644 --- a/p4studio/utils/processes.py +++ b/p4studio/utils/processes.py @@ -62,7 +62,7 @@ def try_execute(command: Union[str, Sequence[str]], working_dir: Optional[PathLi while process.poll() is None: while True: stdout = process.stdout - line = stdout.readline().decode().rstrip() if stdout else "" + line = stdout.readline().decode('latin-1').rstrip() if stdout else "" if line: compact_log().log(line) else: diff --git a/pkgsrc/p4-compilers/CMakeLists.txt b/pkgsrc/p4-compilers/CMakeLists.txt index a6e394c3b..3b07a9e1e 100644 --- a/pkgsrc/p4-compilers/CMakeLists.txt +++ b/pkgsrc/p4-compilers/CMakeLists.txt @@ -1,11 +1,10 @@ # First, check whether the repository needs to be initialized. - # Check if the submodule directory exists. -if (NOT EXISTS "${CMAKE_SOURCE_DIR}/p4c/CMakeLists.txt") +if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/p4c/CMakeLists.txt") message(STATUS "Initializing P4C submodule...") execute_process( COMMAND git submodule update --init --recursive - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE GIT_SUBMODULE_RESULT ) @@ -17,10 +16,6 @@ else() endif() -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS ON) -set(ENABLE_BF_ASM TRUE) add_definitions("-DBAREFOOT_INTERNAL=1") add_definitions("-DHAVE_JBAY=1") set (P4C_USE_PREINSTALLED_ABSEIL ON CACHE BOOL "") @@ -42,12 +37,10 @@ set (ENABLE_P4FMT OFF CACHE BOOL "") set (ENABLE_P4TEST OFF CACHE BOOL "") set (ENABLE_P4C_GRAPHS OFF CACHE BOOL "") # set (ENABLE_LTO ON CACHE BOOL "") -# Enable Unity builds for the compiler and bf-asm to speed up compilation. +# Enable Unity builds for the compiler to speed up compilation. set(CMAKE_UNITY_BUILD_PREV ${CMAKE_UNITY_BUILD}) set(CMAKE_UNITY_BUILD ON) add_subdirectory(p4c) - -add_subdirectory(bf-asm) set(CMAKE_UNITY_BUILD ${CMAKE_UNITY_BUILD_PREV}) diff --git a/pkgsrc/p4-compilers/p4c b/pkgsrc/p4-compilers/p4c index 660779e8e..b9b092baf 160000 --- a/pkgsrc/p4-compilers/p4c +++ b/pkgsrc/p4-compilers/p4c @@ -1 +1 @@ -Subproject commit 660779e8e2fc645b4c90f75f40c71537ec2bde97 +Subproject commit b9b092baf41dcc5ccb8d40206e82d9388d48e89b