Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
BartSte committed Jan 16, 2024
1 parent 284042f commit 25be353
Show file tree
Hide file tree
Showing 10 changed files with 772 additions and 31 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release

on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'

jobs:
build-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Update apt-get database
run: |
sudo apt-get update -y
sudo apt-get upgrade -y
- name: Install build dependencies
run: sudo apt-get install -y clang ninja-build git cmake llvm pkg-config

- name: Install vulkan
run: ./scripts/install-vulkan

- name: Install project dependencies
run: |
sudo apt-get install -y libboost-all-dev libspdlog-dev
- name: Install ffmpeg
run: ./scripts/install-ffmpeg

- name: Download Qt source
env:
QT_INSTALLER_JWT_TOKEN: ${{ secrets.QT_INSTALLER_JWT_TOKEN }}
run: |
mkdir /tmp/Qt
./scripts/install-qt --root /tmp/Qt qt.qt6.661.src
- name: Build Qt from source with static linking
env:
CC: gcc
CXX: g++
CXXFLAGS: -Wall
run: |
sudo apt-get install -y '^libxcb.*-dev' build-essential libgl1-mesa-dev libgles2-mesa-dev libglu1-mesa-dev libpulse-dev libqt5x11extras5 libssl-dev libssl1.0 libwayland-dev libwayland-egl1-mesa libwayland-server0 libx11-xcb-dev libxi-dev libxkbcommon-dev libxkbcommon-dev libxkbcommon-x11-dev libxrender-dev openssl
src=/tmp/Qt/6.6.1/Src
$src/configure -release -static -prefix $PWD/3rdparty/Qt -submodules qtbase,qtmultimedia,qtwayland -no-pch -no-gstreamer -- -S $src -B $src/build -Wdev -DFFMPEG_DIR=$PWD/3rdparty/ffmpeg
cmake --build $src/build
cmake --install $src/build
- name: Build project
run: |
./scripts/configure
PATH="$PWD/3rdparty/ffmpeg/lib:$PWD/3rdparty/ffmpeg/include:$PATH"
cmake --build "$PWD/build" --target package
- name: Publish
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: true
files: ./build/*.tar.gz
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
Expand All @@ -18,25 +17,26 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Update apt-get database
- name: Install build dependencies
run: |
sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get install -y clang ninja-build git cmake
- name: Install build dependencies
run: sudo apt-get install -y clang ninja-build git cmake
- name: Install vulkan
run: ./scripts/install-vulkan

- name: Install project dependencies
env:
QT_INSTALLER_JWT_TOKEN: ${{ secrets.QT_INSTALLER_JWT_TOKEN }}
run: |
sudo apt-get install -y libboost-all-dev libspdlog-dev
sudo apt-get install -y build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libpulse-dev
./scripts/install-qt
sudo apt-get install -y libboost-all-dev libspdlog-dev
sudo apt-get install -y build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libpulse-dev libwayland-dev libwayland-egl1-mesa libwayland-server0
./scripts/install-qt --root $PWD/3rdparty/Qt qt.qt6.661.gcc_64 qt.qt6.661.addons.qtmultimedia
- name: Build project
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
./scripts/configure -- -DBUILD_TESTING=ON -DCMAKE_PREFIX_PATH=$PWD/3rdparty/Qt/6.6.1/gcc_64/lib/cmake
cmake --build build
- name: Run tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Session.vim
nvim.shada
include/version.h
3rdparty/Qt
3rdparty/ffmpeg

# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
Expand Down
72 changes: 68 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# README

[![Tests](https://github.com/BartSte/snapshot/actions/workflows/tests.yml/badge.svg)](https://github.com/BartSte/snapshot/actions/workflows/tests.yml)
[![Release](https://github.com/BartSte/snapshot/actions/workflows/release.yml/badge.svg)](https://github.com/BartSte/snapshot/actions/workflows/release.yml)

> WORK IN PROGRESS!
> This project is still under development. The code is still experimental and
> is subject to change.
Expand Down Expand Up @@ -414,7 +417,41 @@ more information.
to run the app.
- [ ] Publish the directory tree as an archive as a release. Other more
sophisticated release methods can be used later.
- Issues:
- Issue FFmpeg:

- On ubuntu, the includes (headers I guess) are not included in the apt
package, in contrast to the arch package. As a solution, I build ffmpeg
from source. I build them with static linking which gives some new
issues when building the project. Now I am thinking.. I guess I have 3
options:

1. statical link ffmpeg to the project.
2. dynamically link ffmpeg to the project and include the ffmpeg libs in
the release.
3. dynamically link ffmpeg to the project and let the user install ffmpeg
themselves. This could be useful when the user needs different
versions of ffmpeg to make it work with their hardware.

On arch, I can just install static ffmpeg using AUR (its located at
/opt/ffmpeg063).

Update: I think I fixed it:

- I created the install-ffmpeg script to build ffmpeg from source. It is
installed in ./3rdparty/ffmpeg.
- After that, the -DFFMPEG_DIR=$PWD/3rdparty/ffmpeg flag is added to the
cmake command. This makes sure that the ffmpeg libs are found. This
results in:

```
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DFFMPEG_DIR=$PWD/3rdparty/ffmpeg
```
Now I hit a known bug: https://bugreports.qt.io/browse/QTBUG-115052 when
building ffmpeg statically. So, I can apply the patch that is provided
and try again.
- Issues graphics:
- On WSL I get the following error:
Expand All @@ -425,11 +462,38 @@ more information.
libEGL warning: egl: failed to create dri2 screen
```
- On ubuntu, fresh install, I get the following error:
According to bing:
```
barts@zbook:~$ ./snapshot-0.0.0-Linux/snapshot -h
1012: __vdso_timeSegmentation fault
It seems that you are encountering an error while running your Qt app on
Arch Linux with WSL. The error message you provided indicates that the
vkCreateInstance function failed with the error code
VK_ERROR_INCOMPATIBLE_DRIVER. This error is usually caused by a mismatch
between the Vulkan driver and the hardware it is running on 1.
One possible solution is to install the latest graphics drivers for your
system 2. Another possible solution is to try running the app without any
Vulkan layers at all 3.
It’s also worth noting that there is an ongoing issue with
hardware-accelerated Vulkan in WSL2 4. You may want to check if this issue
is related to your problem.
I hope this helps!
```
An idea is to check for differences in the output of `pldd` when comparing
an snapshot app that uses a dynamic Qt6 and one that uses a static Qt6. I
the past, a dynamic Qt6 worked on WSL, so it is likely that something goes
wrong during the static linking.
I think it has to do with support for the GPU. I think it is not possible
to make a stand-alone structure that support all GPU's. So it is likely to
be better that the user installs the GPU drivers themselves. I am not sure
what the best way is to do this. It does explain why the build on the
ubuntu server fails on my arch machine, but when I build it myself, it
works. This may also be the case on my WSL+arch machine when I install the
GPU drivers as is explained
[here](https://github.com/lutris/docs/blob/master/InstallingDrivers.md#amd--intel).
- [ ] Cross compile for raspberry pi
Loading

0 comments on commit 25be353

Please sign in to comment.