Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-7438

%gobuild macro doesn't include BUILDTAGS support

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • go-srpm-macros
    • None
    • None
    • rhel-pt-go
    • ssg_platform_tools
    • 2
    • Dev ack
    • False
    • False
    • Hide

      None

      Show
      None
    • Yes
    • None
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      This bug was initially created as a copy of Bug #2227328

      I am copying this bug because:

      Description of problem:

      %gobuild macro on c8s does not include `BUILDTAGS` in its definition. This needs us to redefine gobuild on container-tools packages to get c8s builds to pass.
      See: https://github.com/containers/podman/blob/main/rpm/podman.spec#L10-L15

      Also, see the %gobuild defs on Fedora v/s C8S

      On C9S

      1. rpm --eval %gobuild

      CGO_CPPFLAGS="D_FORTIFY_SOURCE=2 -fstack-protector-all" go build -compiler gc -buildmode pie '-tags=rpm_crashtraceback libtrust_openssl ' -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '%__global_ldflags'" -a -v -x ;

      On Fedora:
      $ rpm --eval %gobuild

      1. https://pagure.io/go-rpm-macros/pull-request/38
      2. Most of the default LDFLAGS for Fedora are not supported so we don't want
      3. LDFLAGS to be automatically initialized with the Fedora flags.
      1. https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
        GO111MODULE=off \
        go build buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:}" ldflags "${LDFLAGS:} B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -compressdwarf=false -linkmode=external -extldflags '-Wl,-z,relro -Wl,as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,-build-id=sha1 '" -a -v -x ;

              asaezmor Alejandro Saez Morollon
              lmandvek Lokesh Mandvekar
              David Benoit David Benoit
              qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com qe-baseos-tools-bugs@redhat.com
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: