Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feat/suppress-liv…
Browse files Browse the repository at this point in the history
…e-on-start
  • Loading branch information
Nerixyz committed Jun 25, 2024
2 parents 29daaf2 + 7bfb5ac commit fab3ac9
Show file tree
Hide file tree
Showing 172 changed files with 5,165 additions and 1,330 deletions.
2 changes: 1 addition & 1 deletion .CI/build-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $VCRTVersion = (Get-Item "$Env:VCToolsRedistDir\vc_redist.x64.exe").VersionInfo;
ISCC `
/DWORKING_DIR="$($pwd.Path)\" `
/DINSTALLER_BASE_NAME="$installerBaseName" `
/DSHIPPED_VCRT_BUILD="$($VCRTVersion.FileBuildPart)" `
/DSHIPPED_VCRT_MINOR="$($VCRTVersion.FileMinorPart)" `
/DSHIPPED_VCRT_VERSION="$($VCRTVersion.FileDescription)" `
$defines `
/O. `
Expand Down
6 changes: 3 additions & 3 deletions .CI/chatterino-installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ begin
Result := VCRTVersion + ' is installed';
end;
// Checks if a new VCRT is needed by comparing the builds.
// Checks if a new VCRT is needed by comparing the minor version (the major one is locked at 14).
function NeedsNewVCRT(): Boolean;
var
VCRTBuild: Cardinal;
begin
Result := True;
if RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Bld', VCRTBuild) then
if RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Minor', VCRTBuild) then
begin
if VCRTBuild >= {#SHIPPED_VCRT_BUILD} then
if VCRTBuild >= {#SHIPPED_VCRT_MINOR} then
Result := False;
end;
end;
30 changes: 30 additions & 0 deletions .CI/deploy-crt.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
param (
[string] $InstallDir = "Chatterino2"
)

if ($null -eq $Env:VCToolsRedistDir) {
Write-Error "VCToolsRedistDir is not set. Forgot to set Visual Studio environment variables?";
exit 1
}

# A path to the runtime libraries (e.g. "$Env:VCToolsRedistDir\onecore\x64\Microsoft.VC143.CRT")
$vclibs = (Get-ChildItem "$Env:VCToolsRedistDir\onecore\x64" -Filter '*.CRT')[0].FullName;

# All executables and libraries in the installation directory
$targets = Get-ChildItem -Recurse -Include '*.dll', '*.exe' $InstallDir;
# All dependencies of the targets (with duplicates)
$all_deps = $targets | ForEach-Object { (dumpbin /DEPENDENTS $_.FullName) -match '^(?!Dump of).+\.dll$' } | ForEach-Object { $_.Trim() };
# All dependencies without duplicates
$dependencies = $all_deps | Sort-Object -Unique;

$n_deployed = 0;
foreach ($dll in $dependencies) {
Write-Output "Checking for $dll";
if (Test-Path -PathType Leaf "$vclibs\$dll") {
Write-Output "Deploying $dll";
Copy-Item "$vclibs\$dll" "$InstallDir\$dll" -Force;
$n_deployed++;
}
}

Write-Output "Deployed $n_deployed libraries";
3 changes: 2 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ freebsd_instance:

task:
install_script:
- pkg install -y boost-libs git qt5-buildtools qt5-concurrent qt5-core qt5-multimedia qt5-svg qtkeychain-qt5 qt5-qmake cmake qt5-linguist
- pkg install -y boost-libs git qt6-base qt6-svg qt6-5compat qt6-imageformats qtkeychain-qt6 cmake
script: |
git submodule init
git submodule update
Expand All @@ -20,6 +20,7 @@ task:
-DUSE_SYSTEM_QTKEYCHAIN="ON" \
-DCMAKE_BUILD_TYPE="release" \
-DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \
-DBUILD_WITH_QT6="ON" \
..
cat compile_commands.json
make -j $(getconf _NPROCESSORS_ONLN)
4 changes: 3 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ Checks: "-*,
-readability-magic-numbers,
-performance-noexcept-move-constructor,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-cppcoreguidelines-non-private-member-variables-in-classes,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-readability-identifier-length,
-readability-function-cognitive-complexity,
-bugprone-easily-swappable-parameters,
-cert-err58-cpp,
-modernize-avoid-c-arrays
-modernize-avoid-c-arrays,
-misc-include-cleaner
"
CheckOptions:
- key: readability-identifier-naming.ClassCase
Expand Down
54 changes: 12 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ jobs:
submodules: recursive
fetch-depth: 0 # allows for tags access

- name: Fix git permission error
run: |
git config --global --add safe.directory '*'
- name: Build
run: |
mkdir build
Expand Down Expand Up @@ -120,7 +124,7 @@ jobs:
skip-crashpad: false
# Windows
- os: windows-latest
qt-version: 6.5.0
qt-version: 6.7.1
force-lto: false
plugins: true
skip-artifact: false
Expand Down Expand Up @@ -150,35 +154,15 @@ jobs:

- name: Install Qt5
if: startsWith(matrix.qt-version, '5.')
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
version: ${{ matrix.qt-version }}

- name: Install Qt 6.5.3 imageformats
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/[email protected]
with:
cache: false
modules: qtimageformats
set-env: false
version: 6.5.3
extra: --noarchives

- name: Find Qt 6.5.3 Path
if: startsWith(matrix.qt-version, '6.') && startsWith(matrix.os, 'windows')
shell: pwsh
id: find-good-imageformats
run: |
cd "$Env:RUNNER_WORKSPACE/Qt/6.5.3"
cd (Get-ChildItem)[0].Name
cd plugins/imageformats
echo "PLUGIN_PATH=$(pwd)" | Out-File -Path "$Env:GITHUB_OUTPUT" -Encoding ASCII
- name: Install Qt6
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down Expand Up @@ -271,14 +255,9 @@ jobs:
cd build
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
cp bin/chatterino.exe Chatterino2/
..\.CI\deploy-crt.ps1 Chatterino2
echo nightly > Chatterino2/modes
- name: Fix Qt6 (windows)
if: startsWith(matrix.qt-version, '6.') && startsWith(matrix.os, 'windows')
working-directory: build
run: |
cp ${{ steps.find-good-imageformats.outputs.PLUGIN_PATH }}/qwebp.dll Chatterino2/imageformats/qwebp.dll
- name: Package (windows)
if: startsWith(matrix.os, 'windows')
working-directory: build
Expand Down Expand Up @@ -360,15 +339,15 @@ jobs:

# Windows
- uses: actions/download-artifact@v4
name: Windows Qt6.5.0
name: Windows Qt6.7.1
with:
name: chatterino-windows-x86-64-Qt-6.5.0.zip
name: chatterino-windows-x86-64-Qt-6.7.1.zip
path: release-artifacts/

- uses: actions/download-artifact@v4
name: Windows Qt6.5.0 symbols
name: Windows Qt6.7.1 symbols
with:
name: chatterino-windows-x86-64-Qt-6.5.0-symbols.pdb.7z
name: chatterino-windows-x86-64-Qt-6.7.1-symbols.pdb.7z
path: release-artifacts/

- uses: actions/download-artifact@v4
Expand Down Expand Up @@ -401,18 +380,9 @@ jobs:
cp .CI/chatterino-nightly.flatpakref release-artifacts/
shell: bash

# macOS
- uses: actions/download-artifact@v4
name: macOS x86_64 Qt5.15.2 dmg
with:
name: chatterino-macos-Qt-5.15.2.dmg
path: release-artifacts/

- name: Rename artifacts
run: |
ls -l
# Rename the macos build to indicate that it's for macOS 10.15 users
mv chatterino-macos-Qt-5.15.2.dmg Chatterino-macOS-10.15.dmg
# Mark all Windows Qt5 builds as old
mv chatterino-windows-x86-64-Qt-5.15.2.zip chatterino-windows-old-x86-64-Qt-5.15.2.zip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Install Qt6
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand All @@ -40,7 +40,7 @@ jobs:

- name: clang-tidy review
timeout-minutes: 20
uses: ZedThree/clang-tidy-review@v0.18.0
uses: ZedThree/clang-tidy-review@v0.19.0
with:
build_dir: build-clang-tidy
config_file: ".clang-tidy"
Expand All @@ -62,4 +62,4 @@ jobs:
libxkbcommon-x11-0, libxcb-xkb-dev, libxcb-cursor0
- name: clang-tidy-review upload
uses: ZedThree/clang-tidy-review/upload@v0.18.0
uses: ZedThree/clang-tidy-review/upload@v0.19.0
4 changes: 2 additions & 2 deletions .github/workflows/create-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
qt-version: ["6.5.0"]
qt-version: ["6.7.1"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # allows for tags access

- name: Download artifact
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
name: chatterino-windows-x86-64-Qt-${{ matrix.qt-version }}.zip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}

steps:
- uses: ZedThree/clang-tidy-review/post@v0.18.0
- uses: ZedThree/clang-tidy-review/post@v0.19.0
with:
lgtm_comment_body: ""
num_comments_as_exitcode: false
2 changes: 1 addition & 1 deletion .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
fetch-depth: 0 # allows for tags access

- name: Install Qt
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
qt-version: [5.15.2, 6.5.0]
qt-version: [5.15.2, 6.7.1]
plugins: [false]
skip-artifact: [false]
skip-crashpad: [false]
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
fetch-depth: 0 # allows for tags access

- name: Install Qt
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down Expand Up @@ -105,6 +105,12 @@ jobs:
--output-folder=. `
-o with_openssl3="$Env:C2_USE_OPENSSL3"
# The Windows runners currently use an older version of the CRT
- name: Install CRT
run: |
mkdir -Force build-test/bin
cp "$((ls $Env:VCToolsRedistDir/onecore/x64 -Filter '*.CRT')[0].FullName)/*" build-test/bin
- name: Build
run: |
cmake `
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@
[submodule "tools/crash-handler"]
path = tools/crash-handler
url = https://github.com/Chatterino/crash-handler
[submodule "lib/expected-lite"]
path = lib/expected-lite
url = https://github.com/martinmoene/expected-lite
12 changes: 6 additions & 6 deletions BUILDING_ON_FREEBSD.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# FreeBSD

Note on Qt version compatibility: If you are installing Qt from a package manager, please ensure the version you are installing is at least **Qt 5.12 or newer**.
For all dependencies below we use Qt 6. Our minimum supported version is Qt 5.15.2, but you are on your own.

## FreeBSD 12.1-RELEASE
## FreeBSD 14.0-RELEASE

Note: This is known to work on FreeBSD 12.1-RELEASE amd64. Chances are
Note: This is known to work on FreeBSD 14.0-RELEASE amd64. Chances are
high that this also works on older FreeBSD releases, architectures and
FreeBSD 13.0-CURRENT.
FreeBSD 15.0-SNAP.

1. Install build dependencies from package sources (or build from the
ports tree): `# pkg install qt5-core qt5-multimedia qt5-svg qt5-buildtools gstreamer-plugins-good boost-libs rapidjson cmake`
ports tree): `# pkg install boost-libs git qt6-base qt6-svg qt6-5compat qt6-imageformats qtkeychain-qt6 cmake`
1. In the project directory, create a build directory and enter it
```sh
mkdir build
cd build
```
1. Generate build files. To enable Lua plugins in your build add `-DCHATTERINO_PLUGINS=ON` to this command.
```sh
cmake ..
cmake -DBUILD_WITH_QT6=ON ..
```
1. Build the project
```sh
Expand Down
8 changes: 4 additions & 4 deletions BUILDING_ON_LINUX.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Linux

For all dependencies below we use Qt6. Our minimum supported version is Qt5.15, but you are on your own.
For all dependencies below we use Qt 6. Our minimum supported version is Qt 5.15.2, but you are on your own.

## Install dependencies

### Ubuntu

Building on Ubuntu requires Docker.

Use https://github.com/Chatterino/docker/pkgs/container/chatterino2-build-ubuntu-20.04 as your base if you're on Ubuntu 20.04.
Use <https://github.com/Chatterino/docker/pkgs/container/chatterino2-build-ubuntu-20.04> as your base if you're on Ubuntu 20.04.

Use https://github.com/Chatterino/docker/pkgs/container/chatterino2-build-ubuntu-22.04 if you're on Ubuntu 22.04.
Use <https://github.com/Chatterino/docker/pkgs/container/chatterino2-build-ubuntu-22.04> if you're on Ubuntu 22.04.

The built binary should be exportable from the final image & able to run on your system assuming you perform a static build. See our [build.yml github workflow file](.github/workflows/build.yml) for the cmake line used for Ubuntu builds.
The built binary should be exportable from the final image & able to run on your system assuming you perform a static build. See our [build.yml GitHub workflow file](.github/workflows/build.yml) for the CMake line used for Ubuntu builds.

### Debian 12 (bookworm) or later

Expand Down
2 changes: 1 addition & 1 deletion BUILDING_ON_MAC.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Building on macOS

Chatterino2 is built in CI on Intel on macOS 12.
Chatterino2 is built in CI on Intel on macOS 13.
Local dev machines for testing are available on Apple Silicon on macOS 13.

## Installing dependencies
Expand Down
Loading

0 comments on commit fab3ac9

Please sign in to comment.