[golist] Issue #28: golist fails when new go-1.17 `//go:build` style is used
by Mikel Olasagasti
mikelo2 reported a new issue against the project: `golist` that you are following:
``
golist fails when golang-1.17 new `//go:build` style is used:
```
$ go2rpm https://github.com/google/log4jscanner
//go:build comment without // +build comment
Traceback (most recent call last):
File "/usr/bin/go2rpm", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3.10/site-packages/go2rpm/__main__.py", line 598, in main
buildrequires = to_list(get_buildrequires(forge, subdir))
File "/usr/lib/python3.10/site-packages/go2rpm/__main__.py", line 442, in get_buildrequires
buildrequires = subprocess.check_output(
File "/usr/lib64/python3.10/subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib64/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['golist', '--imported', '--skip-self', '--package-path', 'github.com/google/log4jscanner']' returned non-zero exit status 1.
```
From go-1.17 release notes:
`
The go command now understands //go:build lines and prefers them over // +build lines. The new syntax uses boolean expressions, just like Go, and should be less error-prone. As of this release, the new syntax is fully supported, and all Go files should be updated to have both forms with the same meaning. To aid in migration, gofmt now automatically synchronizes the two forms. For more details on the syntax and migration plan, see https://golang.org/design/draft-gobuild.
`
``
To reply, visit the link below or just reply to this email
https://pagure.io/golist/issue/28
1 year, 10 months
Help with go spec file
by Mark E. Fuller
Hi all,
I'm fairly new to go and am looking to make a spec file and build
jsonnet (https://github.com/google/go-jsonnet/, https://jsonnet.org/).
The go2rpm utility has proven very helpful, but there appear to be two
irregularities with building this package that I don't know offhand how
to address (including from reading
https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/).
1) What is the preferred way to ignore (or remove) unnecessary
BUILD.bazel files? There is one in cmd/ which is obviously not a
buildable command, and so this results in an error in the naive use case.
2) How should nested folders in cmd/ be built? Here, again, the basic
template throws an error since cmd/internal contains no *.go files, only
a BUILD.bezel file and a nested cmd directory.
Thank you all,
fuller
--
Mark E. Fuller, Ph.D.
fuller(a)fedoraproject.org
fuller(a)stossrohr.net
@fuller:one.ems.host
https://www.stossrohr.net
PGP Fingerprint: 73F1 A30C BDF4 DB4B C75F FD0F D599 E76C FFCA BF60
1 year, 11 months