build-pkgs / libvirt-python.spec / bad %if condition

Bug #1799735 reported by Volker
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
High
Al Bailey

Bug Description

Brief Description
-----------------
i get stuck on build the install ISO, is there a pre-compiled ISO available? based on this doku https://docs.starlingx.io/developer_guide/index.html#build-packages it crashes on step 4, i get this error:

error: parse error in expression
error: /localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild/SPECS/libvirt-python.spec:131: bad %if condition

Severity
--------
Critical - only for build-ISO

Steps to Reproduce
------------------
just follow this guide step by step: https://docs.starlingx.io/developer_guide/index.html

Expected Behavior
------------------
it should build all the given packages

Actual Behavior
----------------
it craches with given error

Reproducibility
---------------
<Reproducible/Intermittent>
100% reproducible. i have install a fresh ubuntu 18.04 maschine to build a ISO, two times!

System Configuration
--------------------
a fresh installed ubuntu 18.04 deployed by MAAS

Branch/Pull Time/Commit
-----------------------
round about 2018-10-24 14:00 UTC+1

Timestamp/Logs
--------------
15:31:05 ============ Build failed =============
15:31:05 b1: ===== Build SRPM for 'libvirt-python' =====
15:31:05 b1: PKG_BASE=/localdisk/designer/ubuntu/starlingx/cgcs-root/stx/stx-integ/virt/libvirt-python
15:31:05 b1: BUILD_DIR=libvirt-python/rpmbuild
15:31:05 b1: SRPM_DIR=/localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild/SRPMS
15:31:05 b1: Wrote: /localdisk/loadbuild/ubuntu/starlingx/std/rpmbuild/SOURCES/libvirt-python/srpm_input.md5
15:31:05 b1: Rebuild required due to missing reference md5: /localdisk/loadbuild/ubuntu/starlingx/std/rpmbuild/SOURCES/libvirt-python/srpm_reference.md5
15:31:05 b1: Rebuild required due no src.rpm in directory: '/localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild/SRPMS'
15:31:05 b1: clean_srpm_dir build_idx=1 DIR=/localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild/SRPMS
15:31:05 b1: arf rm -rf /localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python
15:31:05 b1: libvirt-python.spec
15:31:05 b1: libvirt-python-4.7.0
15:31:05 b1: srpm_apply_meta_patches '/localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild' '/localdisk/designer/ubuntu/starlingx/cgcs-root/stx/stx-integ/virt/libvirt-python' 0 'centos' 'libvirt-python-4.7.0-1.fc28'
15:31:05 b1: Applying metadata patches
15:31:05 b1: srpm_apply_patch '/localdisk/designer/ubuntu/starlingx/cgcs-root/stx/stx-integ/virt/libvirt-python/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch' '-p1' '/localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild' 0 'WRS: ' '0' '' '' '' '' 0 'libvirt-python-4.7.0-1.fc28' ''
15:31:05 b1: patch -p1 < /localdisk/designer/ubuntu/starlingx/cgcs-root/stx/stx-integ/virt/libvirt-python/centos/meta_patches/0001-Update-package-versioning-for-TIS-format.patch
15:31:05 b1: patching file SPECS/libvirt-python.spec
15:31:05 b1: srpm_apply_patch '/localdisk/designer/ubuntu/starlingx/cgcs-root/stx/stx-integ/virt/libvirt-python/centos/meta_patches/0002-Build-python-wheel.patch' '-p1' '/localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild' 0 'WRS: ' '0' '' '' '' '' 0 'libvirt-python-4.7.0-1.fc28' ''
15:31:05 b1: patch -p1 < /localdisk/designer/ubuntu/starlingx/cgcs-root/stx/stx-integ/virt/libvirt-python/centos/meta_patches/0002-Build-python-wheel.patch
15:31:05 b1: patching file SPECS/libvirt-python.spec
15:31:05 b1: ‘/localdisk/designer/ubuntu/starlingx/cgcs-root/stx/stx-integ/virt/libvirt-python/centos/patches/0001-Fix-setup-import-to-support-building-wheel.patch’ -> ‘/localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild/SOURCES/./0001-Fix-setup-import-to-support-building-wheel.patch’
15:31:05 b1: SPEC file: /localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild/SPECS/libvirt-python.spec
15:31:05 b1: SRPM build directory: /localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild
15:31:05 b1: TIS_PATCH_VER: 2
15:31:05 b1: error: parse error in expression
15:31:05 b1: error: /localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild/SPECS/libvirt-python.spec:131: bad %if condition
15:31:05 b1: ERROR: srpm_assemble (1296): rpmbuild failed: rpmbuild -bs /localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild/SPECS/libvirt-python.spec --define='%_topdir /localdisk/loadbuild/ubuntu/starlingx/std/srpm_assemble/libvirt-python/rpmbuild' --define='_tis_dist .tis' --undefine=dist
15:31:05 b1: ERROR: build_dir_srpm (802): failed to assemble srpm for 'libvirt-python-4.7.0-1.fc28'
15:31:05 ERROR: reaper (1302): Failed to build src.rpm from source at 'b1'
15:31:05

