Bug 244671 - www/gitea: 1.11.2 build fail
Summary: www/gitea: 1.11.2 build fail
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Adam Weinberger
Depends on: 244898
  Show dependency treegraph
Reported: 2020-03-08 10:13 UTC by rozhuk.im
Modified: 2020-06-28 17:29 UTC (History)
3 users (show)

See Also:
stb: maintainer-feedback+

patch (1.25 KB, patch)
2020-03-09 11:20 UTC, rozhuk.im
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rozhuk.im 2020-03-08 10:13:32 UTC
===>  License MIT accepted by the user
===>   gitea-1.11.2 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by gitea-1.11.2 for building
===>  Extracting for gitea-1.11.2
=> SHA256 Checksum OK for gitea-src-1.11.2.tar.gz.
===>  Patching for gitea-1.11.2
echo 1.11.2 >/tmp/ports/usr/ports/www/gitea/work/gitea-1.11.2/VERSION
===>   gitea-1.11.2 depends on executable: gmake - found
===>   gitea-1.11.2 depends on file: /usr/local/bin/go - found
===>   gitea-1.11.2 depends on file: /usr/local/bin/ccache - found
===>  Configuring for gitea-1.11.2
===>  Building for gitea-1.11.2
gmake[2]: Entering directory '/tmp/ports/usr/ports/www/gitea/work/gitea-1.11.2'
grep: repetition-operator operand invalid
Gitea requires Go 1.11.0 or greater to build. You can get it at https://golang.org/dl/
gmake[2]: *** [Makefile:127: go-check] Error 1
gmake[2]: Leaving directory '/tmp/ports/usr/ports/www/gitea/work/gitea-1.11.2'
*** Error code 1
Comment 1 stb 2020-03-08 10:16:29 UTC
Let me take a peek. I swear this was working just fine yesterday.

Which FreeBSD version are you on, and which architecture?
Comment 2 stb 2020-03-08 10:31:47 UTC
It's working fine in my test system FreeBSD 12.1-RELEASE-p1 GENERIC amd64. I have all the latest packages installed, in particular go-1.13.5,1.
Comment 3 rozhuk.im 2020-03-08 10:45:05 UTC
12.1 stable
Also I use:
# Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
probably this changes grep behavior.
Comment 4 rozhuk.im 2020-03-08 18:04:27 UTC
Makefile in gitea src contains:
	$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?[[:space:]]' | tr '.' ' ');))
	$(eval NODE_VERSION := $(shell printf "%03d%03d%03d" $(shell node -v | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?' | tr '.' ' ');))

I try in console:
go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?[[:space:]]'
grep: repetition-operator operand invalid
Comment 5 rozhuk.im 2020-03-09 11:20:52 UTC
Created attachment 212284 [details]

This patch fix build issue for me.
Comment 6 Adam Weinberger freebsd_committer 2020-03-12 12:25:34 UTC
I don't have any boxes with WITH_BSD_GREP, but can you try

  go version | grep -Eo '[0-9]+\.?[0-9]*\.?[0-9]?[[:space:]]'

`[0-9]+?` seems like a silly way to express `[0-9]*`, so I wonder if BSD grep chokes on it.
Comment 7 rozhuk.im 2020-03-12 18:59:58 UTC
(In reply to Adam Weinberger from comment #6)

# go version | grep -Eo '[0-9]+\.?[0-9]*\.?[0-9]?[[:space:]]'
Comment 8 Adam Weinberger freebsd_committer 2020-03-12 23:06:06 UTC
Ok. Then it's probably better to turn the regex into that, rather than removing the checks entirely.
Comment 9 rozhuk.im 2020-03-14 04:24:49 UTC
Comment 10 Adam Weinberger freebsd_committer 2020-03-17 00:12:36 UTC
Hi. Maintainer, do you know what you'd like to do here? Should we utilize the regex?
Comment 11 stb 2020-03-18 20:33:34 UTC
(In reply to Adam Weinberger from comment #10)
Changing the expression seems reasonable.

bsdgrep is included in the base as bsdgrep, so I tried:
[vagrant@porttest-12 ~]$ go version | grep -Eo '[0-9]+\.?[0-9]*\.?[0-9]?[[:space:]]'
[vagrant@porttest-12 ~]$ go version | bsdgrep -Eo '[0-9]+\.?[0-9]*\.?[0-9]?[[:space:]]'

I think we can do this. I will open a Github issue to have that changed upstream, but we can use a patch in the meantime.

I'm still looking at the LDFLAGS issue.
Comment 13 stb 2020-03-18 21:16:56 UTC
Should be fixed by bug 244898. Thanks adamw!
Comment 14 Adam Weinberger freebsd_committer 2020-04-12 16:22:29 UTC
Can this PR be closed?
Comment 15 rozhuk.im 2020-04-12 17:09:16 UTC
Comment 16 rozhuk.im 2020-06-28 17:25:59 UTC

===>  Building for gitea-1.11.8
gmake[2]: Entering directory '/tmp/ports/usr/ports/www/gitea/work/gitea-1.11.8'
grep: repetition-operator operand invalid
Gitea requires Go 1.11.0 or greater to build. You can get it at https://golang.org/dl/
Comment 17 stb 2020-06-28 17:29:27 UTC
My apologies, I did not remember that there was an issue with bsdgrep, and only tested with the default base grep. Since Gitea changed the grep expressions, I assumed that our local patch was not needed anymore.

I'll investigate.