-
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
Conversation
85bd214 to
ccee0ab
Compare
eae670e to
27bf71f
Compare
|
This is a partial solution to automated linux packaging. |
| @@ -0,0 +1,56 @@ | |||
| #!/bin/bash | |||
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.
Consider marking this script as executable
scripts/package_linux.sh
Outdated
| mkdir -p build/package_linux/host | ||
| # /home/runner/work/dive/Qt | ||
| pushd build/package_linux/device | ||
| cmake -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \ |
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.
DRY. consider invoking build_android.sh instead to reduce the number of copies and improve maintainability
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.
build_android.sh script is quite a bit different than the scripts here. They overlap in CMake options, and that's about it.
We probably should have a cmake preset.
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.
That's a good idea
| java-version: '17' | ||
| distribution: 'temurin' | ||
| - name: Check out code | ||
| uses: actions/checkout@v3 |
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.
Update github action pinned version.
scripts/package_linux.sh
Outdated
|
|
||
| readonly DIVE_ROOT="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )/.." &> /dev/null && pwd )" | ||
|
|
||
| mkdir -p build/package_linux/device |
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.
Should this be explicitly prefixed with DIVE_ROOT for consistent behavior or did you want to allow the user to change this based on their current working directory?
scripts/package_linux.sh
Outdated
| -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=NEVER \ | ||
| -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER \ | ||
| -DDIVE_GFXR_GRADLE_CONSOLE=plain \ | ||
| ${DIVE_ROOT} || exit 1 |
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.
the exits are redundant given the set -e at the top
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -ex |
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: set -u will halt for undefined variables. This can catch if e.g. ANDROID_NDK_HOME is not set
| set -ex | |
| set -eux |
| 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" \ |
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: Given that the generator is Ninja, I don't think we need to explicitly set the make program as well
| -DCMAKE_MAKE_PROGRAM="ninja" \ |
| -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=NEVER \ | ||
| -DDIVE_GFXR_GRADLE_CONSOLE=plain \ | ||
| ${DIVE_ROOT} | ||
| cmake --build . --config=Debug -j |
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: is -j necessary with ninja? I think "all the jobs!" is the ninja default
Also since we're not using a multi-config generator, do we need --config?
| cmake --build . --config=Debug -j | |
| cmake --build . |
| cmake --build . --config Release | ||
| cmake --install . --prefix ../dive_linux --config Release |
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.
since we're not using the multi-config generator, do we need --config?
| cmake --build . --config Release | |
| cmake --install . --prefix ../dive_linux --config Release | |
| cmake --build . | |
| cmake --install . --prefix ../dive_linux |
| if(EXISTS "${DIVE_ANDROID_PREBUILT}") | ||
| install( | ||
| DIRECTORY "${DIVE_ANDROID_PREBUILT}/" | ||
| # TODO: fix device resources location. |
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.
prefer TODO with bugs so that future readers have more context
| cat build/.ninja_log | ||
| - name: Produce install artifacts | ||
| run: | | ||
| cmake --install build --prefix build/install_artifact --config Release |
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
| cmake --install build --prefix build/install_artifact --config Release | |
| cmake --install build --prefix build/install_artifact |
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
| touch build/package_linux/dive_android_is_prebuilt | ||
| bash scripts/package_linux.sh |
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.
optional: consider making dive_android_is_prebuilt an option for package_linux.sh so that it's more obvious to callers about the behavior they're going to get. It also lets the caller more easily choose behavior
| run: ls -R build/package_linux/dive_android | ||
| - name: Build | ||
| run: | | ||
| mkdir -p build/package_linux/ |
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 you downloaded build/package_linux, do you need to mkdir?
| mkdir -p build/package_linux/ |
|
a more general question, we are currently saving capture files, or even crash dump file (https://github.com/google/dive/pull/638/changes#diff-ecc0a1f137a1e178eb72d83ee5750d7f896705149afb8c3fab743c2a05e97952R106) at the same folder as executables, would that be a problem with your change since the user may not have write permission with the executable install folder? |
That's a related but separate question. We should follow platform idiom for those, e.g. probably |
No description provided.