#749 Add note about disabling BRP scripts to guidelines
Closed: accepted 4 years ago Opened 4 years ago by mbooth.

I thought we could make a discrete note about disabling BRP scripts in the main guidelines, then other guidelines (such as those proposed in #738) can simply reference this section:


BRP (BuildRoot Policy) Scripts

BRP scripts are injected at the end of %install (via the %__os_install_post macro) and perform some automatic sanity checks of, or adjustments to, files installed in the build root.

All packages SHOULD always be subject to all the BRP scripts, but sometimes it is necessary for a package to opt-out of certain ones. From Fedora 28, it is possible to disable any BRP script simply by undefining the corresponding variable. For example, to disable the brp-python-bytecompile script:

# Turn off Python bytecode compilation because this is a Jython
# package and we will generate JVM bytecode instead
%undefine __brp_python_bytecompile

Any package that disables a BRP script this way MUST also note the reason in an accompanying comment. For a list of the BRP scripts run by default, on F28 and newer invoke: fgrep '%__brp_' /usr/lib/rpm/redhat/macros


Surprisingly, I couldn't find any existing mention in the guidelines of brp scripts, except mentioned in passing in the Python guidelines. Thoughts?


Metadata Update from @mbooth:
- Issue assigned to mbooth
- Issue tagged with: meeting

4 years ago

Yes, this is what I'd planned on drafting, but now I'm happy to not need to do it.

We have never really mentioned the BRP scripts and indeed I don't think most people realize they exist or understand what they do. Things like debuginfo generation have always been a nagging, undebuggable thing so documenting the BRP stuff, even a bit, is still a good thing.

I wonder if %__os_install_post is worth a mention. I don't really want to include (and manage) a list of all of the BRP scripts which are run but it seems mean to talk about these things and not give any way to see a list of them.

Maybe just change the first sentence:

BRP scripts are injected at the end of %install (via the %__os_install_post macro) and perform some automatic sanity checks of, or adjustments to, files installed in the build root.

We discussed this at this weeks meeting (https://meetbot-raw.fedoraproject.org/fedora-meeting-2/2018-02-07/fpc.2018-02-07-18.01.txt):

  • x749 Add note about disabling BRP scripts to guidelines (geppetto,
    18:21:06)
  • ACTION: Add note about disabling BRP scripts to guidelines (+1:5,
    0:0, -1:0) (geppetto, 19:00:24)

Metadata Update from @james:
- Issue untagged with: meeting
- Issue tagged with: writeup

4 years ago

Metadata Update from @mbooth:
- Issue untagged with: writeup
- Issue tagged with: announce

4 years ago

Metadata Update from @tibbs:
- Issue untagged with: announce
- Issue close_status updated to: accepted
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata