Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1064476 - macros's lack of effect on mock build process??
Summary: macros's lack of effect on mock build process??
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mock
Version: 6.5
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Tomas Smetana
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-12 16:43 UTC by lejeczek
Modified: 2014-03-04 08:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-04 08:12:47 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description lejeczek 2014-02-12 16:43:57 UTC
Description of problem:

mock seems not to notice params like:
 --define --with
I'm specifically trying to change optflags

having a custom macro in my .rpmmacros and using --with causes nothing
supplying --define in mock command line causes nothing neither

using:

config_opts['macros']['%optflags'] = "-O3 -g -pipe -Wall"

in mock conf causes:

CRITICAL:yum.cli:Config Error: Parsing file failed: File contains no section headers.
file: file:///__.aLocalStorages/vertex3.a/mock/epel-6-x86_64/root///etc/yum/yum.conf, line: 2
'config_opts[\'macros\'][\'%optflags\'] = "-O3 -g -pipe -Wall"\

Version-Release number of selected component (if applicable):

mock-1.1.32-1.el6.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 lejeczek 2014-02-13 13:10:00 UTC
macros/variables define like

config_opts['macros']['%gcc'] = '%(gcc -v 2>&1 | tail -n1 | cut -d\  -f1,3)'
or
--define "packager %(gcc -v 2>&1 | tail -n1 | cut -d\  -f1,3)"

is see end up in .macros in builddir but they don't get through to result rpm package??

and only those executing shell commands
is there any way to execute and pass shell vars to mack build process?

Comment 3 Tomas Smetana 2014-02-14 09:32:29 UTC
As for the usage of shell scripts for the macro values expansion: I don't think it's possible.

I'll take a look at the problem with the optflags...

Comment 4 lejeczek 2014-02-14 12:04:11 UTC
just to be on the same page, it's possible with rpmbuild, if macros shell exec are in .rpmmacros, right? it works for me - I assumed would work with mock too

optflags - please ignore the CRITICAL:.... - my mistake
but still, these are also ignored when defined like:

config_opts['macros']['%optflags'] = "-O3 -g -pipe -Wall"

only way that worked for me was:
config_opts['files']['etc/rpmrc'] = """
optflags: x86_64 -O3 -g ....
....
as it is ignored with --define "optflags ..." (although seems to work with rpmbuild)

which is quite a pity, similarly with .rpmrc now not taking most of the options, actually optflags seem to work only from .rpmrc

I, guess others too would hope for config files to be an ultimate and final place-holder for customizations, well, passing in shell var and outputs would be nice too, but necessity to use config_opts['files'] for macros? I don't know
Interestingly .rpmmacros in buildir gets the content declared in config_opts['macros'], but shell passed-on values and optflags don't seem to work from there,

I'm thinking, it could be that both mock and rpmbuild do NOT honour optflags from .rpmmacros but only! from .rpmrc(doesnt' work for mock, only /etc/rpmrc) and for rpmbuild --define "optflags is ok

many thanks

Comment 5 Tomas Smetana 2014-02-14 12:27:11 UTC
The local .rpmrc is ignored: mock runs in chrooted environment so any user configuration is irrelevant.

Comment 6 lejeczek 2014-02-14 12:53:48 UTC
I'm taking about only stuff in in chroot,
.rpmrc in buildroot is ignored but /etc/rpmrc in top dir is not

Comment 7 lejeczek 2014-02-14 12:57:50 UTC
well, as I said earlier, some bits from .rpmmacros are ignored
again, only taking about chroot

Comment 8 lejeczek 2014-02-14 15:35:31 UTC
oughh. how weird this rpmbuild toolchains is
now not in mock
but in your regular .rpmmacros
see what this:

%_host_vendor %(echo ${HOSTNAME\%\%.*})

rpm --eval %{_host_vendor}

gets you. How come??! % - holds a special meaning? if yes then what I'm trying to have, is it feasible?

should it got as a bug report?

Comment 9 Tomas Smetana 2014-02-19 10:58:32 UTC
I'm sorry to say but the questions you ask are much better suited for the proper support channel which Bugzilla is not...  Please use the support entitlement that comes with your RHEL-6 license: withut a proper justification (customer request) the mock package has almost no chance of being updated in RHEL-6 anyway.

Regards.


Note You need to log in before you can comment on or make changes to this bug.