Skip to content

Commit

Permalink
Debug protobufs build
Browse files Browse the repository at this point in the history
- The GO_ENABLED option was disabled when building through the
  external project in the main listfile, despite having been set
  to TRUE when the option was defined. On inspection, it turned
  out that ALL the options were FALSE. cmake apparently does not
  apply the defaults when the build is done as an external project.
  Changed them to ordinary cache variables, and voila! All is
  right with the world. Pfui.

- Modify the GitHub workflow to upload the protobuf tarballs as
  artifacts.

- Modify .gitignore to ignore `build` and `install` directories
  anywhere in the tree, not just the root.

- Rename the install directory from `proto` to `protobufs`.

Signed-off-by: Derek G Foster <[email protected]>
  • Loading branch information
ffoulkes committed Nov 5, 2023
1 parent 8210b76 commit e10af2e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ jobs:
export SDE_INSTALL=$SDE_INSTALL_DIR
./make-all.sh --target=dpdk --rpath
- name: Upload protobufs
working-directory: recipe
uses: actions/upload-artifact@v3
with:
name: protobufs
path: install/share/protobufs/*.tar.gz

#---------------------------------------------------------------------
# 2-krnlmon_unit_tests
#---------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.vscode
.vslick
/build
/install
build
install
10 changes: 7 additions & 3 deletions protobufs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
include(../cmake/StratumDependencies.cmake)
endif()

option(GO_ENABLED TRUE "Compile protobufs for Go")
option(GRPC_OUT_ENABLED False "Generate grpc_out directory")
option(WHEEL_ENABLED FALSE "Generate Python wheel")
set(GO_ENABLED TRUE CACHE BOOL "Compile protobufs for Go")
set(GRPC_OUT_ENABLED FALSE CACHE BOOL "Generate grpc_out directory")
set(WHEEL_ENABLED FALSE CACHE BOOL "Generate Python wheel")

cmake_print_variables(GO_ENABLED)
cmake_print_variables(GRPC_OUT_ENABLED)
cmake_print_variables(WHEEL_ENABLED)

set(CPP_OUT ${CMAKE_BINARY_DIR}/cpp_out CACHE PATH "C++ protobuf files")
file(MAKE_DIRECTORY ${CPP_OUT})
Expand Down
2 changes: 1 addition & 1 deletion protobufs/tarballs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ install(
${CMAKE_CURRENT_BINARY_DIR}/${py_tarball_name}
${go_tarball}
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/stratum/proto
${CMAKE_INSTALL_DATAROOTDIR}/stratum/protobufs
)

if(WHEEL_ENABLED)
Expand Down

0 comments on commit e10af2e

Please sign in to comment.