Bug 1733898

Summary: octave noarch packages fail: "BuildArch" not repected from spec?
Product: [Fedora] Fedora Reporter: Colin Macdonald <cbm>
Component: octaveAssignee: Orion Poplawski <orion>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: alex, cbm, fkluknav, jaromir.capik, mmahut, orion, rakesh.pandit, susi.lehtola
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: octave-5.1.0-2.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-31 15:58:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Colin Macdonald 2019-07-29 07:24:34 UTC
TL;DR  Something is eating `buildarch` before macros.octave gets it.  It seems to be set to the actual buildnode hardware rather than "noarch" as my spec files says.

- - - - - 

octave-doctest and octave-symbolic are FTBFS on Rawhide.  The Doctest and Symbolic packages both have "BuildArch: noarch" in their specfiles.

After some testing, I think something has gone wrong about `octave_tar_suffix`.  
AFAICT, `octave_tar_suffix` should be set to "any-none" when the package is noarch.

In Rawhide, %build is still making `doctest-0.7.0-any-none.tar.gz`, but then we %install dies with:

BUILDSTDERR: error: pkg: failed to read package '/builddir/build/BUILD/doctest-0.7.0/build/doctest-0.7.0-armv7hl-redhat-linux-gnu-api-v53.tar.gz': 

Note the "armv7hl-redhat-linux-gnu-api-v53" which is `octave_tar_suffix` but it should've been "any-none" because in macros.octave:

  if (rpm.expand("%{?buildarch}") ~= "noarch") then
    rpm.define("octave_tar_suffix %{octave_host}-%{octave_api}")
  else
    rpm.define("octave_tar_suffix any-none")
  end

- - - - -

Here's a recent scratch with a bit of extra debugging which shows the above behaviour:
https://kojipkgs.fedoraproject.org//work/tasks/5668/36645668/build.log

Note: if I change my package, deleting "BuildArch: noarch", the "doctest-0.7.0-any-none.tar.gz" is still created so that is no solution.

Comment 1 Orion Poplawski 2019-07-31 02:49:50 UTC
Latest rpm no longer sets the buildarch macro due to issues surrounding getting it correct with multiple sub-packages.  I'm working on removing the dependency on that macro.

Comment 2 Colin Macdonald 2019-07-31 20:43:38 UTC
Thanks for the quick fix!  I'm rebuilding -doctest and -symbolic on rawhide.