-
Notifications
You must be signed in to change notification settings - Fork 14
Debian packaging #609
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
base: main
Are you sure you want to change the base?
Debian packaging #609
Changes from all commits
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 | ||
|---|---|---|---|---|
|
|
@@ -452,3 +452,62 @@ jobs: | |||
| - name: Ninja log | ||||
| run: | | ||||
| cat build/.ninja_log | ||||
| - name: Produce install artifacts | ||||
| run: | | ||||
| cmake --install build --prefix build/install_artifact --config Release | ||||
| - name: Upload test output | ||||
| uses: actions/upload-artifact@v6 | ||||
| with: | ||||
| name: install_artifact_android | ||||
| path: | | ||||
| build/install_artifact | ||||
|
|
||||
| build_dpkg: | ||||
| name: "Build Debian Package" | ||||
| runs-on: ubuntu-24.04 | ||||
| needs: build_Android_from_Linux_Debug | ||||
| steps: | ||||
| - name: Set up Java 17 | ||||
| uses: actions/setup-java@v3 | ||||
| id: setup-java | ||||
| with: | ||||
| java-version: '17' | ||||
| distribution: 'temurin' | ||||
| - name: Check out code | ||||
| uses: actions/checkout@v3 | ||||
|
Collaborator
Author
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. Update github action pinned version. |
||||
| with: | ||||
| submodules: recursive | ||||
| - name: Install Dependencies | ||||
| run: | | ||||
| sudo apt-get update --yes | ||||
| # Build Dependencies | ||||
| sudo apt-get install --yes cmake ninja-build clang-19 python3-mako | ||||
| # Dive Dependencies | ||||
| sudo apt-get install --yes qtbase5-dev libarchive-dev libtinfo-dev | ||||
| - uses: nttld/setup-ndk@v1 | ||||
| id: setup-ndk | ||||
| with: | ||||
| ndk-version: r25 | ||||
| add-to-path: true | ||||
| - name: Download Android Artifacts | ||||
| uses: actions/download-artifact@v5 | ||||
| with: | ||||
| name: install_artifact_android | ||||
| path: build/package_linux/dive_android | ||||
| - name: Android Artifacts | ||||
| run: ls -R build/package_linux/dive_android | ||||
| - name: Build | ||||
| run: | | ||||
| mkdir -p build/package_linux/ | ||||
|
Collaborator
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. nit: since you downloaded
Suggested change
|
||||
| touch build/package_linux/dive_android_is_prebuilt | ||||
| bash scripts/package_linux.sh | ||||
|
Comment on lines
+502
to
+503
Collaborator
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. optional: consider making |
||||
| env: | ||||
| ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | ||||
| JAVA_HOME: ${{ steps.setup-java.outputs.java-home }} | ||||
| - name: Upload debian package | ||||
| uses: actions/upload-artifact@v4 | ||||
| with: | ||||
| name: package_linux | ||||
| path: | | ||||
| build/package_linux/dive_linux/ | ||||
| build/package_linux/*.deb | ||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| if(EXISTS "${DIVE_ANDROID_PREBUILT}") | ||
| install( | ||
| DIRECTORY "${DIVE_ANDROID_PREBUILT}/" | ||
| # TODO: fix device resources location. | ||
|
Collaborator
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. prefer TODO with bugs so that future readers have more context |
||
| DESTINATION "${DIVE_INSTALL_DESTINATION}/install" | ||
| ) | ||
| endif() | ||
|
|
||
| # Extra resources, e.g. private plugins | ||
| if(EXISTS "${DIVE_INSTALL_EXTRAS}") | ||
| install( | ||
| DIRECTORY "${DIVE_INSTALL_EXTRAS}/" | ||
| DESTINATION "${DIVE_INSTALL_DESTINATION}/" | ||
| ) | ||
| endif() | ||
|
|
||
| if(CMAKE_HOST_LINUX) | ||
| add_subdirectory(linux) | ||
| endif() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Dive Packaging Extra artifacts | ||
|
|
||
| Extra artifacts can be bundled with CMake build: | ||
|
|
||
| ```shell | ||
| cmake ... -DDIVE_INSTALL_EXTRAS=${EXTRA_ARTIFACT_ROOT} | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # | ||
| # Copyright 2025 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| set(CPACK_DEBIAN_PACKAGE_NAME "dive-profiler") | ||
| set(CPACK_DEBIAN_PACKAGE_MAINTAINER | ||
| "Dive Profiler Developers <dive-dev-team@google.com>" | ||
| ) | ||
| set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Dive is a GPU Profiler.") | ||
| set(CPACK_DEBIAN_PACKAGE_SECTION "devel") | ||
| set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") | ||
| set(CPACK_DEBIAN_PACKAGE_DEPENDS "") | ||
| set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
| set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/dive-profiler") | ||
|
|
||
| include(CPack) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ SRC_DIRS=( | |
| "layer" | ||
| "lrz_validator" | ||
| "network" | ||
| "packaging" | ||
| "plugins" | ||
| "runtime_layer" | ||
| "trace_stats" | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,59 @@ | ||||||||||
| #!/bin/bash | ||||||||||
|
|
||||||||||
| # Copyright 2025 Google LLC | ||||||||||
| # | ||||||||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||||||
| # you may not use this file except in compliance with the License. | ||||||||||
| # You may obtain a copy of the License at | ||||||||||
| # | ||||||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||
| # | ||||||||||
| # Unless required by applicable law or agreed to in writing, software | ||||||||||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||||||||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||||||
| # See the License for the specific language governing permissions and | ||||||||||
| # limitations under the License. | ||||||||||
|
|
||||||||||
| set -ex | ||||||||||
|
Collaborator
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. nit:
Suggested change
|
||||||||||
|
|
||||||||||
| readonly DIVE_ROOT="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )" | ||||||||||
| readonly DIVE_BUILD_ROOT="${DIVE_BUILD_ROOT:-build}" | ||||||||||
| mkdir -p "${DIVE_BUILD_ROOT}/package_linux/device" | ||||||||||
| mkdir -p "${DIVE_BUILD_ROOT}/package_linux/host" | ||||||||||
|
|
||||||||||
| if [ ! -e "${DIVE_BUILD_ROOT}/package_linux/dive_android_is_prebuilt" ]; then | ||||||||||
| pushd "${DIVE_BUILD_ROOT}/package_linux/device" | ||||||||||
| cmake -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \ | ||||||||||
| -G "Ninja" \ | ||||||||||
| -DCMAKE_MAKE_PROGRAM="ninja" \ | ||||||||||
|
Collaborator
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. nit: Given that the generator is Ninja, I don't think we need to explicitly set the make program as well
Suggested change
|
||||||||||
| -DCMAKE_BUILD_TYPE=Debug \ | ||||||||||
| -DCMAKE_SYSTEM_NAME=Android \ | ||||||||||
| -DANDROID_ABI=arm64-v8a \ | ||||||||||
| -DANDROID_PLATFORM=android-26 \ | ||||||||||
| -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER \ | ||||||||||
| -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER \ | ||||||||||
| -DDIVE_GFXR_GRADLE_CONSOLE=plain \ | ||||||||||
| ${DIVE_ROOT} | ||||||||||
| cmake --build . --config=Debug -j | ||||||||||
|
Collaborator
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. nit: is Also since we're not using a multi-config generator, do we need
Suggested change
|
||||||||||
| cmake --install . --prefix ../dive_android | ||||||||||
| popd | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| pushd "${DIVE_BUILD_ROOT}/package_linux/host" | ||||||||||
| cmake -G "Ninja" \ | ||||||||||
| -DCMAKE_BUILD_TYPE=Release \ | ||||||||||
| -DDIVE_ANDROID_PREBUILT="`pwd`/../dive_android" \ | ||||||||||
| -DDIVE_INSTALL_EXTRAS="${DIVE_ROOT}/packaging/extras-example" \ | ||||||||||
| -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang-19 \ | ||||||||||
| -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++-19 \ | ||||||||||
| ${DIVE_ROOT} | ||||||||||
| cmake --build . --config Release | ||||||||||
| cmake --install . --prefix ../dive_linux --config Release | ||||||||||
|
Comment on lines
+50
to
+51
Collaborator
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. since we're not using the multi-config generator, do we need
Suggested change
|
||||||||||
| cpack -G DEB | ||||||||||
| popd | ||||||||||
|
|
||||||||||
| pushd "${DIVE_BUILD_ROOT}/package_linux" | ||||||||||
| cp host/*.deb . | ||||||||||
| dpkg -I *.deb | ||||||||||
| dpkg -c *.deb | ||||||||||
| popd | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since we're not using the multi-config genreator, do we need --config? Also, this is a debug build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be updated according to #679