Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 551152 (bad-nonfatal)

Summary: [TRACKER] Incorrect uses of nonfatal
Product: Quality Assurance Reporter: Michał Górny <mgorny>
Component: TrackersAssignee: Gentoo Quality Assurance Team <qa>
Status: CONFIRMED ---    
Severity: normal Keywords: Tracker
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=451938
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 517976, 551154, 551156, 551158, 551160, 551162, 551164, 551166, 551168, 551170, 551172, 551174, 551178, 551180, 551182, 551184, 551186, 551188, 551190, 551196, 551198, 551200    
Bug Blocks:    

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-06-04 08:52:37 UTC
Ebuilds are full of nonfatal mistakes, so let's start complaining.

Common issues:

1. using nonfatal to ignore faulty ebuild code/laziness -- like 'nonfatal dodoc A B C D',

2. using nonfatal with stuff that calls 'die' (relying on Portage bugs).
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-06-04 09:32:22 UTC
Just to be clear, the correct way of using nonfatal is to disable implicit 'die' call in built-in helpers (like emake), in order to handle the error manually. For example, to perform some additional cleanup before dying or provide custom error message.

Example:

  src_test() {
    food --pidfile "${T}/food.pid"
    nonfatal emake check
    local ret=${?}
    kill "$(<"${T}"/food.pid)"
    [[ ${ret} == 0 ]] || die "Tests fail, oh my"
  }