From 5a82d11bca219cc4087aa9f933cfcc6327ccc12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Bolvansk=C3=BD?= Date: Sun, 18 Dec 2022 10:54:06 +0100 Subject: [PATCH] Fix container build (#3786) --- backends/p4test/CMakeLists.txt | 2 ++ tools/ci-build.sh | 24 +++++++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/backends/p4test/CMakeLists.txt b/backends/p4test/CMakeLists.txt index 6a0cca55651..e0de43863a7 100644 --- a/backends/p4test/CMakeLists.txt +++ b/backends/p4test/CMakeLists.txt @@ -136,3 +136,5 @@ set (P4_14_SUITES "${P4C_SOURCE_DIR}/testdata/p4_14_samples/*.p4" "${P4C_SOURCE_DIR}/testdata/p4_14_samples/switch_*/switch.p4") p4c_add_tests("p14_to_16" ${P4TEST_DRIVER} "${P4_14_SUITES}" "") + +set_tests_properties("p14_to_16/testdata/p4_14_samples/switch_20160512/switch.p4" PROPERTIES TIMEOUT 500) diff --git a/tools/ci-build.sh b/tools/ci-build.sh index 52fdbb6d9f3..8c13e7d27d6 100755 --- a/tools/ci-build.sh +++ b/tools/ci-build.sh @@ -48,11 +48,9 @@ P4C_DEPS="bison \ build-essential \ ccache \ cmake \ - curl \ flex \ g++ \ git \ - gnupg \ lld \ libboost-dev \ libboost-graph-dev \ @@ -94,17 +92,17 @@ P4C_PIP_PACKAGES="ipaddr \ scapy==2.4.5 \ clang-format>=15.0.4" - -if [[ "${DISTRIB_RELEASE}" == "18.04" ]] ; then +if [[ "${DISTRIB_RELEASE}" == "18.04" ]] || [[ "$(which simple_switch 2> /dev/null)" != "" ]] ; then P4C_DEPS+=" libprotobuf-dev protobuf-compiler" else + apt-get update && apt-get install -y curl gnupg echo "deb http://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${DISTRIB_RELEASE}/ /" | tee /etc/apt/sources.list.d/home:p4lang.list curl -L "http://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${DISTRIB_RELEASE}/Release.key" | apt-key add - P4C_DEPS+=" p4lang-bmv2" fi -apt update -apt install -y --no-install-recommends \ +apt-get update +apt-get install -y --no-install-recommends \ ${P4C_DEPS} \ ${P4C_EBPF_DEPS} \ ${P4C_RUNTIME_DEPS} @@ -136,10 +134,10 @@ function install_ptf_ebpf_test_deps() ( python3-six \ libgmp-dev \ libjansson-dev" - apt install -y --no-install-recommends ${P4C_PTF_PACKAGES} + apt-get install -y --no-install-recommends ${P4C_PTF_PACKAGES} if apt-cache show ${LINUX_TOOLS}; then - apt install -y --no-install-recommends ${LINUX_TOOLS} + apt-get install -y --no-install-recommends ${LINUX_TOOLS} fi git clone --depth 1 --recursive --branch v0.2.0 https://github.com/NIKSS-vSwitch/nikss /tmp/nikss @@ -166,12 +164,12 @@ fi # ! ------ BEGIN VALIDATION ----------------------------------------------- function build_gauntlet() { # For add-apt-repository. - apt install -y software-properties-common + apt-get install -y software-properties-common # Symlink the toz3 extension for the p4 compiler. mkdir -p /p4c/extensions git clone -b stable https://github.com/p4gauntlet/toz3 /p4c/extensions/toz3 # The interpreter requires boost filesystem for file management. - apt install -y libboost-filesystem-dev + apt-get install -y libboost-filesystem-dev # Disable failures on crashes CMAKE_FLAGS+="-DVALIDATION_IGNORE_CRASHES=ON " } @@ -186,7 +184,7 @@ fi # ! ------ BEGIN P4TESTGEN ----------------------------------------------- function build_tools_deps() { # This is needed for P4Testgen. - apt install -y libboost-filesystem-dev libboost-system-dev wget zip + apt-get install -y libboost-filesystem-dev libboost-system-dev wget zip # Install a recent version of Z3 Z3_VERSION="z3-4.8.14" @@ -253,8 +251,8 @@ fi if [[ "${IMAGE_TYPE}" == "build" ]] ; then - apt purge -y ${P4C_DEPS} git - apt autoremove --purge -y + apt-get purge -y ${P4C_DEPS} git + apt-get autoremove --purge -y rm -rf /p4c /var/cache/apt/* /var/lib/apt/lists/* echo 'Build image ready'