-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build problems, segfault UT #496
Comments
Please use one of these scripts to build proxygen: As you've already noticed in #497, the build.sh installs the required dependencies including libsodium |
Hello, thanks for the answer. I managed to to get it working with getdeps.sh. But it took alot of work to figure out a way to finally get it to build (out of the proxygen source dir), without too much dirty hacking. As a user I want to be able to consume this library in an easy way. Perhaps you can understand what I do wrong by looking at my working example below. I have reduced and simplified as much as I possibly can. I made a Dockerfile to show all necessary other steps before you can start building (from a clean ubuntu:22.04). Please see the Dockerfile FROM ubuntu:22.04
# Install required dependencies
RUN apt-get update && apt-get install -y git cmake g++ curl
WORKDIR /app
# Clone the Proxygen repository
RUN git clone https://github.com/facebook/proxygen.git
RUN apt-get install python3 python3-pip -y
RUN apt-get install -y openssl libssl-dev pkg-config
RUN apt-get install -y autoconf automake libtool
# Build and install Proxygen
WORKDIR /app/proxygen
RUN ./getdeps.sh
WORKDIR /app
COPY . .
RUN mkdir build && cd build && cmake .. && make -j$(nproc)
# Note you'll need to EXPOSE ports if you want to try the server outside the container
# Set the default command to run when the container starts
CMD ["./build/server"] at https://github.com/jkammerland/proxygen-docker-example/blob/main/Dockerfile Then for the CMakeLists.txt, I have made a comment on every line I needed to add to make it work # The most minimal CMakeLists.txt file to build a proxygen server I could find
cmake_minimum_required(VERSION 3.15)
project(proxygen_server)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Needed to find proxygen-config.cmake
list(APPEND CMAKE_PREFIX_PATH "/app/proxygen/_build")
# Needed to find sodium-config.cmake
list(APPEND CMAKE_MODULE_PATH "/app/proxygen/build/fbcode_builder/CMake")
# Otherwise you will not find sodium correctly. If you install with
# package-manager as well, you get warnings...
file(GLOB SODIUM_DIR "/app/proxygen/_build/libsodium-*")
if(SODIUM_DIR)
list(APPEND CMAKE_PREFIX_PATH ${SODIUM_DIR})
else()
message(FATAL_ERROR "Sodium directory not found")
endif()
# Find required libraries, for the eche server example
find_package(proxygen CONFIG REQUIRED)
find_package(gflags REQUIRED)
find_package(zstd CONFIG REQUIRED)
find_package(folly REQUIRED)
# find_package(sodium REQUIRED) # Will not work
add_executable(server EchoServer.cpp EchoHandler.cpp)
# Link the required libraries
target_link_libraries(server PUBLIC proxygen::proxygenhttpserver gflags zstd)
# This is needed to find libzstd, Using prefix path does not work
file(GLOB ZSTD_LIB_DIR "/app/proxygen/_build/zstd-*/lib")
if(ZSTD_LIB_DIR)
target_link_directories(server PUBLIC ${ZSTD_LIB_DIR})
else()
message(FATAL_ERROR "Zstd library directory not found")
endif()
at https://github.com/jkammerland/proxygen-docker-example/blob/main/CMakeLists.txt I started trying to consume this lib through vcpkg, that also failed. I opened an issue over there too microsoft/vcpkg#38086. So I came to try to figure out how to build it myself so I can maybe create a "working" vcpkg port. Please have look and sanity check this. |
Almost impossible to build AND use, need to fix packaging or provide instructions.
Also segfault on 1 unittest on master.
E.g if you try to use the packeges after installing you simply get
0.403 Could not find a package configuration file provided by "Sodium" with any
0.403 of the following names:
0.403
0.403 SodiumConfig.cmake
0.403 sodium-config.cmake
when using find_package(proxygen REQUIRED)
after running [install.sh]
e.g when running
cmake .. -DCMAKE_PREFIX_PATH=${DEPS_PATH}
for this:
The text was updated successfully, but these errors were encountered: