Skip to content
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

Can't Use Zig for PPA Build #9

Open
mkasberg opened this issue Dec 31, 2024 · 13 comments
Open

Can't Use Zig for PPA Build #9

mkasberg opened this issue Dec 31, 2024 · 13 comments

Comments

@mkasberg
Copy link
Owner

mkasberg commented Dec 31, 2024

Installing zig to /opt works fine for building here on GitHub Actions, but to use a PPA we need to upload a source package and the build happens on Ubuntu's servers. So this doesn't affect our ability to produce .deb, but does make it hard to get a PPA. It's producing the following output, failing on missing zig:


+------------------------------------------------------------------------------+
| Build                                        Tue, 31 Dec 2024 17:30:07 +0000 |
+------------------------------------------------------------------------------+


Unpack source
-------------

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 3.0 (quilt)
Source: ghostty
Binary: ghostty
Architecture: any
Version: 1.0.0-0~ppa1
Maintainer: Mike Kasberg <kasberg.mike@gmail.com>
Homepage: https://ghostty.org/
Standards-Version: 4.6.1
Build-Depends: debhelper-compat (= 13), libgtk-4-dev, libadwaita-1-dev, libonig-dev, libbz2-dev
Package-List:
 ghostty deb utils optional arch=any
Checksums-Sha1:
 285c70d4b711ef5c12375ee70e4b52698b85ccf4 24142832 ghostty_1.0.0.orig.tar.gz
 62650b9b7289968d4a7d783ba3c41ea468e80a06 2276 ghostty_1.0.0-0~ppa1.debian.tar.xz
Checksums-Sha256:
 7fcb5fed08bd23d54be138af4f63a78cf5addddbe40322465b520cf14c46f181 24142832 ghostty_1.0.0.orig.tar.gz
 9ba9987bd72bea2ef3d365f7d17f7a8cba8290460fac6b2c98233640a958e95d 2276 ghostty_1.0.0-0~ppa1.debian.tar.xz
Files:
 5cbf1462ee67caee71c20d8acbe0729d 24142832 ghostty_1.0.0.orig.tar.gz
 1808e95d5bf2f66cc262b21c6f9a8ecd 2276 ghostty_1.0.0-0~ppa1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iQJLBAEBCgA1FiEEXAUvaRstJmMRkSfdHAdreSECBD8FAmd0KOQXHGthc2Jlcmcu
bWlrZUBnbWFpbC5jb20ACgkQHAdreSECBD/Dbg/+P9giNFOMS2ze+3gDbyUcZugW
iA7hE9wCp1fKkx6Gomd+puyUh/YERyWdcmtEdoTdzn46rP+e0vxnAEcAg452O2Ti
1P48ssHllaapLz4//6cIIZB4lDLrFH7Vclnx203ic0unTzgTanqzDAZUJNHpydjW
32J8+yGCVkZJijjUpMcBMgIRVqYWG42htY3LwoOQlTi5TuuXrSJ67pIQ+8AxIPN1
r0bPJdh28M5CQ+TJ/YGXnwVMD+9dMxsI/+Ljqcsha6asu9liUqtSaYOsLzql5fG+
CKjf4AltjfBsZ723iq6umiq9wgdhowQUNRzvs3IzuZN+2sjWzzL3w59oqJ1Y8wk5
k3uvvOlsbMZACQgQdrurXyZLKtTNqTOpZuP/I5lvdNuSPQi1G8Dg1opJRhNmBr2K
XPaOG0XkhdS7FciT/5GX0g7v397CTRaZYP/Vv6POzL6ubUBtN1G8zv64KRQbyMmr
ypVY21j3UwIJFKftvUeNA1jTnlEweo/mj1Vcr5gMl2S/yg2DQJWfE7TQGB8/moty
Lehq4IgHAJzVdeGegZCdifDYSAUjtyf1dtsca+gmkf9M2ZVYB7qYT2m/bcl8YI79
6ofUTZMbcKDHEmohAoaHjMI0fO5qmIme1UkzzP7XCANyYLOauV9IWg9Z6j5aUsEb
VK1Xn+mDa8sUiF9w2aM=
=qeMk
-----END PGP SIGNATURE-----

