mirror of
https://github.com/outbackdingo/hyprcosmic-comp.git
synced 2026-08-25 14:53:22 +00:00
HyprCosmic is a fork of COSMIC, not an add-on to it, so cosmic-comp goes where a cosmic-comp goes: $(bindir)/cosmic-comp. This reverses the private $(libexecdir)/hyprcosmic layout. That bought a fallback -- both compositors on disk, both sessions bootable -- and cost coherence: a session that had to name absolute paths to find its own binary, and no answer to "which cosmic-comp is running". The fallback survives in a better form, because cosmic-session installs cosmic.desktop as well as hyprcosmic.desktop and both are now served by this binary. The consequence is stated rather than hidden: a package built from this conflicts with the distribution's cosmic-comp over /usr/bin/cosmic-comp. That is the honest relationship between two builds of the same program. libexecdir is dropped from the Makefile, having been added by this fork and used by nothing else. CI asserts the binary and both .ron defaults land at upstream's paths, and that nothing returns to the libexec directory -- a stray copy there is a second compositor that nothing runs and no uninstall removes.
160 lines
6.7 KiB
YAML
160 lines
6.7 KiB
YAML
# Build the compositor on the three distributions HyprCosmic targets.
|
|
#
|
|
# WHY THIS IS A SECOND FILE
|
|
# -------------------------
|
|
# ci.yml beside it is upstream's, and it stays untouched. It asks a different
|
|
# question -- rustfmt, clippy, and whether the feature flags still compile -- on
|
|
# a single Ubuntu runner, and none of that stops being worth asking because the
|
|
# repository was forked. Replacing it would also mean carrying a conflict into
|
|
# every rebase against pop-os/cosmic-comp, for no gain. This file is additive,
|
|
# which is the same rule the rest of the fork follows.
|
|
#
|
|
# WHY CONTAINERS RATHER THAN ONE RUNNER
|
|
# -------------------------------------
|
|
# The interesting failure is never "does Rust compile this" -- it is "does this
|
|
# distribution have a package called libseat-dev". That question cannot be asked
|
|
# from a single Ubuntu runner, so each distribution builds in its own image with
|
|
# its own package manager and its own names. A job failing here means a real
|
|
# user of that distribution could not have built it either.
|
|
#
|
|
# WHY RUSTUP AND NOT THE DISTRIBUTION'S RUST
|
|
# ------------------------------------------
|
|
# Cargo.toml asks for edition 2024 and rust-version 1.93, and rust-toolchain.toml
|
|
# pins channel 1.93 with rust-src. Debian bookworm ships rustc 1.63, so on one of
|
|
# the three targets the packaged toolchain cannot build this at all. rustup is
|
|
# what makes the three jobs comparable -- and because it reads
|
|
# rust-toolchain.toml, all three get the pinned compiler rather than whatever
|
|
# each distribution happened to freeze.
|
|
name: HyprCosmic
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
# A full matrix here is tens of minutes per distribution. Superseding a run that
|
|
# is already obsolete costs nothing and keeps a queue from forming behind it.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.distro }}
|
|
runs-on: ubuntu-latest
|
|
container: ${{ matrix.image }}
|
|
strategy:
|
|
# One distribution failing on a package name is worth seeing on its own.
|
|
# Cancelling its siblings would hide whether the break is universal or
|
|
# local to that distribution's naming, which is the whole point of the
|
|
# matrix.
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- distro: fedora
|
|
image: fedora:latest
|
|
- distro: debian
|
|
image: debian:bookworm
|
|
- distro: arch
|
|
image: archlinux:latest
|
|
|
|
steps:
|
|
# Before checkout, deliberately: actions/checkout needs git in the image,
|
|
# and these containers are bare.
|
|
#
|
|
# The library list is upstream's own, from debian/control, translated per
|
|
# distribution rather than trimmed. Four of them -- wayland, EGL,
|
|
# fontconfig and xcb -- proved unnecessary to build on a Fedora workstation
|
|
# with none of them installed, but that is a fact about one machine's
|
|
# feature flags, not a licence to drop what upstream says it needs.
|
|
- name: Install build dependencies (fedora)
|
|
if: matrix.distro == 'fedora'
|
|
run: |
|
|
dnf -y install --setopt=install_weak_deps=False \
|
|
git curl gcc gcc-c++ cmake pkgconf-pkg-config \
|
|
wayland-devel libxkbcommon-devel libinput-devel libseat-devel \
|
|
systemd-devel mesa-libgbm-devel mesa-libEGL-devel pixman-devel \
|
|
libdisplay-info-devel fontconfig-devel libxcb-devel
|
|
|
|
- name: Install build dependencies (debian)
|
|
if: matrix.distro == 'debian'
|
|
run: |
|
|
apt-get update
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
git curl ca-certificates build-essential cmake pkg-config \
|
|
libwayland-dev libxkbcommon-dev libinput-dev libseat-dev \
|
|
libsystemd-dev libudev-dev libgbm-dev libegl1-mesa-dev \
|
|
libpixman-1-dev libdisplay-info-dev libfontconfig-dev libxcb1-dev
|
|
|
|
# Arch keeps headers in the main packages rather than split -devel ones,
|
|
# so this list is shorter by construction, not by omission.
|
|
- name: Install build dependencies (arch)
|
|
if: matrix.distro == 'arch'
|
|
run: |
|
|
pacman -Syu --noconfirm --needed \
|
|
git curl base-devel cmake pkgconf \
|
|
wayland libxkbcommon libinput seatd systemd-libs mesa pixman \
|
|
libdisplay-info fontconfig libxcb
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
# --default-toolchain none, then let rust-toolchain.toml choose. Naming a
|
|
# version here would create a second place to update and a silent way for
|
|
# CI to test a compiler the project does not use.
|
|
- name: Install Rust
|
|
run: |
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
|
| sh -s -- -y --default-toolchain none --profile minimal
|
|
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Show toolchain
|
|
run: |
|
|
rustup show
|
|
cargo --version
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: ${{ matrix.distro }}
|
|
|
|
- name: Build
|
|
run: cargo build --release --locked
|
|
|
|
- name: Test
|
|
run: cargo test --release --locked
|
|
|
|
# Staged into DESTDIR so the assertions below can inspect the result
|
|
# without needing root or a live system.
|
|
- name: Install into a staging root
|
|
run: make install DESTDIR="$PWD/stage" prefix=/usr
|
|
|
|
# HyprCosmic replaces COSMIC rather than sitting beside it, so this build
|
|
# is *the* cosmic-comp on a machine that installs it and has to place
|
|
# everything upstream's does. The compositor starts without the two .ron
|
|
# defaults and then has no shortcuts and no tiling exceptions, which is a
|
|
# failure that looks like "the keyboard does nothing" rather than like a
|
|
# missing file -- worth an assertion rather than a bug report.
|
|
#
|
|
# The negative assertion is the one that would rot quietly: nothing may go
|
|
# back to the private libexec directory this fork used to install into,
|
|
# because a stray copy there is a second compositor that nothing runs and
|
|
# that no `uninstall` removes.
|
|
- name: Assert it installs as the compositor, at upstream's paths
|
|
run: |
|
|
set -eux
|
|
test -x stage/usr/bin/cosmic-comp
|
|
test -f stage/usr/share/cosmic/com.system76.CosmicSettings.Shortcuts/v1/defaults
|
|
test -f stage/usr/share/cosmic/com.system76.CosmicSettings.WindowRules/v1/tiling_exception_defaults
|
|
test ! -e stage/usr/libexec/hyprcosmic/cosmic-comp
|
|
find stage -type f -printf '%M %10s %P\n'
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: cosmic-comp-${{ matrix.distro }}
|
|
path: stage/
|
|
retention-days: 14
|