######## Wed Oct 24 15:31:05 UTC 2018: build-srpm-parallel --std failed with rc=1

Wed Oct 24 15:31:05 UTC 2018: build-srpm-parallel --std failed with rc=1

Ghada Khalil (gkhalil)
tags: added: stx.build
Changed in starlingx:
importance: Undecided → High
assignee: nobody → Bruce Jones (brucej)
Revision history for this message
Hayde Martinez (haydemtz) wrote :

Hi Volker,

I am also seeing this issue in Master, can you try building branch r/2018.10?
this one is the release branch :)

Revision history for this message
Erich Cordoba (ericho) wrote :

Thanks Volker for the report.

This bug seems to be related with this patch: http://git.starlingx.io/cgit/stx-integ/tree/virt/libvirt-python/centos/meta_patches/0002-Build-python-wheel.patch recently merged.

It turns out that the "%py2_build_wheel" macro expansion causes a syntax problem when is inside a %if statement.

The macro expands to:

rpmbuild -E %py2_build_wheel
\
  CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic" /usr/bin/python2 setup.py bdist_wheel
  sleep 1

I'm wondering if that "\" is the problem

Ghada Khalil (gkhalil)
Changed in starlingx:
assignee: Bruce Jones (brucej) → Don Penney (dpenney)
Revision history for this message
Ghada Khalil (gkhalil) wrote :

stx.2019.03 - issue impacts stx master only

Changed in starlingx:
assignee: Don Penney (dpenney) → Al Bailey (albailey1974)
status: New → In Progress
tags: added: stx.2019.03
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to stx-integ (master)

Reviewed: https://review.openstack.org/613148
Committed: https://git.openstack.org/cgit/openstack/stx-integ/commit/?id=b9d034298ff98e7c8c516ee260ebd9e8d88ed110
Submitter: Zuul
Branch: master

commit b9d034298ff98e7c8c516ee260ebd9e8d88ed110
Author: Al Bailey <email address hidden>
Date: Wed Oct 24 14:51:42 2018 -0500

    libvirt-python spec was failing to build

    The py2_build_wheel macro was evaluating to a command
    that failed to build libvirt-python.

    libvirt-python has its own set of CFLAGS so those are
    being used.

    This also fixes the scenario where a non centos build env
    would have been missing the BuildRequires for the wheel command.

    Closes-Bug: 1799735
    Change-Id: Ib9cf8a120069fa15f1832c925c2ba56c6ee8e971
    Signed-off-by: Al Bailey <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ken Young (kenyis)
tags: added: stx.2019.05
removed: stx.2019.03
Ken Young (kenyis)
tags: added: stx.2.0
removed: stx.2019.05
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.