https://bugzilla.redhat.com/show_bug.cgi?id=1409931
Bug ID: 1409931 Summary: %gobuild incorrectly assumes all compiler flags are compatible with getopt Product: Fedora Version: 25 Component: go-compilers Assignee: jchaloup@redhat.com Reporter: nalin@redhat.com QA Contact: extras-qa@fedoraproject.org CC: fpokorny@redhat.com, golang-updates@lists.fedoraproject.org, jcajka@redhat.com, jchaloup@redhat.com
Description of problem: The current definition of %gobuild:
%gobuild(o:) go build -compiler gc -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -a -v -x %{?**};
produces an (apparently harmless) error message if I try to pass flags that aren't a single character to the macro. (In my case, "-tags".) The set of arguments that the "go" command accepts includes some which are multiple characters long, so if %gobuild is meant to accept them, it needs to be corrected.
Version-Release number of selected component (if applicable): go-compilers-golang-compiler-1-8.fc25.x86_64
How reproducible: Always
Steps to Reproduce: 1. Modify a .spec file to pass build tags ("-tags 'foo bar'") to %gobuild
Actual results: gobuild: invalid option -- 't' error: Unknown option t in gobuild() (build continues)
Expected results: No error message, build continues.
Additional info: This definition seems to accept arbitrary flags and produces the results I expect:
%define gobuild() go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -a -v -x %{**};