-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add a Freedesktop SDK based image #173
base: master
Are you sure you want to change the base?
Changes from 6 commits
a44fccc
3ae000a
b781b63
96e3cbf
2e5cae9
bffd288
a9b99bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/bst-build-test.yml' | ||
- 'buildstream/**' | ||
branches: | ||
- master | ||
push: | ||
paths: | ||
- '.github/workflows/bst-build-test.yml' | ||
- 'buildstream/**' | ||
branches-ignore: | ||
- master | ||
|
||
name: BuildStream Build Test | ||
jobs: | ||
buildstream: | ||
name: Build | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
# This action maximize the space provided by the runner which makes it more viable for BuildStream | ||
# As a volume mounted to the GitHub workspace directory | ||
- uses: easimon/maximize-build-space@v10 | ||
with: | ||
remove-dotnet: true | ||
remove-android: true | ||
remove-haskell: true | ||
remove-codeql: true | ||
remove-docker-images: true | ||
# Keep 10 GiB to have the same environment as bst-push-image.yml | ||
root-reserve-mb: 10240 | ||
|
||
- name: Install BuildStream | ||
run: | | ||
mkdir ~/.local/bin | ||
wget https://gitlab.com/BuildGrid/buildbox/buildbox-integration/-/releases/1.1.0/downloads/buildbox-x86_64-linux-gnu.tgz | ||
tar -xvzf buildbox-x86_64-linux-gnu.tgz -C ~/.local/bin | ||
rm -rf buildbox-x86_64-linux-gnu.tgz | ||
|
||
sudo apt-get install bubblewrap fuse3 git lzip patch python3 | ||
sudo apt-get install g++ python3-dev python3-pip | ||
|
||
sudo apt-get install python3-{arpy,dulwich,requests,tomli} | ||
|
||
pip3 install --user BuildStream==2.1.0 | ||
|
||
- name: Write BuildStream config | ||
# Make BuildStream use the workspace volume | ||
run: | | ||
mkdir -p ~/.config | ||
cat >> ~/.config/buildstream2.conf << EOF | ||
sourcedir: ${GITHUB_WORKSPACE}/.bst/sources | ||
cachedir: ${GITHUB_WORKSPACE}/.bst | ||
logdir: ${GITHUB_WORKSPACE}/.bst/logs | ||
EOF | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Build Image | ||
working-directory: ./buildstream | ||
run: | | ||
bst --on-error continue build oci/tooling-ghcr-flatpak.bst |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/bst-push-image.yml' | ||
- 'buildstream/**' | ||
branches: | ||
- master | ||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
name: BuildStream Push Image | ||
env: | ||
bst-filename: oci/tooling-ghcr-${{ github.repository_owner }}.bst | ||
jobs: | ||
buildstream: | ||
name: Build and Push | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
# This action maximize the space provided by the runner which makes it more viable for BuildStream | ||
# As a volume mounted to the GitHub workspace directory | ||
- uses: easimon/maximize-build-space@v10 | ||
with: | ||
remove-dotnet: true | ||
remove-android: true | ||
remove-haskell: true | ||
remove-codeql: true | ||
remove-docker-images: true | ||
# Keep 10 GiB rather than 1 to allow Podman to store an image | ||
root-reserve-mb: 10240 | ||
|
||
- name: Install BuildStream | ||
run: | | ||
mkdir ~/.local/bin | ||
wget https://gitlab.com/BuildGrid/buildbox/buildbox-integration/-/releases/1.1.0/downloads/buildbox-x86_64-linux-gnu.tgz | ||
tar -xvzf buildbox-x86_64-linux-gnu.tgz -C ~/.local/bin | ||
rm -rf buildbox-x86_64-linux-gnu.tgz | ||
|
||
sudo apt-get install bubblewrap fuse3 git lzip patch python3 | ||
sudo apt-get install g++ python3-dev python3-pip | ||
|
||
sudo apt-get install python3-{arpy,dulwich,requests,tomli} | ||
|
||
pip3 install --user BuildStream==2.1.0 | ||
|
||
- name: Write BuildStream config | ||
# Make BuildStream use the workspace volume | ||
run: | | ||
mkdir -p ~/.config | ||
cat >> ~/.config/buildstream2.conf << EOF | ||
sourcedir: ${GITHUB_WORKSPACE}/.bst/sources | ||
cachedir: ${GITHUB_WORKSPACE}/.bst | ||
logdir: ${GITHUB_WORKSPACE}/.bst/logs | ||
EOF | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Create ${{ env.bst-filename }} if not present | ||
working-directory: ./buildstream/elements | ||
run: | | ||
if [[ ! -f ${{ env.bst-filename }} ]]; then | ||
cp oci/tooling-ghcr-flatpak.bst ${{ env.bst-filename }} | ||
|
||
sed -i 's|ghcr.io/flatpak|ghcr.io/${{ github.repository_owner }}|g' ${{ env.bst-filename }} | ||
fi | ||
|
||
- name: Build Image | ||
working-directory: ./buildstream | ||
run: | | ||
bst --on-error continue build ${{ env.bst-filename }} | ||
bst --on-error continue artifact checkout ${{ env.bst-filename }} --tar image.tar | ||
podman load -i image.tar | ||
|
||
- name: Push To Registry | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: flatpak-github-actions | ||
tags: base-x86_64 | ||
registry: ghcr.io/${{ github.repository_owner }} | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ node_modules | |
.vscode | ||
package-lock.json | ||
.flatpak | ||
__pycache__ | ||
.bst |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
[default.extend-identifiers] | ||
flate2 = "flate2" | ||
|
||
[files] | ||
extend-exclude = ["**/dist/index.js"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## Test build locally | ||
|
||
### Tooling without building OCI image | ||
``` | ||
bst build tooling.bst | ||
``` | ||
|
||
### OCI image | ||
``` | ||
bst build oci/tooling-ghcr-flatpak.bst | ||
``` | ||
|
||
## Update an element with Rust crates | ||
|
||
Update the first elements source that have not cargo as kind then do following command, crates will then be updated. | ||
|
||
``` | ||
bst source track components/NAME_OF_THE_ELEMENT.bst | ||
``` | ||
|
||
## Update junctions | ||
|
||
``` | ||
bst source track freedesktop-sdk.bst | ||
bst source track gnome-build-meta.bst | ||
``` | ||
|
||
Both junctions are now update to the latest commit of their release branch | ||
|
||
### Note for future update | ||
- Freedesktop SDK can't be updated until flatpak-builder-lint supports lxml 5 | ||
|
||
## Upgrade junctions | ||
|
||
1. Check on which Freedesktop SDK branch is used by GNOME Build Meta to know if Freedesktop SDK should/can be upgraded | ||
|
||
2. Change `track` in junctions' sources to the new release branch. | ||
|
||
3. Update junctions to track the last commit | ||
|
||
4. Test build `tooling.bst` | ||
|
||
### Note for future upgrade | ||
- Check if a element in the components folder was added in Freedesktop SDK or GNOME Build Meta, if it does replace the local element by the junction | ||
- git-lfs will be an element from Freedesktop SDK in 24.08, it is actually a GNOME Build Meta element for now |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could avoid needing binfmt-support by adding a config in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Systemd services is a no-go/op in Docker There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And binfmt requires privileged access |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
kind: autotools | ||
|
||
build-depends: | ||
- freedesktop-sdk.bst:public-stacks/buildsystem-autotools.bst | ||
|
||
depends: | ||
- freedesktop-sdk.bst:components/libpipeline.bst | ||
|
||
variables: | ||
conf-local: >- | ||
--disable-upstart | ||
|
||
sources: | ||
- kind: tar | ||
url: https://download.savannah.nongnu.org/releases/binfmt-support/binfmt-support-2.2.2.tar.gz | ||
ref: cce14163f9b526283e6f0d00f3be1cfe239fa2c7574e5e0ba8ad3db74166a4a5 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be really cool to have flatpak-builder-lint in gnomeos/gnome-build-meta too! wink wink :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bad idea, the tool is too unstable to have it on gnome. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Edit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's fine, it will only be exposed in gnomeos which is building everything from main anyway. But for CI then we should have both a pinned version of the tool to avoid breaking everyone using the action, as well as installing it at runtime so we only need to bump the version in the action, not rebuild the age too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lxml 4 is still a blocker to add it to GNOME OS since its deps use lxml 5 forevery version relying on newer 23.08 or later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't work, we use patches to appstream that are only available in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A problem that should be worked on and avoid to make it worse. This PR was made before I discover, the mess that the appstream lib transition created. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, I might drop the linter in the base image (and let the deps) since upstream only support running the master branch which is not good. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I'm suggesting to drop this as it doesn't work. Upstream doesn't agree with some of the patches and at the moment it is not possible to come to a solution. Also the expectation is that Flathub raise or lower new appstream checks as per our needs - that's not possible to do without patches sometimes. ximion/appstream#604 (comment)
Also the linter doesn't do tags now, it's deployed from commits of the master branch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because you do not create your own libappstream validator with its API rather than patching their executables, I can understand that you don't have the bandwidth to do it for now… There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The API too, doesn't allow lowering severity for most tags that we want to lower, afaik and it's out of the question right now because of maintainability reasons. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fine, we can build/bundle whatever version we need for flathub There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It specifically requires the patches that live in org.flatpak.Builder package, not just a version of appstream. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea but we can match whatever the setup for that is, it's purpose built images basically for that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the patches are included then it is fine from me, otherwise without them the linter won't work at all. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
kind: manual | ||
|
||
build-depends: | ||
- freedesktop-sdk.bst:public-stacks/buildsystem-python-poetry.bst | ||
- freedesktop-sdk.bst:components/python3-pip.bst | ||
|
||
depends: | ||
- freedesktop-sdk.bst:components/python3-lxml.bst | ||
- freedesktop-sdk.bst:components/python3-requests.bst | ||
- components/python3-jsonschema.bst | ||
- components/python3-sentry-sdk.bst | ||
|
||
runtime-depends: | ||
- freedesktop-sdk.bst:components/desktop-file-utils.bst | ||
|
||
config: | ||
install-commands: | ||
- pip install --root=%{install-root} --prefix=%{prefix} . --no-build-isolation | ||
|
||
sources: | ||
- kind: git_tag | ||
url: github:flathub-infra/flatpak-builder-lint.git | ||
track: master | ||
track-tags: True | ||
ref: v2.1.5-0-g3bbf1fef98e0a419d97f927a992187ff6d725402 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
kind: meson | ||
|
||
build-depends: | ||
- freedesktop-sdk.bst:public-stacks/buildsystem-meson.bst | ||
|
||
depends: | ||
- freedesktop-sdk.bst:bootstrap-import.bst | ||
- freedesktop-sdk.bst:components/curl.bst | ||
- freedesktop-sdk.bst:components/flatpak.bst | ||
- freedesktop-sdk.bst:components/fuse3.bst | ||
- freedesktop-sdk.bst:components/json-glib.bst | ||
- freedesktop-sdk.bst:components/libsoup.bst | ||
- freedesktop-sdk.bst:components/libyaml.bst | ||
- freedesktop-sdk.bst:components/docbook-xsl.bst | ||
- freedesktop-sdk.bst:components/xmlto.bst | ||
|
||
runtime-depends: | ||
- freedesktop-sdk.bst:components/git.bst | ||
- freedesktop-sdk.bst:components/tar.bst | ||
- freedesktop-sdk.bst:components/gzip.bst | ||
- freedesktop-sdk.bst:components/zip.bst | ||
|
||
variables: | ||
meson-local: >- | ||
-Dtests=false | ||
-Dfuse=3 | ||
|
||
sources: | ||
- kind: git_repo | ||
url: github:flatpak/flatpak-builder.git | ||
# Stuck on 1.3.3, until the action is ready for 1.4 | ||
ref: 1.3.3-0-ga4d9dbc3ab3f339ee0be58e7ae7baa2b0fc721bc | ||
- kind: git_module | ||
path: subprojects/libglnx | ||
url: gnome:libglnx.git | ||
ref: 07e3e49d3e47dfd4265ffb5495111439131715ca |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto as flatpak-builder-lint probably, fits nicely with the devel tooling There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not versed on how to build this project from source, so I used a pre-built binary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In gnome, we usually build non-gnome components from tarballs or git tags anyway. We only track main for gnome components we have ownership of |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
kind: manual | ||
|
||
depends: | ||
- freedesktop-sdk.bst:bootstrap-import.bst | ||
|
||
config: | ||
install-commands: | ||
- | | ||
install -Dm755 -t "%{install-root}%{bindir}" bin/gh | ||
|
||
sources: | ||
- kind: tar | ||
url: github_files:cli/cli/releases/download/v2.40.1/gh_2.40.1_linux_amd64.tar.gz | ||
ref: 7f34ee83a7dd17addd1d029bc66ec06d91773a93172e3e1e30e0ec3a9f923fe2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
kind: pyproject | ||
|
||
build-depends: | ||
- freedesktop-sdk.bst:public-stacks/buildsystem-python-hatchling.bst | ||
- freedesktop-sdk.bst:components/python3-hatch-vcs.bst | ||
|
||
depends: | ||
- freedesktop-sdk.bst:components/python3.bst | ||
|
||
sources: | ||
- kind: pypi | ||
name: jsonschema-specifications | ||
ref: | ||
sha256sum: 48a76787b3e70f5ed53f1160d2b81f586e4ca6d1548c5de7085d1682674764cc | ||
suffix: f8/b9/cc0cc592e7c195fb8a650c1d5990b10175cf13b4c97465c72ec841de9e4b/jsonschema_specifications-2023.12.1.tar.gz |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
kind: pyproject | ||
|
||
build-depends: | ||
- freedesktop-sdk.bst:public-stacks/buildsystem-python-hatchling.bst | ||
- freedesktop-sdk.bst:components/python3-hatch-fancy-pypi-readme.bst | ||
- freedesktop-sdk.bst:components/python3-hatch-vcs.bst | ||
|
||
depends: | ||
- freedesktop-sdk.bst:components/python3-attrs.bst | ||
- components/python3-jsonschema-specifications.bst | ||
- components/python3-referencing.bst | ||
- components/python3-rpds-py.bst | ||
|
||
sources: | ||
- kind: pypi | ||
name: jsonschema | ||
ref: | ||
sha256sum: 4f614fd46d8d61258610998997743ec5492a648b33cf478c1ddc23ed4598a5fa | ||
suffix: a8/74/77bf12d3dd32b764692a71d4200f03429c41eee2e8a9225d344d91c03aff/jsonschema-4.20.0.tar.gz |
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.
We could bundle older lxml though
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.
I want to limit how much the Github Action builds since we have not much space, so no deep override on the Freedesktop junction.
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.
Freedesktop SDK 23.08 broke the Python "API" by bumping lxml 4 to lxml 5, from far it does not look like a good thing to do.
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.
If you meant side-by-side instalation, I don't how to do that with pypi sources. It really looks like it is not possible.