Bug 1211296 - _hardened_build 0 should turn off hardened build
Summary: _hardened_build 0 should turn off hardened build
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: redhat-rpm-config
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Till Maas
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1192183
TreeView+ depends on / blocked
 
Reported: 2015-04-13 14:11 UTC by Pavel Raiskup
Modified: 2018-01-19 10:24 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-19 10:24:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pavel Raiskup 2015-04-13 14:11:33 UTC
The commit [1] uncovered that the semantics of %_hardened_build macro is kind
of non-intuitive.  One would expect that setting %_hardened_build to 0 would
turn the hardened build off, but it does not.  You need to %undefine
_hardened_build.

IMO, best would be fix the %_hardened_build semantics ASAP, because people
tend to %undefine _hardened_build now.  Or, if this is really desired - could
we set _hardened_build macro to something more obvious (like 'defined') or so?
And possibly clearly document that %undefine turns it off?

[1] http://pkgs.fedoraproject.org/cgit/redhat-rpm-config.git/commit/?id=d9235d2d90
[2] https://lists.fedoraproject.org/pipermail/devel/2015-February/208344.html

Comment 1 Florian Festi 2015-04-15 13:00:41 UTC
Till would you take care of this?

Comment 2 Till Maas 2015-04-15 18:37:26 UTC
(In reply to Pavel Raiskup from comment #0)

> IMO, best would be fix the %_hardened_build semantics ASAP, because people
> tend to %undefine _hardened_build now.  Or, if this is really desired - could
> we set _hardened_build macro to something more obvious (like 'defined') or
> so?
> And possibly clearly document that %undefine turns it off?

it is currently documented on the changes page:
https://fedoraproject.org/wiki/Changes/Harden_All_Packages#Troubleshooting_steps_for_package_maintainers

Actually I am not yet convinced that _hardened_build should stick around forever, since usually all Fedora rpm build flags are always included without a fine-grained way to disable them. For this to decide I would like to have a mass-rebuild of Rawhide, which is delayed for a while now. Last time I checked it was because gcc5 needs to get more stable first. The mass-rebuild will show how many packages are affected and whether it really needs a special configuration option.

Comment 3 Pavel Raiskup 2015-04-15 20:07:03 UTC
(In reply to Till Maas from comment #2)
> (In reply to Pavel Raiskup from comment #0)
>
> > IMO, best would be fix the %_hardened_build semantics ASAP, because people
> > tend to %undefine _hardened_build now.  Or, if this is really desired - could
> > we set _hardened_build macro to something more obvious (like 'defined') or
> > so?
> > And possibly clearly document that %undefine turns it off?
>
> it is currently documented on the changes page:
> https://fedoraproject.org/wiki/Changes/
> Harden_All_Packages#Troubleshooting_steps_for_package_maintainers

Yup, thanks for the link!  But I was rather talking about documentation in
'macros' file.  I bet that is the first place where maintainers look.

Anyway, while you default to '1', should not '0' should turn hardening off
(to make it intuitive)?

> Actually I am not yet convinced that _hardened_build should stick around
> forever since usually all Fedora rpm build flags are always included without
> a fine-grained way to disable them.  For this to decide I would like to have
> a mass-rebuild of Rawhide, which is delayed for a while now. Last time I
> checked it was because gcc5 needs to get more stable first. The mass-rebuild
> will show how many packages are affected and whether it really needs a
> special configuration option.

The idea of _hardened_build removal sounds like a way to push users into
avoiding using %configure macro (or do other hacks)..  for either existing
packages (e.g. PostgreSQL bug 952946) or those which could not be build in
Fedora in future .. (for "some" reason).

Comment 4 Jan Kurik 2015-07-15 14:17:00 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 5 Pavel Raiskup 2015-12-08 22:14:34 UTC
FWIW, gcc has disabled hardening too.  Look at the gcc's changelog, this
is totally misleading.

Comment 6 Fedora End Of Life 2016-11-24 11:41:50 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Pavel Raiskup 2016-11-24 12:11:22 UTC
Unfortunately it is probably too late to change semantics of _hardened_build,
but we could possibly at least document that defining it to '0' doesn't help.

Comment 8 Panu Matilainen 2018-01-19 10:24:34 UTC
Rpm's macro conditionals can only test whether something is defined or not, so there's no nice way to make 0 disable it. Best we can do for now is document it better:
https://src.fedoraproject.org/rpms/redhat-rpm-config/c/3bf139f6467d9cad77ff309a2c1bcf79560c95e5?branch=master

Considering the case closed.


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