104
104
105
105
sudo apt-get update
106
106
sudo apt-get install -y --no-install-recommends ${P4C_DEPS}
107
- sudo pip3 install --upgrade pip
108
- sudo pip3 install -r ${P4C_DIR} /requirements.txt
107
+ # Set up poetry.
108
+ sudo apt-get install -y python3-venv curl
109
+ curl -sSL https://install.python-poetry.org | python3 -
110
+ poetry install -C ${P4C_DIR}
109
111
110
112
if [ " ${BUILD_GENERATOR,,} " == " ninja" ] && [ ! $( command -v ninja) ]
111
113
then
@@ -128,8 +130,6 @@ function build_bmv2() {
128
130
# TODO: Remove this check once 18.04 is deprecated.
129
131
if [[ " ${DISTRIB_RELEASE} " == " 18.04" ]] ; then
130
132
P4C_RUNTIME_DEPS_BOOST=" libboost-graph1.65.1 libboost-iostreams1.65.1"
131
- else
132
- P4C_RUNTIME_DEPS_BOOST=" libboost-graph1.7* libboost-iostreams1.7*"
133
133
fi
134
134
135
135
P4C_RUNTIME_DEPS=" cpp \
@@ -146,7 +146,7 @@ function build_bmv2() {
146
146
P4C_RUNTIME_DEPS+=" gcc-9 g++-9"
147
147
export CC=gcc-9
148
148
export CXX=g++-9
149
- else
149
+ elif [[ " ${DISTRIB_RELEASE} " != " 24.04 " ]] ; then
150
150
sudo apt-get install -y wget ca-certificates
151
151
# Add the p4lang opensuse repository.
152
152
echo " deb http://download.opensuse.org/repositories/home:/p4lang/xUbuntu_${DISTRIB_RELEASE} / /" | sudo tee /etc/apt/sources.list.d/home:p4lang.list
@@ -155,11 +155,6 @@ function build_bmv2() {
155
155
fi
156
156
157
157
sudo apt-get update && sudo apt-get install -y --no-install-recommends ${P4C_RUNTIME_DEPS}
158
-
159
- if [[ " ${DISTRIB_RELEASE} " != " 18.04" ]] ; then
160
- # To run PTF nanomsg tests. Not available on 18.04.
161
- sudo pip3 install nnpy
162
- fi
163
158
}
164
159
165
160
if [[ " ${ENABLE_BMV2} " == " ON" ]] ; then
292
287
if [ -e build ]; then /bin/rm -rf build; fi
293
288
mkdir -p ${P4C_DIR} /build
294
289
cd ${P4C_DIR} /build
295
- cmake ${CMAKE_FLAGS} -G " ${BUILD_GENERATOR} " ..
290
+ poetry run cmake ${CMAKE_FLAGS} -G " ${BUILD_GENERATOR} " ..
296
291
297
292
# If CMAKE_ONLY is active, only run CMake. Do not build.
298
293
if [ " $CMAKE_ONLY " == " OFF" ]; then
299
- cmake --build . -- -j $( nproc)
300
- sudo cmake --install .
294
+ poetry run cmake --build . -- -j $( nproc)
295
+ sudo -E env PATH= " $PATH " cmake --install .
301
296
# Print ccache statistics after building
302
297
ccache -p -s
303
298
fi
0 commit comments