[DRE-maint] Bug#1104967: gitlab: undefined errors on github.com/tklauser/go-sysconf
zhangdandan
zhangdandan at loongson.cn
Fri May 9 08:39:18 BST 2025
Source: gitlab
Version: 17.6.5-15
Severity: normal
Tags: patch
User: debian-loongarch at lists.debian.org
Usertags: loong64
Dear maintainers,
Compiling the gitlab failed for loong64 in the Debian Package
Auto-Building environment.
The error log is as follows,
```
# gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:20:10:
undefined: _BC_BASE_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:22:10:
undefined: _BC_DIM_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:24:10:
undefined: _BC_SCALE_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:26:10:
undefined: _BC_STRING_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:28:10:
undefined: _COLL_WEIGHTS_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:30:10:
undefined: _EXPR_NEST_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:32:10:
undefined: _HOST_NAME_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:34:10:
undefined: _LINE_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:36:10:
undefined: _LOGIN_NAME_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:40:10:
undefined: _RE_DUP_MAX
src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go:40:10:
too many errors
```
The full build log can be found at
https://buildd.debian.org/status/fetch.php?pkg=gitlab&arch=loong64&ver=17.6.5-15&stamp=1746215926&raw=0.
After analyzing, I found that go.mod is ignored and only use system
file, for examples,
```
gitlab-17.6.5# ls -al
_build/src/gitlab.com/gitlab-org/gitlab/vendor/github.com/tklauser/go-sysconf
|grep tklauser
lrwxrwxrwx 1 root root 108 4月 3日 21:08 example_test.go ->
/usr/share/gocode/src/gitlab.com/gitlab-org/gitaly/v16/vendor/github.com/tklauser/go-sysconf/example_test.go
lrwxrwxrwx 1 root root 105 4月 3日 21:08 mksysconf.go ->
/usr/share/gocode/src/gitlab.com/gitlab-org/gitaly/v16/vendor/github.com/tklauser/go-sysconf/mksysconf.go
lrwxrwxrwx 1 root root 107 4月 3日 21:08 sysconf_bsd.go ->
/usr/share/gocode/src/gitlab.com/gitlab-org/gitaly/v16/vendor/github.com/tklauser/go-sysconf/sysconf_bsd.go
......
lrwxrwxrwx 1 root root 111 4月 3日 21:08 sysconf_generic.go ->
/usr/share/gocode/src/gitlab.com/gitlab-org/gitaly/v16/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go
```
The file
/usr/share/gocode/src/gitlab.com/gitlab-org/gitaly/v16/vendor/github.com/tklauser/go-sysconf/sysconf_generic.go
is provided by golang-gitlab-gitlab-org-gitaly-dev(gitaly).
Please consider the patch I attached.
- For gitlab(attached patch gitlab-update-go.mod.patch)
need to update github.com/tklauser/go-sysconf's version in go.mod and
go.sum.
loong64 was supported in release
https://github.com/tklauser/go-sysconf/blob/v0.3.15.
- For gitaly(attached patch
gitaly-update-tklauser-go-sysconf-for-loong64.patch)
use vendor in gitaly source package.
github.com/tklauser/go-sysconf v0.3.9 is too old which do not support
loong64.
I tested that I use github.com/tklauser/go-sysconf v0.3.15 is not useful
in go.mod.
Based on the attached patch
gitaly-update-tklauser-go-sysconf-for-loong64.patch(need to add patch
for vendor directory), gitlay was built successfully on locally.
Based on my local gitlay(re-install golang-gitlab-gitlab-org-gitaly-dev
with loong64 support in my system), gitlab was built successfully on
locally.
BTW, I suggest regenerating go.mod and go.sum for gitaly and gitlab
source package.
Your opinions are welcome.
Best regards,
Dandan Zhang
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gitlab-update-go.mod.patch
Type: text/x-patch
Size: 3913 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-ruby-extras-maintainers/attachments/20250509/a3c0a488/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gitaly-update-tklauser-go-sysconf-for-loong64.patch
Type: text/x-patch
Size: 7673 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-ruby-extras-maintainers/attachments/20250509/a3c0a488/attachment-0003.bin>
More information about the Pkg-ruby-extras-maintainers
mailing list