#50 main Packaging Guidelines - update of global
Closed: Fixed None Opened 13 years ago by mmaslano.

In Packaging Guidelines is mentioned that we should use global instead of define, wherever possible. But in guidelines is not mentioned this important sentence:
"Note that %define and %global differ in more ways than just scope: the body of a %define'd macro is lazily expanded (ie when used), but the body of %global is expanded at definition time. It's possible to use %%-escaping to force lazy expansion of %global." [1]

With this information missing I broke perl build, because we had there complicated filtering of requires with lot of defines/globals. Please, mention this sentence in guidelines [2].

[1] http://www.rpm.org/wiki/PackagerDocs/Macros#BuiltinMacros
[2] https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define


Approved (+1:5, 0:0, -1:1)

Announce text:

In the "%global preferred over %define" section of the Packaging Guidelines, a clarification note was added:

Note that %define and %global differ in more ways than just scope: the body of a %define'd macro is lazily expanded (ie when used), but the body of %global is expanded at definition time. It's possible to use %%-escaping to force lazy expansion of %global.

https://fedoraproject.org/wiki/Packaging:Guidelines#.25global_preferred_over_.25define

Closing as this has been added.

Metadata Update from @toshio:
- Issue assigned to spot

7 years ago

Login to comment on this ticket.

Metadata