Bug 244671 - www/gitea: 1.11.2 build fail
Summary: www/gitea: 1.11.2 build fail
Status: Closed Overcome By Events
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
URL:
Keywords:
Depends on: 244898
Blocks:
  Show dependency treegraph
 
Reported: 2020-03-08 10:13 UTC by Ivan Rozhuk
Modified: 2020-07-18 19:19 UTC (History)
3 users (show)

See Also:
stb: maintainer-feedback+


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

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 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 Stefan Bethke 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 Stefan Bethke 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 Ivan Rozhuk 2020-03-08 10:45:05 UTC
12.1 stable
Also I use:
WITH_BSD_GREP=
# Install BSD-licensed grep as '[ef]grep' instead of GNU grep.
probably this changes grep behavior.
Comment 4 Ivan Rozhuk 2020-03-08 18:04:27 UTC
Makefile in gitea src contains:
go-check:
	$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.?[0-9]+?\.?[0-9]?[[:space:]]' | tr '.' ' ');))
...
node-check:
	$(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 Ivan Rozhuk 2020-03-09 11:20:52 UTC
Created attachment 212284 [details]
patch

This patch fix build issue for me.
Comment 6 Adam Weinberger freebsd_committer freebsd_triage 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 Ivan Rozhuk 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:]]'
1.14
Comment 8 Adam Weinberger freebsd_committer freebsd_triage 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 Ivan Rozhuk 2020-03-14 04:24:49 UTC
Agree
Comment 10 Adam Weinberger freebsd_committer freebsd_triage 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 Stefan Bethke 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:]]'
1.13.5 
[vagrant@porttest-12 ~]$ go version | bsdgrep -Eo '[0-9]+\.?[0-9]*\.?[0-9]?[[:space:]]'
1.13.5 

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 12 Stefan Bethke 2020-03-18 20:47:10 UTC
https://github.com/go-gitea/gitea/pull/10765
Comment 13 Stefan Bethke 2020-03-18 21:16:56 UTC
Should be fixed by bug 244898. Thanks adamw!
Comment 14 Adam Weinberger freebsd_committer freebsd_triage 2020-04-12 16:22:29 UTC
Can this PR be closed?
Comment 15 Ivan Rozhuk 2020-04-12 17:09:16 UTC
Thanks!
Comment 16 Ivan Rozhuk 2020-06-28 17:25:59 UTC
Again:

===>  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 Stefan Bethke 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.
Comment 18 Stefan Bethke 2020-07-18 11:03:23 UTC
I've just submitted 247613 a patch to update the port to 1.12.2, and I've tested with bsdgrep. It seems the upstream Makefile now works correctly with both kinds of grep.
Comment 19 Adam Weinberger freebsd_committer freebsd_triage 2020-07-18 12:42:20 UTC
Ivan,

If you can confirm that 1.12.2 builds correctly with bsdgrep, I'll close this PR out.
Comment 20 Ivan Rozhuk 2020-07-18 19:19:02 UTC
Fixed, thanks!