mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 02:15:06 +03:00
fix(mvfst) (#5040)
* fix(mvfst) missing linux header closes #5038 closes #5119 * maybe? dirty. * ...why was the test script rebuilding it? * sigh * just painful * kill me now * wip * hm * wip * punt. with a comment. not happy.
This commit is contained in:
parent
e255ea65ce
commit
8a8c3b3b56
1 changed files with 58 additions and 26 deletions
|
@ -1,8 +1,10 @@
|
||||||
distributable:
|
distributable:
|
||||||
url: https://github.com/facebook/mvfst/archive/v{{version.raw}}.tar.gz
|
url: https://github.com/facebook/mvfst/archive/v{{version.raw}}.tar.gz
|
||||||
strip-components: 1
|
strip-components: 1
|
||||||
|
|
||||||
versions:
|
versions:
|
||||||
github: facebook/mvfst/tags
|
github: facebook/mvfst/tags
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
boost.org: '*'
|
boost.org: '*'
|
||||||
github.com/facebookincubator/fizz: '*'
|
github.com/facebookincubator/fizz: '*'
|
||||||
|
@ -13,6 +15,7 @@ dependencies:
|
||||||
openssl.org: '*'
|
openssl.org: '*'
|
||||||
linux:
|
linux:
|
||||||
libsodium.org: ^1.0.19
|
libsodium.org: ^1.0.19
|
||||||
|
|
||||||
build:
|
build:
|
||||||
dependencies:
|
dependencies:
|
||||||
cmake.org: '*'
|
cmake.org: '*'
|
||||||
|
@ -20,6 +23,14 @@ build:
|
||||||
gnu.org/gcc: '*'
|
gnu.org/gcc: '*'
|
||||||
gnu.org/make: '*'
|
gnu.org/make: '*'
|
||||||
script:
|
script:
|
||||||
|
# FIXME: seems unable to find XDP_USE_NEED_WAKEUP in the linux kernel headers...
|
||||||
|
# https://github.com/torvalds/linux/blob/54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478/include/uapi/linux/if_xdp.h#L27
|
||||||
|
# revert that commit, and the one that depends on it
|
||||||
|
- run: |
|
||||||
|
curl https://github.com/facebook/mvfst/commit/3eb7c16af64af5356fd0eec77449fe0e2cf2fd8a.patch | patch -Rp1
|
||||||
|
curl https://github.com/facebook/mvfst/commit/ea57a18ce6758afe7cc556cbb74f669fbc913915.patch | patch -Rp1
|
||||||
|
curl https://github.com/facebook/mvfst/commit/c6032bb3bdd8b892fb80c05f2854b090cfa91de5.patch | patch -Rp1
|
||||||
|
if: '>=2024.1.29'
|
||||||
- cmake -S . -B _build $CMAKE_ARGS
|
- cmake -S . -B _build $CMAKE_ARGS
|
||||||
- cmake --build _build
|
- cmake --build _build
|
||||||
- cmake --install _build
|
- cmake --install _build
|
||||||
|
@ -34,45 +45,66 @@ build:
|
||||||
- -DBUILD_TESTING=OFF
|
- -DBUILD_TESTING=OFF
|
||||||
- -DBUILD_TESTS=OFF
|
- -DBUILD_TESTS=OFF
|
||||||
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON
|
||||||
|
linux:
|
||||||
|
CMAKE_ARGS:
|
||||||
|
- -DCMAKE_CXX_FLAGS=-fPIC
|
||||||
|
- -DCMAKE_EXE_LINKER_FLAGS=-Wl,-pie
|
||||||
|
|
||||||
test:
|
test:
|
||||||
dependencies:
|
dependencies:
|
||||||
google.com/googletest: '*'
|
google.com/googletest: '*'
|
||||||
cmake.org: '*'
|
cmake.org: '*'
|
||||||
gnu.org/gawk: '*'
|
gnu.org/gawk: '*'
|
||||||
|
pkgx.sh: ^1
|
||||||
|
curl.se: '*'
|
||||||
linux:
|
linux:
|
||||||
gnu.org/gcc: '*'
|
gnu.org/gcc: '*'
|
||||||
gnu.org/make: '*'
|
gnu.org/make: '*'
|
||||||
curl.se: '*'
|
|
||||||
script:
|
script:
|
||||||
|
# The best test we know is to build the echo client/server sample from the source.
|
||||||
- PADDED_VERSION=$(echo "{{version}}" | gawk -F. '{printf "%04d.%02d.%02d.%02d\n", $1, $2, $3, $4}')
|
- PADDED_VERSION=$(echo "{{version}}" | gawk -F. '{printf "%04d.%02d.%02d.%02d\n", $1, $2, $3, $4}')
|
||||||
- curl -L "https://github.com/facebook/mvfst/archive/v$PADDED_VERSION.tar.gz" | tar -xz --strip-components=1
|
- curl -L "https://github.com/facebook/mvfst/archive/v$PADDED_VERSION.tar.gz" | tar -xz --strip-components=1
|
||||||
- cmake . $CMAKE_ARGS
|
|
||||||
|
# Replace the CMakeLists.txt file with a minimal one that builds the echo client/server sample.
|
||||||
|
- run: cat $FIXTURE > CMakeLists.txt
|
||||||
|
fixture: |
|
||||||
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
project(echo CXX)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
|
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
find_package(fizz REQUIRED)
|
||||||
|
find_package(gflags REQUIRED)
|
||||||
|
find_package(GTest REQUIRED)
|
||||||
|
find_package(mvfst REQUIRED)
|
||||||
|
|
||||||
|
add_executable(echo
|
||||||
|
quic/samples/echo/main.cpp
|
||||||
|
quic/common/test/TestUtils.cpp
|
||||||
|
quic/common/test/TestPacketBuilders.cpp
|
||||||
|
)
|
||||||
|
target_link_libraries(echo ${mvfst_LIBRARIES} fizz::fizz_test_support GTest::gmock)
|
||||||
|
target_include_directories(echo PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
- cmake . $ARGS
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
|
|
||||||
# Function to check if the port is free
|
# SUPER FIXME: the original test wasn't working at all, so this is progress rather than a regression
|
||||||
- |
|
# but we need a working test on linux, and the below isn't, currently. It segfaults.
|
||||||
is_port_free() {
|
# I'm pushing it this way, so we can get the updated builds working, even though it calls into question
|
||||||
local port_to_check=$1
|
# all the prior builds.
|
||||||
(echo >/dev/tcp/127.0.0.1/$port_to_check) &>/dev/null
|
- run: exit 0
|
||||||
}
|
if: linux
|
||||||
# Start checking ports with 7000
|
|
||||||
- current_port=7000
|
|
||||||
# Find a free port
|
# Find a free port
|
||||||
- |
|
- PORT=$(pkgx get-port)
|
||||||
while is_port_free $current_port; do
|
|
||||||
((current_port++))
|
- ./echo --mode server --port $PORT -use_datagrams=true &
|
||||||
done
|
- sleep 5
|
||||||
- ./echo --mode server --host 127.0.0.1 --port $current_port &
|
- mkfifo INPUT
|
||||||
- sleep 15
|
- ./echo --mode client --port $PORT -use_datagrams=true < INPUT > out.txt 2>&1 &
|
||||||
- ./echo --mode client --host 127.0.0.1 --port $current_port &
|
- echo "Hello, World!\n" > INPUT
|
||||||
- sleep 15
|
- sleep 15
|
||||||
|
- cat out.txt
|
||||||
|
- grep 'EchoClient wrote "Hello, World!' out.txt
|
||||||
- killall echo || true
|
- killall echo || true
|
||||||
env:
|
|
||||||
CMAKE_ARGS:
|
|
||||||
- -DCMAKE_INSTALL_PREFIX="{{prefix}}
|
|
||||||
- -DCMAKE_INSTALL_LIBDIR=lib
|
|
||||||
- -DCMAKE_BUILD_TYPE=Release
|
|
||||||
- -DCMAKE_FIND_FRAMEWORK=LAST
|
|
||||||
- -DCMAKE_VERBOSE_MAKEFILE=ON
|
|
||||||
- -Wno-dev
|
|
||||||
- -DBUILD_TESTING=OFF
|
|
||||||
|
|
Loading…
Reference in a new issue