-
Notifications
You must be signed in to change notification settings - Fork 25
produce .deb with cpack #165
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
Changes from 7 commits
da72d8b
1d6bba7
40be3cb
2bbd119
e36a88d
82c5fb2
e7aa793
8f501a5
60550da
b6b1da2
c6a3cf7
6c73a95
70bacb1
82b6883
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
on: | ||
push: | ||
|
||
env: | ||
CMAKE_VERSION: 3.27.4 | ||
|
||
jobs: | ||
build-deb: | ||
strategy: | ||
matrix: | ||
include: | ||
- container: debian:bookworm | ||
label: bookworm-aarch64 | ||
runs-on: buildjet-4vcpu-ubuntu-2204-arm | ||
- container: debian:bookworm | ||
label: bookworm-x86_64 | ||
runs-on: buildjet-4vcpu-ubuntu-2204 | ||
container: ${{ matrix.container }} | ||
runs-on: ${{ matrix.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: depends | ||
run: | | ||
apt-get update | ||
apt-get install -qqy \ | ||
build-essential \ | ||
libabsl-dev \ | ||
libboost-all-dev \ | ||
libgrpc++-dev \ | ||
libprotobuf-dev \ | ||
pkg-config \ | ||
ninja-build \ | ||
protobuf-compiler-grpc \ | ||
git \ | ||
wget | ||
- name: download cmake | ||
run: | | ||
ARCH=$(uname -m) | ||
wget --quiet https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-$ARCH.sh | ||
chmod +x cmake-${CMAKE_VERSION}-linux-$ARCH.sh | ||
./cmake-${CMAKE_VERSION}-linux-$ARCH.sh --skip-license --prefix=/usr | ||
- name: remove examples | ||
run: sed -i '/add_subdirectory.examples/d' src/viam/CMakeLists.txt | ||
- name: create build | ||
run: mkdir build | ||
- name: cmake | ||
working-directory: ./build | ||
run: cmake .. -G Ninja | ||
- name: build | ||
working-directory: ./build | ||
run: ninja libviamsdk.so && cpack | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe better to use
Also, do you need to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: debian-${{ matrix.label }} | ||
path: build/viam-cpp-sdk-*.deb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does the complete list of debs that gets made for a given matrix entry look like right now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. single .deb for viam-cpp-sdk
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
prefix=/usr | ||
abe-winter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
base_includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ | ||
deep_includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/viam/api | ||
|
@@ -7,7 +7,6 @@ Name: @PROJECT_NAME@-libapi | |
Description: @PROJECT_DESCRIPTION@ | ||
URL: @PROJECT_HOMEPAGE_URL@ | ||
Version: @PROJECT_VERSION@ | ||
Requires: gRPC++ >= @VIAMCPPSDK_GRPCXX_VERSION@ protobuf >= @VIAMCPPSDK_PROTOBUF_VERSION@ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, these need to remain. Otherwise, projects using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just read your comment that said "remove Requires line -- it adds like a minute of CPU-bound processing inside the consumer's cmake config". I don't see how that could be true. These files aren't consumed by cmake, only by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. example run with
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see. But why are you using |
||
Libs: -L${libdir} -L@Boost_LIBRARY_DIRS@ -lviamapi | ||
Cflags: -I${base_includedir} -I${deep_includedir} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,3 +249,10 @@ install(FILES | |
|
||
|
||
add_subdirectory(tests) | ||
|
||
set(CPACK_GENERATOR "DEB") | ||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) | ||
set(CPACK_COMPONENTS_ALL viam-cpp-sdk_dev) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this should be using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
roles = development vs runtime? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, typically on a deb based platform, a library ships at least three packages:
|
||
set(CPACK_PACKAGE_CONTACT "[email protected]") | ||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libprotobuf-dev, libgrpc++-dev") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This list looks pretty incomplete. We definitely have dependencies on other development libraries. Also, I'd be hoping to see a split between dependencies required for build, for runtime, and for development. Does cpack let us express those? I'd also be interested to know if cpack has any ability to auto-detect these package dependencies rather than requiring us to explicitly enumerate them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the viam-cpp-sdk .deb is a development library; we'll presumably give it a -dev suffix if we release. we're not creating a runtime library yet I think. given that, are -dev deps okay for now? This change would generate deps automatically ... in theory: -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libprotobuf-dev, libgrpc++-dev")
+set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
+set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) But it detects runtime deps instead of -dev libraries:
My downstream module fails with:
added libboost-log-dev in 82b6883 |
||
include(CPack) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
prefix=/usr | ||
abe-winter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ | ||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ | ||
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/viam/sdk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why this was changed. The |
||
|
||
Name: @PROJECT_NAME@-libviamsdk | ||
Description: @PROJECT_DESCRIPTION@ | ||
URL: @PROJECT_HOMEPAGE_URL@ | ||
Version: @PROJECT_VERSION@ | ||
Requires: gRPC++ >= @VIAMCPPSDK_GRPCXX_VERSION@ protobuf >= @VIAMCPPSDK_PROTOBUF_VERSION@ @PROJECT_NAME@-libviamapi >= @PROJECT_VERSION@ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Libs: -L${libdir} -L@Boost_LIBRARY_DIRS@ -lviamsdk -lviam_rust_utils | ||
Libs.private: -lboost_log-mt | ||
Cflags: -I${includedir} -I@Boost_INCLUDE_DIR@ |
Uh oh!
There was an error while loading. Please reload this page.