AUR build broken (again) #2948

Closed
opened 2026-02-16 17:37:56 -05:00 by yindo · 8 comments
Owner

Originally created by @rubin55 on GitHub (Nov 18, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

You guys are using find incorrectly. For some reason, the current build creates 4 binaries, and the current find invocation finds them all and tries to copy them to a single opencode target. Next to that, the target directory does not exist yet, so, given multiple sources, install expects a directory.

Ideally, you would case on architecture, and copy precisely the binary you want for x86-64 or aarch64, and check also if you are on a glibc system or a musl system. If you don't care, and just want the first binary find comes up with (...), do this:

diff --git a/PKGBUILD b/PKGBUILD
index 0bb248c..aa72e99 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,5 +27,6 @@ build() {

 package() {
   cd "opencode-${pkgver}/packages/opencode"
-  install -Dm755 $(find dist/*/bin/opencode) "${pkgdir}/usr/bin/opencode"
+  mkdir -p "${pkgdir}/usr/bin"
+  install -Dm755 $(find dist/*/bin -type f -name opencode -print -quit) "${pkgdir}/usr/bin"
 }

OpenCode version

1.0.72

Steps to reproduce

  1. try to build your PKGBUILD
  2. observe error

Screenshot and/or share link

No response

Operating System

Arch Linux

Terminal

Alacritty

Originally created by @rubin55 on GitHub (Nov 18, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description You guys are using `find` incorrectly. For some reason, the current build creates 4 binaries, and the current find invocation finds them all and tries to copy them to a single `opencode` target. Next to that, the target directory does not exist yet, so, given multiple sources, `install` expects a directory. Ideally, you would `case` on architecture, and copy precisely the binary you want for `x86-64` or `aarch64`, and check also if you are on a `glibc` system or a `musl` system. If you don't care, and just want the first binary `find` comes up with (...), do this: ```diff diff --git a/PKGBUILD b/PKGBUILD index 0bb248c..aa72e99 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -27,5 +27,6 @@ build() { package() { cd "opencode-${pkgver}/packages/opencode" - install -Dm755 $(find dist/*/bin/opencode) "${pkgdir}/usr/bin/opencode" + mkdir -p "${pkgdir}/usr/bin" + install -Dm755 $(find dist/*/bin -type f -name opencode -print -quit) "${pkgdir}/usr/bin" } ``` ### OpenCode version 1.0.72 ### Steps to reproduce 1. try to build your `PKGBUILD` 2. observe error ### Screenshot and/or share link _No response_ ### Operating System Arch Linux ### Terminal Alacritty
yindo added the opentuibug labels 2026-02-16 17:37:56 -05:00
yindo closed this issue 2026-02-16 17:37:56 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 18, 2025):

gahhh we will fix this apologies

@rekram1-node commented on GitHub (Nov 18, 2025): gahhh we will fix this apologies
Author
Owner

@rekram1-node commented on GitHub (Nov 19, 2025):

Okay I made a fix I think it should work I tried getting arch setup and im a dumbass and couldnt test it super well but I adjusted script to handle the musl and glibc stuff.

Lmk if it fixed it for you @rubin55

@rekram1-node commented on GitHub (Nov 19, 2025): Okay I made a fix I think it should work I tried getting arch setup and im a dumbass and couldnt test it super well but I adjusted script to handle the musl and glibc stuff. Lmk if it fixed it for you @rubin55
Author
Owner

@rubin55 commented on GitHub (Nov 20, 2025):

@rekram1-node I suppose publish.ts resulting artifacts are a PKGBUILD, but I don't see it in the AUR yet!

@rubin55 commented on GitHub (Nov 20, 2025): @rekram1-node I suppose `publish.ts` resulting artifacts are a `PKGBUILD`, but I don't see it in the AUR yet!
Author
Owner

@rekram1-node commented on GitHub (Nov 20, 2025):

dumb script bug, fixing, releasing

@rekram1-node commented on GitHub (Nov 20, 2025): dumb script bug, fixing, releasing
Author
Owner

@rekram1-node commented on GitHub (Nov 20, 2025):

I need to make smoke tests for aur builds

@rekram1-node commented on GitHub (Nov 20, 2025): I need to make smoke tests for aur builds
Author
Owner

@rekram1-node commented on GitHub (Nov 20, 2025):

Okay released @rubin55

@rekram1-node commented on GitHub (Nov 20, 2025): Okay released @rubin55
Author
Owner

@rubin55 commented on GitHub (Nov 20, 2025):

@rekram1-node just tested the AUR build for 1.0.81, success! Thanks a bunch!

@rubin55 commented on GitHub (Nov 20, 2025): @rekram1-node just tested the AUR build for 1.0.81, success! Thanks a bunch!
Author
Owner

@rekram1-node commented on GitHub (Nov 20, 2025):

Yayyy finally

Okay NO more touching build script XD

@rekram1-node commented on GitHub (Nov 20, 2025): Yayyy finally Okay NO more touching build script XD
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2948