Skip to content

Commit

Permalink
Fix BUCK2 build for Ubuntu (#143)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #143

Reviewed By: bigfootjon

Differential Revision: D59869094

Pulled By: namanahuja

fbshipit-source-id: 3a2f996f500503d2c7fe1b58a0661f6933358125
  • Loading branch information
namanahuja authored and facebook-github-bot committed Jul 18, 2024
1 parent b575f2f commit 92433cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/oss-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ jobs:
ubuntu-os-buck-build-and-test:
needs: get-toolchains-to-install
runs-on: ubuntu-latest
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/tools/liboqs/build/src:${{ github.workspace }}/.github
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- run: sudo apt-get update
shell: bash
- uses: facebook/install-dotslash@latest
- name: Install Rust toolchain
if: needs.get-toolchains-to-install.outputs.uses_rust == 'true'
Expand All @@ -126,6 +126,25 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install ubuntu deps
run: |
BUCK_GRAPH=$(./buck2 cquery "attrregexfilter(labels, 'third-party:ubuntu:', deps(//fizz/...))" --json --output-attribute=labels)
UBUNTU_PACKAGES=$(echo $BUCK_GRAPH | jq '[.[] | .labels] | flatten | unique | map(select(contains("third-party:ubuntu:")) | sub("third-party:ubuntu:"; "")) | .[] | @text')
echo $UBUNTU_PACKAGES | xargs sudo apt-get install -y
- run: |
sudo apt-get update
sudo apt install -y libfmt-dev libdouble-conversion-dev
- name: Checkout liboqs
uses: actions/checkout@v4
with:
repository: open-quantum-safe/liboqs
path: tools/liboqs
- name: Setup liboqs
run: |
sudo apt install astyle cmake gcc ninja-build libssl-dev python3-pytest python3-pytest-xdist unzip xsltproc doxygen graphviz python3-yaml valgrind
cd tools/liboqs
mkdir build && cd build
cmake -GNinja ..
- name: buck2 build and test
run: bash oss_buck_build_and_test.sh
windows-os-buck-build-and-test:
Expand Down
14 changes: 1 addition & 13 deletions fizz/CMakeListsForBuck2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/fizz/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
# for in-fbsource builds
"${CMAKE_CURRENT_SOURCE_DIR}/../opensource/fbcode_builder/CMake"
# For shipit-transformed builds
Expand Down Expand Up @@ -53,9 +54,6 @@ find_package(Glog REQUIRED)
find_package(DoubleConversion REQUIRED)
find_package(Threads REQUIRED)
find_package(Zstd REQUIRED)
if (UNIX AND NOT APPLE)
find_package(Librt)
endif()

include(CheckAtomic)

Expand Down Expand Up @@ -87,16 +85,6 @@ endif()

find_package(ZLIB REQUIRED)

find_package(Libevent CONFIG QUIET)
if(TARGET event)
message(STATUS "Found libevent from package config")
list(APPEND FIZZ_SHINY_DEPENDENCIES event)
else()
find_package(Libevent MODULE REQUIRED)
list(APPEND FIZZ_LINK_LIBRARIES ${LIBEVENT_LIB})
list(APPEND FIZZ_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR})
endif()

find_package(liboqs CONFIG)
if (liboqs_FOUND)
set(FIZZ_HAVE_OQS TRUE)
Expand Down

0 comments on commit 92433cd

Please sign in to comment.