gpgv: Signature made Tue Dec 31 17:24:52 2024 UTC
gpgv:                using RSA key 5C052F691B2D2663119127DD1C076B792102043F
gpgv:                issuer "kasberg.mike@gmail.com"
gpgv: Can't check signature: No public key
dpkg-source: warning: cannot verify inline signature for ./ghostty_1.0.0-0~ppa1.dsc: no acceptable signature found
dpkg-source: info: extracting ghostty in /<<PKGBUILDDIR>>
dpkg-source: info: unpacking ghostty_1.0.0.orig.tar.gz
dpkg-source: info: unpacking ghostty_1.0.0-0~ppa1.debian.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying 000-libbz2.patch

Check disk space
----------------

Sufficient free space for build

User Environment
----------------

APT_CONFIG=/var/lib/sbuild/apt.conf
DEB_BUILD_OPTIONS=noautodbgsym parallel=4
HOME=/sbuild-nonexistent
LANG=C.UTF-8
LC_ALL=C.UTF-8
LOGNAME=buildd
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
SCHROOT_ALIAS_NAME=build-PACKAGEBUILD-29899507
SCHROOT_CHROOT_NAME=build-PACKAGEBUILD-29899507
SCHROOT_COMMAND=env
SCHROOT_GID=2501
SCHROOT_GROUP=buildd
SCHROOT_SESSION_ID=build-PACKAGEBUILD-29899507
SCHROOT_UID=2001
SCHROOT_USER=buildd
SHELL=/bin/sh
TERM=unknown
USER=buildd
V=1

dpkg-buildpackage
-----------------

Command: dpkg-buildpackage --sanitize-env -us -uc -mLaunchpad Build Daemon <buildd@lcy02-amd64-030.buildd> -b -rfakeroot
dpkg-buildpackage: info: source package ghostty
dpkg-buildpackage: info: source version 1.0.0-0~ppa1
dpkg-buildpackage: info: source distribution oracular
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
dh clean
   dh_auto_clean
	make -j4 clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
rm -rf \
	zig-out zig-cache \
	macos/build \
	macos/GhosttyKit.xcframework
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_clean
	rm -f debian/debhelper-build-stamp
	rm -rf debian/.debhelper/
	rm -f -- debian/ghostty.substvars debian/files
	rm -fr -- debian/ghostty/ debian/tmp/
	find .  \( \( \
		\( -path .\*/.git -o -path .\*/.svn -o -path .\*/.bzr -o -path .\*/.hg -o -path .\*/CVS -o -path .\*/.pc -o -path .\*/_darcs \) -prune -o -type f -a \
	        \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
		 -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
		 -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
		 -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
		\) -exec rm -f {} + \) -o \
		\( -type d -a \( -name autom4te.cache -o -name __pycache__ \) -prune -exec rm -rf {} + \) \)
 debian/rules binary
dh binary
   dh_update_autotools_config
   dh_autoreconf
   debian/rules override_dh_auto_configure
make[1]: Entering directory '/<<PKGBUILDDIR>>'
ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh
./nix/build-support/fetch-zig-cache.sh: 37: zig: not found
make[1]: *** [debian/rules:12: override_dh_auto_configure] Error 127
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:9: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2024-12-31T17:30:08Z

Finished
--------


+------------------------------------------------------------------------------+
| Cleanup                                      Tue, 31 Dec 2024 17:30:09 +0000 |
+------------------------------------------------------------------------------+

Purging /<<BUILDDIR>>
Not removing build depends: as requested
E: Build failure (dpkg-buildpackage died)

+------------------------------------------------------------------------------+
| Summary                                      Tue, 31 Dec 2024 17:30:09 +0000 |
+------------------------------------------------------------------------------+

