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

Bug 447040

Summary: dev-util/cmake src_prepare bootstrap fails when MAKEOPTS has multiple -j options
Product: Gentoo Linux Reporter: Ben Kohler <bkohler>
Component: [OLD] KDEAssignee: Gentoo KDE team <kde>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ~ben/cmake-funny-makeopts.patch

Description Ben Kohler gentoo-dev 2012-12-12 20:45:44 UTC
Created attachment 332168 [details, diff]
~ben/cmake-funny-makeopts.patch

The cmake_src_bootstrap function in current dev-util/cmake ebuilds attempts to pull the -j/--jobs option from MAKEOPTS to pass it to the bootstrap script's --parallel= option.  If MAKEOPTS has multiple -j parameters, eg "-j2 -j3", it grabs the integer from both of them and passes "--parallel=2 3" causing an error.  In this example the bootstrap would die with "Unknown option: 3".

Not many people will pass MAKEOPTS like this, but certain custom setups will "stack" MAKEOPTS, and it is valid according to make.  The attached patch makes it only pass the final -j number, so MAKEOPTS="-j2 -j3" translates to simply "--parallel=3".
Comment 1 Chris Reffett (RETIRED) gentoo-dev Security 2013-01-01 19:26:17 UTC
I can't imagine that this will be reached very often, but added in 2.8.10.2-r1.