Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 490280 - ninja_src_make in cmake-utils.eclass takes all MAKEOPTS and fails for unknown option
Summary: ninja_src_make in cmake-utils.eclass takes all MAKEOPTS and fails for unknown...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-03 15:31 UTC by Dmitry Derevyanko
Modified: 2014-01-25 04:07 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,19.42 KB, application/x-info)
2013-11-03 15:31 UTC, Dmitry Derevyanko
Details
build.log (build.log,316.22 KB, text/plain)
2013-11-03 15:31 UTC, Dmitry Derevyanko
Details
emerge --debug gromacs (eclass-debug.log,5.43 KB, text/plain)
2013-11-03 15:31 UTC, Dmitry Derevyanko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Derevyanko 2013-11-03 15:31:05 UTC
Unknown for ninja make options lead to build fail.

Reproducible: Always

Steps to Reproduce:
1. MAKEOPTS="-j8 -s"
2.emerge gromacs (for example)
3. ninja: invalid option -- 's'
Comment 1 Dmitry Derevyanko 2013-11-03 15:31:24 UTC
Created attachment 362490 [details]
emerge --info
Comment 2 Dmitry Derevyanko 2013-11-03 15:31:38 UTC
Created attachment 362492 [details]
build.log
Comment 3 Dmitry Derevyanko 2013-11-03 15:31:56 UTC
Created attachment 362494 [details]
emerge --debug gromacs
Comment 4 Mike Gilbert gentoo-dev 2013-11-03 15:42:33 UTC
@kde: While you are touching the eclass, please clean up the indentation in that ninja_src_make function as well.
Comment 5 Mike Gilbert gentoo-dev 2013-11-03 16:26:30 UTC
Here's a function based loosely on scons_clean_makeopts from scons.eclass. It discards everything except the -j, -l, and -k options.

ninjaopts_from_makeopts() {
	if [[ ${NINJAOPTS+set} == set ]]; then
		return 0
	fi
	local ninjaopts=()
	set -- ${MAKEOPTS}
	while (( $# )); do
		case $1 in
			-j|-l|-k)
				ninjaopts+=( $1 $2 )
				shift 2
				;;
			-j*|-l*|-k*)
				ninjaopts+=( $1 )
				shift 1
				;;
		esac
	done
	export NINJAOPTS="${ninjaopts[*]}"
}
Comment 6 Mike Gilbert gentoo-dev 2013-11-03 16:29:45 UTC
(In reply to Mike Gilbert from comment #5)

Need to add this to the case statement:

*) shift ;;
Comment 7 Michael Palimaka (kensington) gentoo-dev 2013-11-08 15:30:55 UTC
I don't think anyone in KDE uses ninja, so please feel free to commit if it works for you.
Comment 8 Johannes Huber gentoo-dev 2013-12-15 11:59:51 UTC
(In reply to Michael Palimaka (kensington) from comment #7)
> I don't think anyone in KDE uses ninja, so please feel free to commit if it
> works for you.

Ack please apply it if its working, nobody in KDE uses ninja.
Comment 9 Christoph Junghans gentoo-dev 2014-01-09 05:50:10 UTC
(In reply to Johannes Huber from comment #8)
> (In reply to Michael Palimaka (kensington) from comment #7)
> > I don't think anyone in KDE uses ninja, so please feel free to commit if it
> > works for you.
> 
> Ack please apply it if its working, nobody in KDE uses ninja.
I originally added ninja support in cmake-utils for gromacs. Changes look good to me!

Looking at ninja --help:
  -j N     run N jobs in parallel [default=6, derived from CPUs available]
 
So -j is actually unnecessary as the default is already quite reasonable.
Comment 10 Mike Gilbert gentoo-dev 2014-01-09 16:59:37 UTC
Thanks for weighing in. ^_^

I will try to get this committed this weekend if nobody beats me to it.
Comment 11 Mike Gilbert gentoo-dev 2014-01-25 04:07:21 UTC
+  25 Jan 2014; Mike Gilbert <floppym@gentoo.org> cmake-utils.eclass:
+  Improve support for ninja, bug 490280.
+