Build Architecture: amd64
Build Type: binary
Build-Space: 42772
Build-Time: 0
Distribution: oracular
Fail-Stage: build
Host Architecture: amd64
Install-Time: 34
Job: /home/buildd/build-PACKAGEBUILD-29899507/ghostty_1.0.0-0~ppa1.dsc
Machine Architecture: amd64
Package: ghostty
Package-Time: 36
Source-Version: 1.0.0-0~ppa1
Space: 42772
Status: attempted
Version: 1.0.0-0~ppa1
--------------------------------------------------------------------------------
Finished at 2024-12-31T17:30:08Z
Build needed 00:00:36, 42772k disk space
E: Build failure (dpkg-buildpackage died)
[Tue Dec 31 17:30:09 2024]
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=chroot --series=oracular --arch=amd64 PACKAGEBUILD-29899507
Scanning for processes to kill in build PACKAGEBUILD-29899507
mkasberg added a commit that referenced this issue Jan 1, 2025
I can't currently put this binary package in a PPA because the PPA
server builds from source itself. That's a problem because the PPA build
server is missing zig. We can work around this with a little "hack".
Install zig to /opt an symlink to /usr/local/bin as part of the
"configure" step.

Fixes #9
mkasberg added a commit that referenced this issue Jan 1, 2025
I can't currently put this binary package in a PPA because the PPA
server builds from source itself. That's a problem because the PPA build
server is missing zig. We can work around this with a little "hack".
Install zig to /opt an symlink to /usr/local/bin as part of the
"configure" step.

Fixes #9
mkasberg added a commit that referenced this issue Jan 1, 2025
I can't currently put this binary package in a PPA because the PPA
server builds from source itself. That's a problem because the PPA build
server is missing zig. We can work around this with a little "hack".
Install zig to /opt an symlink to /usr/local/bin as part of the
"configure" step.

Fixes #9
mkasberg added a commit that referenced this issue Jan 1, 2025
I can't currently put this binary package in a PPA because the PPA
server builds from source itself. That's a problem because the PPA build
server is missing zig. We can work around this with a little "hack".
Install zig to /opt an symlink to /usr/local/bin as part of the
"configure" step.

Fixes #9
mkasberg added a commit that referenced this issue Jan 1, 2025
I can't currently put this binary package in a PPA because the PPA
server builds from source itself. That's a problem because the PPA build
server is missing zig. We can work around this with a little "hack".
Install zig to /opt an symlink to /usr/local/bin as part of the
"configure" step.

Fixes #9
mkasberg added a commit that referenced this issue Jan 1, 2025
I can't currently put this binary package in a PPA because the PPA
server builds from source itself. That's a problem because the PPA build
server is missing zig. We can work around this with a little "hack".
Install zig to /opt an symlink to /usr/local/bin as part of the
"configure" step.

Fixes #9
mkasberg added a commit that referenced this issue Jan 1, 2025
I can't currently put this binary package in a PPA because the PPA
server builds from source itself. That's a problem because the PPA build
server is missing zig. We can work around this with a little "hack".
Install zig to /opt an symlink to /usr/local/bin as part of the
"configure" step.

Fixes #9
@mkasberg
Copy link
Owner Author

mkasberg commented Jan 1, 2025

I tried to "hack" around this by installing zig in the configure step (#11). But it looks like the PPA build servers prevent that by not resolving the domain.

dh binary
   dh_update_autotools_config
   dh_autoreconf
   debian/rules override_dh_auto_configure
make[1]: Entering directory '/<<PKGBUILDDIR>>'
# Install zig to /opt and symlink to /usr/local/bin as part of the "configure" step.
# This needs to be part of our build process because Ubuntu doesn't have an official
# zig package but we want to build on ubuntu PPA build servers.
wget "https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz"
--2025-01-01 16:54:39--  https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz
Resolving ziglang.org (ziglang.org)... failed: Name or service not known.
wget: unable to resolve host address ‘ziglang.org’
make[1]: *** [debian/rules:18: override_dh_auto_configure] Error 4

A PPA might not be the best feasible solution here...

@Kol9yN
Copy link

Kol9yN commented Jan 1, 2025

Propose you to look how Fastfetch did it, makes updates from his repo with PAA. Hope you find right ways ;)

@faveoled
Copy link

faveoled commented Jan 2, 2025

Propose you to look how Fastfetch did it, makes updates from his repo with PAA. Hope you find right ways ;)

Fastfetch is written in C, not Zig

@faveoled
Copy link

faveoled commented Jan 2, 2025

I think if you make a .deb out of Zig and put it in your PPA itself you'd be able to include it as a build dependency of ghostty

@satmandu
Copy link

satmandu commented Feb 6, 2025

Any resolution on this so we can get a proper PPA up?

@satmandu
Copy link

satmandu commented Feb 6, 2025

Looks like official builds may be coming as zig is now in debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995670#183

@satmandu
Copy link

satmandu commented Feb 6, 2025

Zig package: https://ftp-master.debian.org/new/zig0.13_0.13.0+dfsg-1.html

@mkasberg
Copy link
Owner Author

mkasberg commented Feb 7, 2025

I will have to revisit this, perhaps I will have some time this weekend to take a closer look. The Zig debian build might be a big help. The fundamental roadblock I was running into is that Ubuntu PPAs on Launchpad do the builds themselves and therefore require building from source -- you can't just upload a binary .deb package. Building from source is problematic when the build tool (zig) isn't available. The solution to that problem is to also build the zig package, but that also needs to be built from source. (And I'm hesitant to take on the work of also trying to maintain that zig package.)

There are various possible workarounds; at one point I considered trying to set up an apt repo on GitHub using GitHub pages but there are a few problems with that too... It works on a small scale but I wasn't sure if GitHub would be okay with that kind of use at this scale, and many of the tools to set it up work with only a single distribution target or only a single arch.

So, in short, my current thinking is that a Launchpad PPA is probably still ideal and might be unblocked if we can figure out a relatively simple way to get a zig package in the same PPA (if not in the official ubuntu packages).

@satmandu
Copy link

satmandu commented Feb 9, 2025

Yes, but it looks like zig and ghostty will make it into debian unstable soon, and after that it will get into Ubuntu ....

Getting the zig package into debian was key to getting the ghostty package also built on debian.

Once zig enters Ubuntu, I think you should be able to get recent versions of ghostty built in a ppa easily.

@HarshedCodes
Copy link

The fundamental roadblock I was running into is that Ubuntu PPAs on Launchpad do the builds themselves and therefore require building from source -- you can't just upload a binary .deb package.

I think the key to solving this is the 'on launchpad' part. Self-hosting a ppa is... maybe i should say was as it's been awhile... fairly trivial. I used to do it for a custom boxxee build when I was selling htpc's back in the day. I cant speak to recent changes, but at least a short bit of research shows its still fairly straightforward. https://github.com/tagplus5/vscode-ppa is a current (current being 5 months ago) example and https://github.com/assafmo/ppa is even newer, last adding packages 3 months ago.

@satmandu
Copy link

Ok here's a ppa with zig. (The noble and oracular builds should show up eventually. Right now only the plucky builds are up.)

https://launchpad.net/~satadru-umich/+archive/ubuntu/zig

This doesn't solve the larger problem though of launchpad build servers not allowing external connections during the build, which means that the entire zig build cache needs to be saved in the orig tarball before a build, which is annoying, to say the least.

@satmandu
Copy link

Ok, I got PPA builds working ...

https://launchpad.net/~satadru-umich/+archive/ubuntu/ghostty

Feel free to take what you need from this.

@Kol9yN
Copy link

Kol9yN commented Feb 28, 2025

it will be with auto updates if "apt update && apt upgrade"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants