FS#74310 - [golang-github-nfnt-resize] FTBFS

Attached to Project: Community Packages
Opened by Piggy NL (piggynl) - Saturday, 02 April 2022, 12:31 GMT
Last edited by Jelle van der Waa (jelly) - Sunday, 24 September 2023, 10:41 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Package version: 0.0.20180222-2

Build log:
```
==> Retrieving sources...
-> Found golang-github-nfnt-resize-83c6a9932646f83e3267f353373d47347b6036b2.tar.gz
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
-> Extracting golang-github-nfnt-resize-83c6a9932646f83e3267f353373d47347b6036b2.tar.gz with bsdtar
==> Starting check()...
pattern ./...: directory prefix . does not contain main module or its selected dependencies
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
==> ERROR: A failure occurred in check().
Aborting...
```

It is caused by missing go.mod file. Since 1.16, golang will build packages in module-aware mode by default, see: https://go.dev/blog/go116-module-changes#modules-on-by-default

Solution: Apply this patch to PKGBUILD.

```
--- PKGBUILD
+++ PKGBUILD
@@ -9,8 +9,15 @@ arch=('any')
url="https://github.com/nfnt/resize"
license=('custom:ISC')
depends=('go')
-source=("$pkgname-$_commit.tar.gz::https://github.com/nfnt/resize/archive/$_commit.tar.gz")
-sha512sums=('658fe80affcdf5df30009daeb3879406e42c7beb40267a8f3fd55e0522d701cb6db794018fbdd6fb04fc6ee7e464ba612d0aa691867fa6dbe297e29e26b8b298')
+source=("$pkgname-$_commit.tar.gz::https://github.com/nfnt/resize/archive/$_commit.tar.gz"
+ "$pkgname-add-go_mod.patch::https://github.com/nfnt/resize/pull/70.patch")
+sha512sums=('658fe80affcdf5df30009daeb3879406e42c7beb40267a8f3fd55e0522d701cb6db794018fbdd6fb04fc6ee7e464ba612d0aa691867fa6dbe297e29e26b8b298'
+ 'fc398cbd4a399e98026f2e5384ca8628208fd1f97604458c10db4452037987d4cf7205e50f0c600c1de8ca491f8c2926bb6439bf19fb35df36ba6866a4234016')
+prepare() {
+ cd "$srcdir/resize-$_commit"
+
+ patch -Np1 -i "$srcdir/$pkgname-add-go_mod.patch"
+}

check() {
export GOPATH="$srcdir/build:/usr/share/gocode"
```
This task depends upon

Closed by  Jelle van der Waa (jelly)
Sunday, 24 September 2023, 10:41 GMT
Reason for closing:  Deferred
Additional comments about closing:  Dropped from repos

Loading...