Skip to content

Commit

Permalink
Fix librest
Browse files Browse the repository at this point in the history
The conditioning stage wasn't dependent on librest, so it could
be done before, thus not "fixing" the .pc files of librest.

Also, this PR adds a tool to check dependencies, a tool to check
them, and an automated test for github.
  • Loading branch information
sergio-costas committed Sep 19, 2024
1 parent f5b9e0e commit ce63026
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/check-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test-dependencies
on:
pull_request:
push:
branches:
- gnome-46-2404-sdk

jobs:
check-deps:
runs-on: ubuntu-latest
container:
image: ubuntu:rolling
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies (Ubuntu)
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3 python3-yaml
- name: Verify dependencies
run: |
tools/check_dependencies.py
2 changes: 1 addition & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ parts:
done
debs:
after: [ libgnome-games-support, libadwaita, libgweather, libayatana-appindicator, libsoup3 ]
after: [ libgnome-games-support, libadwaita, libgweather, libayatana-appindicator, libsoup3, librest, buildenv, at-spi2-core, webp-pixbuf-loader ]
plugin: nil
stage-packages:
- appstream
Expand Down
43 changes: 43 additions & 0 deletions tools/check_dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env python3

import os
import sys
import yaml

# Ensure that "deb" part depends on all previous parts

config_file = "snapcraft.yaml"
if not os.path.exists(config_file):
config_file = os.path.join("snap", "snapcraft.yaml")

data = yaml.safe_load(open(config_file, "r"))

parts = {}

for part in data['parts']:
if part == "debs":
break
parts[part] = False

def filldeps(part):
global data
global parts
if 'after' not in data['parts'][part]:
return

deps = data['parts'][part]['after']
for dep in deps:
parts[dep] = True
filldeps(dep)

filldeps("debs")
failed = False
for part in parts:
if parts[part]:
continue
print(f"DEBS must depend on {part}")
failed = True

if failed:
sys.exit(1)
print("All dependencies are correct")

0 comments on commit ce63026

Please sign in to comment.