Skip to content

Fix flatpak packaging to a working state - #6678

Merged
mitchellh merged 9 commits into
ghostty-org:mainfrom
alaviss:push-qwtptnnownso
Apr 22, 2025
Merged

Fix flatpak packaging to a working state#6678
mitchellh merged 9 commits into
ghostty-org:mainfrom
alaviss:push-qwtptnnownso

Conversation

@alaviss

@alaviss alaviss commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

This should make testing Flatpak builds a lot easier.

To build, enter flatpak/ directory and run:

flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

flatpak run -p org.flatpak.Builder \
  --repo=repo \
  builddir \
  com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.

@alaviss
alaviss requested a review from a team as a code owner March 12, 2025 08:54
Comment thread flatpak/com.mitchellh.ghostty.yml Outdated
Comment thread flatpak/com.mitchellh.ghostty.yml Outdated
Comment thread flatpak/com.mitchellh.ghostty.yml Outdated
Comment thread dist/linux/com.mitchellh.ghostty.metainfo.xml Outdated
Comment thread flatpak/com.mitchellh.ghostty.yml Outdated
Comment thread flatpak/com.mitchellh.ghostty.Devel.yml Outdated
@alaviss
alaviss force-pushed the push-qwtptnnownso branch from f4c1020 to 3284ae5 Compare March 12, 2025 22:24
Comment thread dist/linux/com.mitchellh.ghostty.metainfo.xml Outdated
Comment thread flatpak/dependencies.yml Outdated
@alaviss alaviss mentioned this pull request Mar 15, 2025
@alaviss
alaviss force-pushed the push-qwtptnnownso branch from 0be3824 to 7276f07 Compare March 15, 2025 02:58
@alaviss

alaviss commented Mar 15, 2025

Copy link
Copy Markdown
Contributor Author

Rebased to Zig 0.14.0.

Due to #6734 and #6733, flatpak-builder will not be able to build Ghostty at the moment.

@alaviss
alaviss force-pushed the push-qwtptnnownso branch 3 times, most recently from 7fdbf01 to a037432 Compare March 16, 2025 18:05
@alaviss

alaviss commented Mar 16, 2025

Copy link
Copy Markdown
Contributor Author

Rebased to main, flatpak build is now fully functional.

Comment on lines 43 to 51

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isnt enforced by the flathub review process. At least I havent ran into this at all when publishing flatpak manifests to Flathub

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds like a requirement if you're publishing straight from here to Flathub, though. At least I see that Firefox and OBS are following it.

@mitchellh

Copy link
Copy Markdown
Contributor

I'm trying to verify this so we can get it merged but I'm getting build errors locally:

Cache miss, checking out last cache hit
========================================================================
Building module ghostty in /home/mitchellh/code/go/src/github.com/ghostty-org/ghostty/flatpak/.flatpak-builder/build/ghostty-2
========================================================================
Updated Git hooks.
Git LFS initialized.
Note: switching to '4182b7fa42f27cf14a71dbdb54cfd82c5c6e3447'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 4182b7f switch zigimg ref to merged commit
Updated Git hooks.
Git LFS initialized.
Note: switching to '4a002763419a34d61dcbb1f415821b83b9bf8ddc'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 4a00276 Merge pull request 'fix removed b.host on v0.14.0-dev.2568+42dac40b3' (#25) from e0328eric/zg:master into master
Updated Git hooks.
Git LFS initialized.
fatal: unable to read tree (0ce4eca3560d5553b13263d6b6bb72e146dd43d0)
Error: module ghostty: Child process exited with code 128

Any ideas?

@alaviss

alaviss commented Mar 19, 2025

Copy link
Copy Markdown
Contributor Author

fatal: unable to read tree (0ce4eca3560d5553b13263d6b6bb72e146dd43d0)

Looks like it's zigimg again.

They force pushed their master branch so now the commit referenced is unreachable from default branch.

Maybe I'll have to fix the cache gen script to prefer downloading archives instead...

@alaviss
alaviss force-pushed the push-qwtptnnownso branch from a037432 to 7e387a6 Compare March 21, 2025 07:19
@alaviss

alaviss commented Mar 21, 2025

Copy link
Copy Markdown
Contributor Author

Rebased and fixed the issue with zigimg. The flatpak should build correctly now.

@alaviss
alaviss force-pushed the push-qwtptnnownso branch from 05a6719 to a878247 Compare March 24, 2025 15:59
@alaviss

alaviss commented Mar 24, 2025

Copy link
Copy Markdown
Contributor Author

Rebased to main and updated package cache.

@alaviss
alaviss force-pushed the push-qwtptnnownso branch 2 times, most recently from 6b436db to e20e99b Compare March 30, 2025 03:44
@alaviss

alaviss commented Mar 30, 2025

Copy link
Copy Markdown
Contributor Author

Rebased to main and dropped zigimg workaround, given that the fork's author committed to stop force pushing.

@yorickpeterse

Copy link
Copy Markdown
Contributor

Is there anything that's holding back this PR (or reviewing of it)? 😃

@00-kat

00-kat commented Apr 16, 2025

Copy link
Copy Markdown
Contributor

To quote Mitchell from Discord:

Its on me, I was ready to merge it before and just couldn't make it work locally. I have to run this locally to make sure it all works (so I can debug it one day if it doesn't) and then we hsould be good to go.

@mitchellh

Copy link
Copy Markdown
Contributor

Okay hurray the build works for me. I want to add some CI checks next and we should be good. CI may be annoying though lets see!

@tulilirockz

Copy link
Copy Markdown

Flathub recently moved to github workflows for CI, maybe there would be something useful there?

@mitchellh

Copy link
Copy Markdown
Contributor

Okay, a couple important CI failures and I'm not quite sure what they are yet:

If anyone has ideas, that's blocking this, because we need CI to make sure this doesn't bitrot.

@alaviss

alaviss commented Apr 22, 2025

Copy link
Copy Markdown
Contributor Author

For some reason check-zig-cache.sh works on my local system (with Nix) but not in CI.

It's correct to fail, the lock file in main changed between the last rebase and now (and GHA runs on the merged head of main and this PR).
You'd have to merge main into this and update the deps.

alaviss and others added 7 commits April 22, 2025 10:56
This should make testing Flatpak builds a lot easier.

To build, enter `flatpak/` directory and run:

    flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

    flatpak run -p org.flatpak.Builder \
      --repo=repo \
      builddir \
      com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

    flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.
Flatpak will strip them out on its own into an extension package, useful
for debugging
This variant is built in Debug mode and is given a different desktop
file so it could be installed side-by-side with regular Ghostty.
* Added URLs to more resources
* Fixed developer ID
* Added device compatibility information
@mitchellh

Copy link
Copy Markdown
Contributor

Good catch, trying again.

@alaviss

alaviss commented Apr 22, 2025

Copy link
Copy Markdown
Contributor Author

It might be useful to also build the .Devel variant for debugging purposes, but I don't know if Flatpak GHA uploads debuginfo.

@mitchellh

Copy link
Copy Markdown
Contributor

Thanks, CI looks good! I'm going to polish up the runs and dependencies a bit and we should b good

@mitchellh mitchellh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sticking with this PR. With the Flatpak build being verified in CI now this should help keep everything much more stable. 😄

Comment thread flatpak/build-support/check-zig-cache.sh Outdated
@mitchellh
mitchellh enabled auto-merge April 22, 2025 19:03
@mitchellh
mitchellh merged commit f5b5a36 into ghostty-org:main Apr 22, 2025
@github-actions github-actions Bot added this to the 1.2.0 milestone Apr 22, 2025
@alaviss
alaviss deleted the push-qwtptnnownso branch April 22, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants