os icon indicating copy to clipboard operation
os copied to clipboard

tree-sitter fails to build on amd64

Open murraybd opened this issue 3 months ago • 1 comments

The package tree-sitter with version 0.26.0 and epoch 0 fails to build from source on amd64 with the following error:

2025-09-29 07:44:31.490242989 +0000 UTC parsed env
2025-09-29 07:44:31.490415818 +0000 UTC configuring puller identity "720909c9f5279097d847ad02a2f24ba8f59de36a/a49c7fedc33adf69"...
2025-09-29 07:44:31.490655915 +0000 UTC running command chainctl [auth login --audience apk.cgr.dev --identity 720909c9f5279097d847ad02a2f24ba8f59de36a/a49c7fedc33adf69]
2025-09-29 07:44:32.114869877 +0000 UTC Successfully exchanged token.
2025-09-29 07:44:32.183275676 +0000 UTC Valid! Id: 720909c9f5279097d847ad02a2f24ba8f59de36a/a49c7fedc33adf69
2025-09-29 07:44:32.239820561 +0000 UTC command "chainctl" completed successfully
2025-09-29 07:44:32.239880364 +0000 UTC puller identity configured successfully
2025-09-29 07:44:32.239888787 +0000 UTC puller identity configured successfully
2025-09-29 07:44:32.239894659 +0000 UTC running build...
2025-09-29 07:44:32.239901814 +0000 UTC running command melange [build tree-sitter.yaml --gcplog --source-dir tree-sitter --arch x86_64 --arch=x86_64 --env-file=build-x86_64.env --namespace=wolfi --pipeline-dir=./pipelines --out-dir=./packages/ --runner=qemu --keyring-append=https://packages.wolfi.dev/os/wolfi-signing.rsa.pub --repository-append=https://packages.wolfi.dev/os --repository-append=https://apk.cgr.dev/wolfi-presubmit/world-1759127530276 --repository-append=https://apk.cgr.dev/wolfi-presubmit/world-1759127530276 --git-repo-url=https://github.com/wolfi-dev/os]
2025-09-29 07:44:32.255189808 +0000 UTC melange version  with runner qemu building tree-sitter.yaml at commit 9b1ba8c9b7e310e5f3be0f809082a7de065b82fc for arches [amd64]
2025-09-29 07:44:32.256705568 +0000 UTC melange v0.31.4 with runner qemu is building:
2025-09-29 07:44:32.260945876 +0000 UTC populating workspace /tmp/melange-workspace-1688762534 from tree-sitter
2025-09-29 07:44:33.522647092 +0000 UTC image configuration:
2025-09-29 07:44:33.522752073 +0000 UTC   contents:
2025-09-29 07:44:33.522760802 +0000 UTC     build repositories: [https://apk.cgr.dev/wolfi-presubmit/world-1759127530276 https://packages.wolfi.dev/os]
2025-09-29 07:44:33.522787026 +0000 UTC     runtime repositories: []
2025-09-29 07:44:33.522795387 +0000 UTC     repositories: []
2025-09-29 07:44:33.522801753 +0000 UTC     keyring:      [https://packages.wolfi.dev/os/wolfi-signing.rsa.pub]
2025-09-29 07:44:33.522809618 +0000 UTC     packages:     [autoconf=2.72-r5 automake=1.18.1-r2 bash=5.3-r3 binutils=2.45-r2 build-base=1-r9 busybox=1.37.0-r50 ca-certificates-bundle=20250619-r6 cyrus-sasl=2.1.28-r44 gcc=15.2.0-r2 gdbm=1.26-r1 git=2.51.0-r1 glibc-dev=2.42-r0 glibc-locale-posix=2.42-r0 glibc=2.42-r0 gmp=6.3.0-r8 heimdal-libs=7.8.0-r42 isl=0.27-r4 keyutils-libs=1.6.3-r37 krb5-conf=1.0-r7 krb5-libs=1.22.1-r1 ld-linux=2.42-r0 libatomic=15.2.0-r2 libbrotlicommon1=1.1.0-r7 libbrotlidec1=1.1.0-r7 libbz2-1=1.0.8-r21 libcom_err=1.47.3-r1 libcrypt1=2.42-r0 libcrypto3=3.5.2-r1 libcurl-openssl4=8.16.0-r0 libexpat1=2.7.3-r0 libgcc=15.2.0-r2 libgo=15.2.0-r2 libgomp=15.2.0-r2 libidn2=2.3.8-r3 libldap=2.6.10-r5 libnghttp2-14=1.67.1-r0 libpcre2-8-0=10.46-r0 libpsl=0.21.5-r6 libquadmath=15.2.0-r2 libssl3=3.5.2-r1 libstdc++-dev=15.2.0-r2 libstdc++=15.2.0-r2 libunistring=1.3-r4 libverto=0.3.2-r6 libxcrypt-dev=4.4.38-r4 libxcrypt=4.4.38-r4 libzstd1=1.5.7-r3 linux-headers=6.16.9-r0 m4=1.4.20-r5 make=4.4.1-r8 mpc=1.3.1-r7 mpfr=4.2.2-r2 ncurses-terminfo-base=6.5_p20250621-r1 ncurses=6.5_p20250621-r1 nss-db=2.42-r0 nss-hesiod=2.42-r0 openssf-compiler-options=20240627-r29 perl=5.42.0-r1 pkgconf=2.5.1-r1 posix-cc-wrappers=1-r7 readline=8.3-r1 scanelf=1.3.8-r5 sqlite-libs=3.50.4-r1 wolfi-baselayout=20230201-r24 zlib=1.3.1-r51]
2025-09-29 07:44:33.522844859 +0000 UTC   accounts:
2025-09-29 07:44:33.522858141 +0000 UTC     runas:  
2025-09-29 07:44:33.522868531 +0000 UTC     users:
2025-09-29 07:44:33.522881417 +0000 UTC       - uid=1000(build) gid=1000
2025-09-29 07:44:33.522893567 +0000 UTC     groups:
2025-09-29 07:44:33.522903356 +0000 UTC       - gid=1000(build) members=[build]
2025-09-29 07:44:33.522917873 +0000 UTC auth configured for: []
2025-09-29 07:44:33.731570617 +0000 UTC installing wolfi-baselayout (20230201-r24)
2025-09-29 07:44:33.780706199 +0000 UTC installing ca-certificates-bundle (20250619-r6)
2025-09-29 07:44:33.782737444 +0000 UTC installing glibc-locale-posix (2.42-r0)
2025-09-29 07:44:33.789350281 +0000 UTC installing libgcc (15.2.0-r2)
2025-09-29 07:44:33.940551999 +0000 UTC installing glibc (2.42-r0)
2025-09-29 07:44:33.941337082 +0000 UTC installing ld-linux (2.42-r0)
2025-09-29 07:44:33.941927046 +0000 UTC installing libbz2-1 (1.0.8-r21)
2025-09-29 07:44:33.942385332 +0000 UTC installing libxcrypt (4.4.38-r4)
2025-09-29 07:44:33.942855702 +0000 UTC installing libcrypt1 (2.42-r0)
2025-09-29 07:44:33.943380366 +0000 UTC installing zlib (1.3.1-r51)
2025-09-29 07:44:34.320860057 +0000 UTC installing perl (5.42.0-r1)
2025-09-29 07:44:34.323994375 +0000 UTC installing m4 (1.4.20-r5)
2025-09-29 07:44:34.324394646 +0000 UTC installing autoconf (2.72-r5)
2025-09-29 07:44:34.324729761 +0000 UTC installing automake (1.18.1-r2)
2025-09-29 07:44:34.325249894 +0000 UTC installing ncurses-terminfo-base (6.5_p20250621-r1)
2025-09-29 07:44:34.326004381 +0000 UTC installing ncurses (6.5_p20250621-r1)
2025-09-29 07:44:34.326354506 +0000 UTC installing bash (5.3-r3)
2025-09-29 07:44:34.326609846 +0000 UTC installing libstdc++ (15.2.0-r2)
2025-09-29 07:44:34.326914574 +0000 UTC installing libzstd1 (1.5.7-r3)
2025-09-29 07:44:34.558587609 +0000 UTC installing binutils (2.45-r2)
2025-09-29 07:44:34.559949913 +0000 UTC installing libxcrypt-dev (4.4.38-r4)
2025-09-29 07:44:34.560666794 +0000 UTC installing linux-headers (6.16.9-r0)
2025-09-29 07:44:34.563832061 +0000 UTC installing nss-db (2.42-r0)
2025-09-29 07:44:34.564791061 +0000 UTC installing nss-hesiod (2.42-r0)
2025-09-29 07:44:34.565645632 +0000 UTC installing glibc-dev (2.42-r0)
2025-09-29 07:44:34.568774937 +0000 UTC installing libquadmath (15.2.0-r2)
2025-09-29 07:44:34.569439093 +0000 UTC installing libstdc++-dev (15.2.0-r2)
2025-09-29 07:44:34.573166845 +0000 UTC installing posix-cc-wrappers (1-r7)
2025-09-29 07:44:34.573563755 +0000 UTC installing libatomic (15.2.0-r2)
2025-09-29 07:44:34.574236322 +0000 UTC installing gmp (6.3.0-r8)
2025-09-29 07:44:34.574689259 +0000 UTC installing libgo (15.2.0-r2)
2025-09-29 07:44:34.575394153 +0000 UTC installing libgomp (15.2.0-r2)
2025-09-29 07:44:34.576146037 +0000 UTC installing isl (0.27-r4)
2025-09-29 07:44:34.576689615 +0000 UTC installing mpfr (4.2.2-r2)
2025-09-29 07:44:34.577271416 +0000 UTC installing mpc (1.3.1-r7)
2025-09-29 07:44:34.577904987 +0000 UTC installing openssf-compiler-options (20240627-r29)
2025-09-29 07:44:36.675109882 +0000 UTC installing gcc (15.2.0-r2)
2025-09-29 07:44:36.676899172 +0000 UTC installing make (4.4.1-r8)
2025-09-29 07:44:36.677286563 +0000 UTC installing pkgconf (2.5.1-r1)
2025-09-29 07:44:36.677608264 +0000 UTC installing build-base (1-r9)
2025-09-29 07:44:36.67775388 +0000 UTC installing busybox (1.37.0-r50)
2025-09-29 07:44:36.678082121 +0000 UTC installing libcrypto3 (3.5.2-r1)
2025-09-29 07:44:36.678461123 +0000 UTC installing gdbm (1.26-r1)
2025-09-29 07:44:36.678765849 +0000 UTC installing readline (8.3-r1)
2025-09-29 07:44:36.679007321 +0000 UTC installing sqlite-libs (3.50.4-r1)
2025-09-29 07:44:36.679285267 +0000 UTC installing heimdal-libs (7.8.0-r42)
2025-09-29 07:44:36.679609019 +0000 UTC installing cyrus-sasl (2.1.28-r44)
2025-09-29 07:44:36.679991447 +0000 UTC installing libbrotlicommon1 (1.1.0-r7)
2025-09-29 07:44:36.680279072 +0000 UTC installing libbrotlidec1 (1.1.0-r7)
2025-09-29 07:44:36.680545857 +0000 UTC installing libcom_err (1.47.3-r1)
2025-09-29 07:44:36.680866219 +0000 UTC installing keyutils-libs (1.6.3-r37)
2025-09-29 07:44:36.681180377 +0000 UTC installing libssl3 (3.5.2-r1)
2025-09-29 07:44:36.681533065 +0000 UTC installing libverto (0.3.2-r6)
2025-09-29 07:44:36.681817303 +0000 UTC installing krb5-conf (1.0-r7)
2025-09-29 07:44:36.681966226 +0000 UTC installing krb5-libs (1.22.1-r1)
2025-09-29 07:44:36.68239018 +0000 UTC installing libldap (2.6.10-r5)
2025-09-29 07:44:36.68276335 +0000 UTC installing libnghttp2-14 (1.67.1-r0)
2025-09-29 07:44:36.68306088 +0000 UTC installing libunistring (1.3-r4)
2025-09-29 07:44:36.683291194 +0000 UTC installing libidn2 (2.3.8-r3)
2025-09-29 07:44:36.683552537 +0000 UTC installing libpsl (0.21.5-r6)
2025-09-29 07:44:36.683840837 +0000 UTC installing libcurl-openssl4 (8.16.0-r0)
2025-09-29 07:44:36.684172595 +0000 UTC installing libexpat1 (2.7.3-r0)
2025-09-29 07:44:36.684421825 +0000 UTC installing libpcre2-8-0 (10.46-r0)
2025-09-29 07:44:36.68474309 +0000 UTC installing git (2.51.0-r1)
2025-09-29 07:44:36.68543174 +0000 UTC installing scanelf (1.3.8-r5)
2025-09-29 07:44:37.734016672 +0000 UTC qemu: generating ssh key pairs for ephemeral VM
2025-09-29 07:44:37.734956421 +0000 UTC qemu: generating initramfs
2025-09-29 07:44:37.90635571 +0000 UTC image configuration:
2025-09-29 07:44:37.906410595 +0000 UTC   contents:
2025-09-29 07:44:37.906420477 +0000 UTC     build repositories: [https://apk.cgr.dev/chainguard]
2025-09-29 07:44:37.906435167 +0000 UTC     runtime repositories: []
2025-09-29 07:44:37.906442613 +0000 UTC     repositories: []
2025-09-29 07:44:37.906452903 +0000 UTC     keyring:      []
2025-09-29 07:44:37.906459834 +0000 UTC     packages:     [microvm-init]
2025-09-29 07:44:38.674297033 +0000 UTC installing wolfi-baselayout (20230201-r24)
2025-09-29 07:44:38.698360343 +0000 UTC installing ca-certificates-bundle (20250619-r6)
2025-09-29 07:44:38.701721496 +0000 UTC installing libgcc (15.2.0-r2)
2025-09-29 07:44:38.717880244 +0000 UTC installing glibc-locale-posix (2.42-r0)
2025-09-29 07:44:38.816301053 +0000 UTC installing glibc (2.42-r0)
2025-09-29 07:44:38.820404303 +0000 UTC installing ld-linux (2.42-r0)
2025-09-29 07:44:38.821168331 +0000 UTC installing gnutar-rmt (1.35-r6)
2025-09-29 07:44:38.821595618 +0000 UTC installing gnutar (1.35-r6)
2025-09-29 07:44:38.826358477 +0000 UTC installing libattr1 (2.5.2-r53)
2025-09-29 07:44:38.826864812 +0000 UTC installing attr (2.5.2-r53)
2025-09-29 07:44:38.827646995 +0000 UTC installing zlib (1.3.1-r51)
2025-09-29 07:44:38.828204085 +0000 UTC installing libzstd1 (1.5.7-r3)
2025-09-29 07:44:38.829349608 +0000 UTC installing xz (5.8.1-r3)
2025-09-29 07:44:38.831808879 +0000 UTC installing libcrypto3 (3.5.2-r1)
2025-09-29 07:44:38.835181662 +0000 UTC installing kmod (34.2-r41)
2025-09-29 07:44:38.836074971 +0000 UTC installing libbz2-1 (1.0.8-r21)
2025-09-29 07:44:38.836653463 +0000 UTC installing libelf (0.193-r4)
2025-09-29 07:44:38.837695623 +0000 UTC installing libmnl (1.0.5-r6)
2025-09-29 07:44:38.838191791 +0000 UTC installing libnftnl (1.3.0-r0)
2025-09-29 07:44:38.839170963 +0000 UTC installing xtables (1.8.11-r27)
2025-09-29 07:44:38.844521778 +0000 UTC installing iproute2 (6.16.0-r1)
2025-09-29 07:44:38.847314283 +0000 UTC installing libstdc++ (15.2.0-r2)
2025-09-29 07:44:38.849432843 +0000 UTC installing inih (62-r0)
2025-09-29 07:44:38.850000997 +0000 UTC installing liburcu (0.15.3-r1)
2025-09-29 07:44:38.850897139 +0000 UTC installing libblkid (2.41.2-r0)
2025-09-29 07:44:38.852337605 +0000 UTC installing libuuid (2.41.2-r0)
2025-09-29 07:44:38.852907006 +0000 UTC installing xfsprogs-core (6.16.0-r0)
2025-09-29 07:44:38.854680991 +0000 UTC installing xfsprogs (6.16.0-r0)
2025-09-29 07:44:38.855120893 +0000 UTC installing libmount (2.41.2-r0)
2025-09-29 07:44:38.856614994 +0000 UTC installing mount (2.41.2-r0)
2025-09-29 07:44:38.857167567 +0000 UTC installing libpcre2-8-0 (10.46-r0)
2025-09-29 07:44:38.858026276 +0000 UTC installing libsepol (3.9-r1)
2025-09-29 07:44:38.859333851 +0000 UTC installing libselinux (3.9-r1)
2025-09-29 07:44:38.866944104 +0000 UTC installing libxcrypt (4.4.38-r4)
2025-09-29 07:44:38.867542815 +0000 UTC installing libcrypt1 (2.42-r0)
2025-09-29 07:44:38.868006297 +0000 UTC installing linux-pam (1.7.1-r1)
2025-09-29 07:44:38.876053783 +0000 UTC installing openssh-keygen (10.0_p1-r5)
2025-09-29 07:44:38.876771464 +0000 UTC installing openssh-server-config (10.0_p1-r5)
2025-09-29 07:44:38.877251917 +0000 UTC installing openssh-server (10.0_p1-r5)
2025-09-29 07:44:38.879111119 +0000 UTC installing ncurses-terminfo-base (6.5_p20250621-r1)
2025-09-29 07:44:38.886609789 +0000 UTC installing ncurses (6.5_p20250621-r1)
2025-09-29 07:44:38.888098995 +0000 UTC installing setarch (2.41.2-r0)
2025-09-29 07:44:38.888727207 +0000 UTC installing libfdisk (2.41.2-r0)
2025-09-29 07:44:38.890190715 +0000 UTC installing sqlite-libs (3.50.4-r1)
2025-09-29 07:44:38.891377096 +0000 UTC installing util-linux (2.41.2-r0)
2025-09-29 07:44:38.89475805 +0000 UTC installing libsmartcols (2.41.2-r0)
2025-09-29 07:44:38.942698913 +0000 UTC installing util-linux-misc (2.41.2-r0)
2025-09-29 07:44:38.957954136 +0000 UTC installing busybox (1.37.0-r50)
2025-09-29 07:44:38.959354487 +0000 UTC installing microvm-init (0.0.1-r12)
2025-09-29 07:44:39.380322664 +0000 UTC qemu: starting VM
2025-09-29 07:44:39.3818264 +0000 UTC qemu: waiting for SSH
2025-09-29 07:44:40.88336831 +0000 UTC conn read: read tcp 127.0.0.1:51834->127.0.0.1:33227: i/o timeout
2025-09-29 07:44:42.371479805 +0000 UTC qemu: meta-data=/dev/vda               isize=512    agcount=8, agsize=1638400 blks
2025-09-29 07:44:42.371574829 +0000 UTC qemu:          =                       sectsz=4096  attr=2, projid32bit=1
2025-09-29 07:44:42.371588795 +0000 UTC qemu:          =                       crc=1        finobt=1, sparse=1, rmapbt=1
2025-09-29 07:44:42.371594788 +0000 UTC qemu:          =                       reflink=1    bigtime=1 inobtcount=1 nrext64=1
2025-09-29 07:44:42.371600156 +0000 UTC qemu:          =                       exchange=0   metadir=0
2025-09-29 07:44:42.37163714 +0000 UTC qemu: data     =                       bsize=4096   blocks=13107200, imaxpct=25
2025-09-29 07:44:42.37165993 +0000 UTC qemu:          =                       sunit=0      swidth=0 blks
2025-09-29 07:44:42.371748368 +0000 UTC qemu: naming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=0
2025-09-29 07:44:42.371814468 +0000 UTC qemu: log      =internal log           bsize=4096   blocks=16384, version=2
2025-09-29 07:44:42.371820513 +0000 UTC qemu:          =                       sectsz=4096  sunit=1 blks, lazy-count=1
2025-09-29 07:44:42.37189657 +0000 UTC qemu: realtime =none                   extsz=4096   blocks=0, rtextents=0
2025-09-29 07:44:42.371948576 +0000 UTC qemu:          =                       rgcount=0    rgsize=0 extents
2025-09-29 07:44:42.372007525 +0000 UTC qemu:          =                       zoned=0      start=0 reserved=0
2025-09-29 07:44:42.373824696 +0000 UTC qemu: Discarding blocks...Done.
2025-09-29 07:44:42.38506615 +0000 UTC conn read: read tcp 127.0.0.1:42654->127.0.0.1:33227: i/o timeout
2025-09-29 07:44:43.4329043 +0000 UTC qemu: ssh-keygen: generating new host keys: RSA ECDSA ED25519 
2025-09-29 07:44:43.440071537 +0000 UTC qemu: Server listening on 0.0.0.0 port 2223.
2025-09-29 07:44:43.440121921 +0000 UTC qemu: Server listening on 0.0.0.0 port 22.
2025-09-29 07:44:43.886884287 +0000 UTC conn read: read tcp 127.0.0.1:42670->127.0.0.1:33227: i/o timeout
2025-09-29 07:44:44.397582996 +0000 UTC qemu: VM started successfully, SSH server is up
2025-09-29 07:44:44.39789851 +0000 UTC qemu: Connection closed by 10.0.2.2 port 42674
2025-09-29 07:44:44.422076842 +0000 UTC qemu: Accepted publickey for root from 10.0.2.2 port 42684 ssh2: ECDSA SHA256:iuhwabYZdnweNSXpk6NBrchRdj+by0vg57BH/fQfZrk
2025-09-29 07:44:44.431752908 +0000 UTC qemu: Connection closed by 10.0.2.2 port 42684
2025-09-29 07:44:44.454405809 +0000 UTC qemu: Accepted publickey for root from 10.0.2.2 port 42694 ssh2: ECDSA SHA256:iuhwabYZdnweNSXpk6NBrchRdj+by0vg57BH/fQfZrk
2025-09-29 07:44:44.488244619 +0000 UTC qemu: Accepted publickey for root from 10.0.2.2 port 41768 ssh2: ECDSA SHA256:iuhwabYZdnweNSXpk6NBrchRdj+by0vg57BH/fQfZrk
2025-09-29 07:44:44.519915982 +0000 UTC qemu: Accepted publickey for root from 10.0.2.2 port 42702 ssh2: ECDSA SHA256:iuhwabYZdnweNSXpk6NBrchRdj+by0vg57BH/fQfZrk
2025-09-29 07:44:44.53315019 +0000 UTC qemu: running kernel version: 6.16.9-r0-qemu-generic #Chainguard SMP PREEMPT_DYNAMIC Thu Sep 25 11:28:49 UTC 2025
2025-09-29 07:44:44.533181563 +0000 UTC qemu: setting up melange cachedir: ./melange-cache/
2025-09-29 07:44:44.54331896 +0000 UTC qemu: setting up local workspace
2025-09-29 07:44:44.560829929 +0000 UTC running step "git-checkout"
2025-09-29 07:44:44.574404612 +0000 UTC [git checkout] repo='https://github.com/tree-sitter/tree-sitter' dest='.' depth='unset' branch='' tag='v0.26.0' expcommit='9be3e2bdd8e1e62ad259e3c8ee7de7ebaed0553f' recurse='false'
2025-09-29 07:44:44.580087299 +0000 UTC [git checkout] execute: git config --global --add safe.directory /tmp/tmp.aq9ZIQ
2025-09-29 07:44:44.58182746 +0000 UTC [git checkout] execute: git config --global --add safe.directory /home/build
2025-09-29 07:44:44.583704187 +0000 UTC [git checkout] execute: git clone --quiet --origin=origin --config=user.name=Melange Build [email protected] --config=advice.detachedHead=false --branch=v0.26.0 --depth=1 https://github.com/tree-sitter/tree-sitter /tmp/tmp.aq9ZIQ
2025-09-29 07:44:44.764891956 +0000 UTC fatal: Remote branch v0.26.0 not found in upstream origin
2025-09-29 07:44:44.767336364 +0000 UTC Failed to run command "/bin/sh -c 'set -e 
[ -d '\''/home/build'\'' ] || mkdir -p '\''/home/build'\''
cd '\''/home/build'\''
#!/bin/sh
set -e
msg() { echo "[git checkout]" "$@"; }
fail() {
	msg FAIL "$@"
	exit 1
}
vr() {
	msg "execute:" "$@"
	"$@"
}
process_cherry_picks() {
	local cpicksf="$1" oifs="$IFS" count=0
	local fetched_branches=""
	local sdate=${SOURCE_DATE_EPOCH:-0}
	if [ "$sdate" -lt 315532800 ]; then
		msg "Setting commit date to Jan 1, 1980 (SOURCE_DATE_EPOCH found ${SOURCE_DATE_EPOCH})"
		sdate=315532800
	fi
	if [ -z "$cpicksf" ]; then
		return 0
	fi
	if [ ! -f "$cpicksf" ]; then
		msg "cherry picks input '\''$cpicksf'\'' is not a file"
		return 1
	fi

	local line="" branch="" hash="" comment=""
	while IFS= read -r line; do

		line=${line%%#*}
		[ -z "$line" ] && continue

		if ! echo "$line" | grep -q '\'':'\''; then
			msg "Invalid format, expected '\''[branch/]commit: comment'\''. Found: $line"
			return 1
		fi

		branch=${line%%:*}
		comment=${line#*:}
		comment=$(
			set -f
			echo $comment
		)

		if [ -z "$comment" ]; then
			msg "Empty comment for cherry-pick: $line"
			return 1
		fi

		hash=${branch##*/}

		[ "$branch" != "$hash" ] && branch=${branch%/*} || branch=""

		if [ -n "$branch" ]; then
			case " $fetched_branches " in
			*" $branch "*) ;;
			*)
				vr git fetch origin $branch:$branch || {
					msg "failed to fetch branch $branch"
					return 1
				}
				fetched_branches="$fetched_branches $branch "
				;;
			esac
		fi

		vr env \
			GIT_COMMITTER_DATE="@$sdate" \
			git cherry-pick -x "$hash" || {
			msg "failed to cherry-pick $hash from branch $branch"
			return 1
		}

		msg "Cherry-picked $hash from $branch with comment: $comment"

		count=$((count + 1))
	done <"$cpicksf"

	if [ $count -gt 0 ]; then
		msg "applied $count cherry-pick(s). head is now $(git rev-parse HEAD)"
	fi
}
main() {
	local repo=$1 dest=${2:-.} depth=${3:-"unset"} branch=$4
	local tag=$5 expcommit=$6 recurse=${7:-false}
	local cherry_pick="$8"
	msg "repo='\''$repo'\'' dest='\''$dest'\'' depth='\''$depth'\'' branch='\''$branch'\''" \
		"tag='\''$tag'\'' expcommit='\''$expcommit'\'' recurse='\''$recurse'\''"

	case "$recurse" in
	true | false) : ;;
	*) fail "recurse must be true or false, not '\''$recurse'\''" ;;
	esac

	[ -n "$repo" ] || fail "repository not provided"

	if [ -z "$branch" ] && [ -z "$tag" ]; then
		msg "Warning: you have not specified a branch or tag."
	elif [ -n "$branch" ] && [ -n "$tag" ]; then
		fail "both branch ($branch) and tag ($tag) are specified."
	fi

	[ -n "$expcommit" ] ||
		msg "Warning: no expected-commit"

	local flags="" depthflag="" dest_fullpath="" workdir=""
	local remote="origin" rcfile="" rc="" quiet="--quiet"
	flags="--config=advice.detachedHead=false"
	[ -n "$branch" ] && flags="$flags --branch=$branch"
	[ -n "$tag" ] && flags="$flags --branch=$tag"
	[ "$recurse" = "true" ] && flags="$flags --recurse-submodules"

	if [ "$depth" = "unset" ]; then
		depth=1
		if [ -n "$branch" -a -n "$expcommit" ]; then

			depth=-1
		fi
	fi

	[ "$depth" = "-1" ] || depthflag="--depth=$depth"

	workdir=$(mktemp -d)
	rcfile=$(mktemp)
	mkdir -p "$dest"
	dest_fullpath=$(realpath "$dest")

	vr git config --global --add safe.directory "$workdir"
	vr git config --global --add safe.directory "$dest_fullpath"

	vr git clone $quiet "--origin=$remote" \
		"--config=user.name=Melange Build" \
		"[email protected]" \
		$flags \
		${depthflag:+"$depthflag"} "$repo" "$workdir"

	vr cd "$workdir"
	msg "tar -c . | tar -C \"$dest_fullpath\" -x"
	(
		tar -c .
		echo $? >"$rcfile"
	) | tar -C "$dest_fullpath" -x --no-same-owner
	read rc <"$rcfile" || fail "failed to read rc file"
	[ $rc -eq 0 ] || fail "tar creation in $workdir failed"

	rm -rf "$workdir"
	vr cd "$dest_fullpath"
	vr git config --global --add safe.directory "$dest_fullpath"

	local foundcommit="" tagobj=""
	if [ -z "$tag" ]; then
		foundcommit=$(git rev-parse --verify HEAD)
		if [ -n "$expcommit" ] && [ "$expcommit" != "$foundcommit" ]; then
			if [ "$depth" = "-1" ]; then
				msg "expected commit $expcommit on ${branch:-HEAD}," \
					"got $foundcommit, performing reset"
				vr git reset --hard "$expcommit"
			else
				fail "expected commit $expcommit on ${branch:-HEAD}," \
					"got $foundcommit, set depth to -1 to attempt a reset"
			fi
		fi
		msg "tip of ${branch:-HEAD} is commit $foundcommit"
		process_cherry_picks "$cherry_pick" || fail "failed to apply cherry-pick"
		return 0
	fi

	vr git fetch $quiet $remote ${depthflag:-"$depthflag"} --no-tags \
		"+refs/tags/$tag:refs/$remote/tags/$tag"
	vr git checkout $quiet "$remote/tags/$tag"

	foundcommit=$(git rev-parse --verify HEAD)
	if [ -z "$expcommit" ] || [ "$expcommit" = "$foundcommit" ]; then
		msg "tag $tag is $foundcommit"
	else

		tagobj=$(git rev-parse --verify --end-of-options \
			"refs/$remote/tags/$tag")
		if [ "$expcommit" != "$tagobj" ]; then
			[ "$tagobj" != "$expcommit" ] &&
				msg "tag object hash was $tagobj"
			fail "Expected commit $expcommit for $tag, found $foundcommit"
		fi

		msg "Warning: The provided expected-commit ($expcommit)"
		msg "was the hash of the annotated tag object for $tag."
		msg "Update to set expected-commit to $foundcommit"
	fi

	process_cherry_picks "$cherry_pick" ||
		fail "failed to apply cherry-pick"

	return 0
}
cpickf=$(mktemp) || {
	echo "failed mktemp"
	exit 1
}
cat >"$cpickf" <<"END_CHERRY_PICKS"

END_CHERRY_PICKS
main \
	"https://github.com/tree-sitter/tree-sitter" "." \
	"unset" "" \
	"v0.26.0" "9be3e2bdd8e1e62ad259e3c8ee7de7ebaed0553f" \
	"false" "$cpickf"
rm -f "$cpickf"

exit 0'": Process exited with status 128
2025-09-29 07:44:44.767492094 +0000 UTC qemu: sending shutdown signal
2025-09-29 07:44:44.774899516 +0000 UTC failed to build package: unable to run package tree-sitter pipeline: unable to run pipeline: unable to run pipeline: Process exited with status 128
2025-09-29 07:44:44.826967888 +0000 UTC failed to build: command melange failed: exit status 1
2025-09-29 07:44:44.827122592 +0000 UTC build failed: command melange failed: exit status 1

murraybd avatar Oct 02 '25 14:10 murraybd

The Wolfi recipe is trying to build version 0.26.0, which upstream has not released.

c15938532d06b5abc4ad8bcbde43597eb95b5c20 refs/tags/v0.25.7 f2f197b6b27ce75c280c20f131d4f71e906b86f7 refs/tags/v0.25.8 a467ea8502d95562171f97953a6dc5b2a8622609 refs/tags/v0.25.9 513a37939ab1a72c24608654426a7cf82472052f refs/tags/v0.26.0-pre 9be3e2bdd8e1e62ad259e3c8ee7de7ebaed0553f refs/tags/v0.26.0-pre^{}

We have two options: either to roll back to v0.25.10 or use the pre-release version v0.26.0-pre. As of now, raising PR for roll back.

avinesh2101 avatar Nov 16 '25 21:11 avinesh2101

A newer version has built since 0.26.0-r0

OddBloke avatar Dec 09 '25 14:12 OddBloke