* [gentoo-dev] [PATCH] cmake-utils.eclass: die if ninja is enabled but not installed @ 2015-10-15 15:44 Michael Palimaka 2015-10-15 16:04 ` Michał Górny 0 siblings, 1 reply; 6+ messages in thread From: Michael Palimaka @ 2015-10-15 15:44 UTC (permalink / raw To: gentoo-dev; +Cc: Michael Palimaka This could happen if ninja is manually enabled (eg. make.conf) but not installed --- eclass/cmake-utils.eclass | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 480cd09..012b13f 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -228,6 +228,11 @@ _generator_to_use() { case ${CMAKE_MAKEFILE_GENERATOR} in ninja) + # if ninja is enabled but not installed, the build could fail + # this could happen if ninja is manually enabled (eg. make.conf) but not installed + if ! has_version dev-util/ninja; then + die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." + fi generator_name="Ninja" ;; emake) -- 2.4.9 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] [PATCH] cmake-utils.eclass: die if ninja is enabled but not installed 2015-10-15 15:44 [gentoo-dev] [PATCH] cmake-utils.eclass: die if ninja is enabled but not installed Michael Palimaka @ 2015-10-15 16:04 ` Michał Górny 2015-10-15 16:22 ` [gentoo-dev] " Michael Palimaka 0 siblings, 1 reply; 6+ messages in thread From: Michał Górny @ 2015-10-15 16:04 UTC (permalink / raw To: gentoo-dev, Michael Palimaka; +Cc: Michael Palimaka Dnia 15 października 2015 17:44:47 CEST, Michael Palimaka <kensington@gentoo.org> napisał(a): >This could happen if ninja is manually enabled (eg. make.conf) but not >installed >--- > eclass/cmake-utils.eclass | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass >index 480cd09..012b13f 100644 >--- a/eclass/cmake-utils.eclass >+++ b/eclass/cmake-utils.eclass >@@ -228,6 +228,11 @@ _generator_to_use() { > > case ${CMAKE_MAKEFILE_GENERATOR} in > ninja) >+ # if ninja is enabled but not installed, the build could fail >+ # this could happen if ninja is manually enabled (eg. make.conf) >but not installed >+ if ! has_version dev-util/ninja; then I'd suggest avoiding has_version and just checking for the binary. type -P, I think. Ciaran can give you the rationale, I believe. >+ die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not >installed. Please install dev-util/ninja or unset >CMAKE_MAKEFILE_GENERATOR." >+ fi > generator_name="Ninja" > ;; > emake) -- Best regards, Michał Górny ^ permalink raw reply [flat|nested] 6+ messages in thread
* [gentoo-dev] Re: [PATCH] cmake-utils.eclass: die if ninja is enabled but not installed 2015-10-15 16:04 ` Michał Górny @ 2015-10-15 16:22 ` Michael Palimaka 2015-10-17 17:37 ` Michał Górny 0 siblings, 1 reply; 6+ messages in thread From: Michael Palimaka @ 2015-10-15 16:22 UTC (permalink / raw To: gentoo-dev On 16/10/15 03:04, Michał Górny wrote: > > > Dnia 15 października 2015 17:44:47 CEST, Michael Palimaka <kensington@gentoo.org> napisał(a): >> This could happen if ninja is manually enabled (eg. make.conf) but not >> installed >> --- >> eclass/cmake-utils.eclass | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass >> index 480cd09..012b13f 100644 >> --- a/eclass/cmake-utils.eclass >> +++ b/eclass/cmake-utils.eclass >> @@ -228,6 +228,11 @@ _generator_to_use() { >> >> case ${CMAKE_MAKEFILE_GENERATOR} in >> ninja) >> + # if ninja is enabled but not installed, the build could fail >> + # this could happen if ninja is manually enabled (eg. make.conf) >> but not installed >> + if ! has_version dev-util/ninja; then > > I'd suggest avoiding has_version and just checking for the binary. type -P, I think. Ciaran can give you the rationale, I believe. There's no guarantee that the binary will be provided by dev-util/ninja (we've had a bug about this already). ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] Re: [PATCH] cmake-utils.eclass: die if ninja is enabled but not installed 2015-10-15 16:22 ` [gentoo-dev] " Michael Palimaka @ 2015-10-17 17:37 ` Michał Górny 2015-10-17 17:49 ` Matt Turner 0 siblings, 1 reply; 6+ messages in thread From: Michał Górny @ 2015-10-17 17:37 UTC (permalink / raw To: Michael Palimaka; +Cc: gentoo-dev [-- Attachment #1: Type: text/plain, Size: 1366 bytes --] On Fri, 16 Oct 2015 03:22:48 +1100 Michael Palimaka <kensington@gentoo.org> wrote: > On 16/10/15 03:04, Michał Górny wrote: > > > > > > Dnia 15 października 2015 17:44:47 CEST, Michael Palimaka <kensington@gentoo.org> napisał(a): > >> This could happen if ninja is manually enabled (eg. make.conf) but not > >> installed > >> --- > >> eclass/cmake-utils.eclass | 5 +++++ > >> 1 file changed, 5 insertions(+) > >> > >> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass > >> index 480cd09..012b13f 100644 > >> --- a/eclass/cmake-utils.eclass > >> +++ b/eclass/cmake-utils.eclass > >> @@ -228,6 +228,11 @@ _generator_to_use() { > >> > >> case ${CMAKE_MAKEFILE_GENERATOR} in > >> ninja) > >> + # if ninja is enabled but not installed, the build could fail > >> + # this could happen if ninja is manually enabled (eg. make.conf) > >> but not installed > >> + if ! has_version dev-util/ninja; then > > > > I'd suggest avoiding has_version and just checking for the binary. type -P, I think. Ciaran can give you the rationale, I believe. > > There's no guarantee that the binary will be provided by dev-util/ninja > (we've had a bug about this already). Excuse me but did you agree with me, then commit the old version anyway? -- Best regards, Michał Górny <http://dev.gentoo.org/~mgorny/> [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 949 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] Re: [PATCH] cmake-utils.eclass: die if ninja is enabled but not installed 2015-10-17 17:37 ` Michał Górny @ 2015-10-17 17:49 ` Matt Turner 2015-10-17 21:34 ` Michał Górny 0 siblings, 1 reply; 6+ messages in thread From: Matt Turner @ 2015-10-17 17:49 UTC (permalink / raw To: gentoo development; +Cc: Michael Palimaka On Sat, Oct 17, 2015 at 10:37 AM, Michał Górny <mgorny@gentoo.org> wrote: > On Fri, 16 Oct 2015 03:22:48 +1100 > Michael Palimaka <kensington@gentoo.org> wrote: > >> On 16/10/15 03:04, Michał Górny wrote: >> > >> > >> > Dnia 15 października 2015 17:44:47 CEST, Michael Palimaka <kensington@gentoo.org> napisał(a): >> >> This could happen if ninja is manually enabled (eg. make.conf) but not >> >> installed >> >> --- >> >> eclass/cmake-utils.eclass | 5 +++++ >> >> 1 file changed, 5 insertions(+) >> >> >> >> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass >> >> index 480cd09..012b13f 100644 >> >> --- a/eclass/cmake-utils.eclass >> >> +++ b/eclass/cmake-utils.eclass >> >> @@ -228,6 +228,11 @@ _generator_to_use() { >> >> >> >> case ${CMAKE_MAKEFILE_GENERATOR} in >> >> ninja) >> >> + # if ninja is enabled but not installed, the build could fail >> >> + # this could happen if ninja is manually enabled (eg. make.conf) >> >> but not installed >> >> + if ! has_version dev-util/ninja; then >> > >> > I'd suggest avoiding has_version and just checking for the binary. type -P, I think. Ciaran can give you the rationale, I believe. >> >> There's no guarantee that the binary will be provided by dev-util/ninja >> (we've had a bug about this already). > > Excuse me but did you agree with me, then commit the old version anyway? I didn't seem like he agreed with you. He explained that checking for a binary named ninja isn't sufficient because some versions of net-irc/ninja install a 'ninja' binary. See bug https://bugs.gentoo.org/show_bug.cgi?id=436804 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [gentoo-dev] Re: [PATCH] cmake-utils.eclass: die if ninja is enabled but not installed 2015-10-17 17:49 ` Matt Turner @ 2015-10-17 21:34 ` Michał Górny 0 siblings, 0 replies; 6+ messages in thread From: Michał Górny @ 2015-10-17 21:34 UTC (permalink / raw To: Matt Turner; +Cc: gentoo development, Michael Palimaka [-- Attachment #1: Type: text/plain, Size: 2330 bytes --] On Sat, 17 Oct 2015 10:49:13 -0700 Matt Turner <mattst88@gentoo.org> wrote: > On Sat, Oct 17, 2015 at 10:37 AM, Michał Górny <mgorny@gentoo.org> wrote: > > On Fri, 16 Oct 2015 03:22:48 +1100 > > Michael Palimaka <kensington@gentoo.org> wrote: > > > >> On 16/10/15 03:04, Michał Górny wrote: > >> > > >> > > >> > Dnia 15 października 2015 17:44:47 CEST, Michael Palimaka <kensington@gentoo.org> napisał(a): > >> >> This could happen if ninja is manually enabled (eg. make.conf) but not > >> >> installed > >> >> --- > >> >> eclass/cmake-utils.eclass | 5 +++++ > >> >> 1 file changed, 5 insertions(+) > >> >> > >> >> diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass > >> >> index 480cd09..012b13f 100644 > >> >> --- a/eclass/cmake-utils.eclass > >> >> +++ b/eclass/cmake-utils.eclass > >> >> @@ -228,6 +228,11 @@ _generator_to_use() { > >> >> > >> >> case ${CMAKE_MAKEFILE_GENERATOR} in > >> >> ninja) > >> >> + # if ninja is enabled but not installed, the build could fail > >> >> + # this could happen if ninja is manually enabled (eg. make.conf) > >> >> but not installed > >> >> + if ! has_version dev-util/ninja; then > >> > > >> > I'd suggest avoiding has_version and just checking for the binary. type -P, I think. Ciaran can give you the rationale, I believe. > >> > >> There's no guarantee that the binary will be provided by dev-util/ninja > >> (we've had a bug about this already). > > > > Excuse me but did you agree with me, then commit the old version anyway? > > I didn't seem like he agreed with you. He explained that checking for > a binary named ninja isn't sufficient because some versions of > net-irc/ninja install a 'ninja' binary. See bug > https://bugs.gentoo.org/show_bug.cgi?id=436804 Well, he didn't make it clear it's about *another* binary. In any case, two wrongs don't make a right. has_version() should really be avoided. In any case, I'd even prefer doing negative has_version() for known-bad net-irc/ninja (assuming we really need to care about it still) as has_version check failing in this case would be much less irritating that has_version check required to proceed. -- Best regards, Michał Górny <http://dev.gentoo.org/~mgorny/> [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 949 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-17 21:34 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-15 15:44 [gentoo-dev] [PATCH] cmake-utils.eclass: die if ninja is enabled but not installed Michael Palimaka 2015-10-15 16:04 ` Michał Górny 2015-10-15 16:22 ` [gentoo-dev] " Michael Palimaka 2015-10-17 17:37 ` Michał Górny 2015-10-17 17:49 ` Matt Turner 2015-10-17 21:34 ` Michał Górny
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox