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

go-compilers-golang-compiler and go-srpm-macros provide different %gobuild macros

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

    • None
    • rhel-sst-pt-llvm-rust-go
    • 2
    • False
    • False
    • Hide

      None

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

      Description of problem:
      Both go-compilers-golang-compiler-1-20.el8 from CRB repo and go-srpm-macros-2-17.el8 from AppStream provide different versions of %gobuild macro.

      In a system with both installed, %gobuild macro from go-compilers-golang-compiler takes precedence over the definition from go-srpm-macros.

      Version-Release number of selected component (if applicable):
      go-srpm-macros-2-17.el8
      go-compilers-golang-compiler-1-20.el8

      Steps to Reproduce:

      When only go-srpm-macros installed, %gobuild is defined as:

      [root@ci-vm-10-0-138-246 ~]# rpm -qa go-srpm-macros go-compilers-golang-compiler
      go-srpm-macros-2-17.el8.noarch
      [root@ci-vm-10-0-138-246 ~]# rpm -E '%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 ;
      [root@ci-vm-10-0-138-246 ~]#

      Compared to another system with both go-compilers-golang-compiler and go-srpm-macros installed:

      [root@ci-vm-10-0-139-131 ~]# rpm -qa go-srpm-macros go-compilers-golang-compiler
      go-srpm-macros-2-17.el8.noarch
      go-compilers-golang-compiler-1-20.el8.x86_64
      [root@ci-vm-10-0-139-131 ~]# rpm -E '%gobuild'

      %ifnarch ppc64
      go build buildmode pie -compiler gc -tags=rpm_crashtraceback -ldflags "-compressdwarf=false ${LDFLAGS:} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '%__global_ldflags'" -a -v -x ;
      %else
      go build compiler gc -tags=rpm_crashtraceback -ldflags "-compressdwarf=false ${LDFLAGS:} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '%__global_ldflags'" -a -v -x ;
      %endif
      [root@ci-vm-10-0-139-131 ~]#

              go-maint@redhat.com Go Maint
              rhn-support-emachado Edjunior Machado
              David Benoit David Benoit
              Edjunior Machado Edjunior Machado
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: