Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step
@ 2015-04-22 20:11 Cédric Marie
  2015-04-22 21:58 ` Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Cédric Marie @ 2015-04-22 20:11 UTC (permalink / raw)
  To: buildroot

With CMake build system, the "make install" command always compiles
before installing, to make sure that everything is up-to-date.

In Buildroot environment, this is quite useless, because the package
has always already been compiled, either at first build, or when
invoking "make <package>-rebuild".
In all cases, when it comes to staging or target installation step, the
package has just been compiled.

Using "make install/fast" - in order to skip the compilation step - is
therefore more appropriate, more consistent with what other build
systems do, and saves time when you need to rebuild your package.

Signed-off-by: C?dric Marie <cedric.marie@openmailbox.org>
---
 package/pkg-cmake.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 2262012..f17a883 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -57,8 +57,8 @@ $(2)_MAKE			?= $$(MAKE)
 $(2)_MAKE_ENV			?=
 $(2)_MAKE_OPTS			?=
 $(2)_INSTALL_OPTS		?= install
-$(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install
-$(2)_INSTALL_TARGET_OPTS		?= DESTDIR=$$(TARGET_DIR) install
+$(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install/fast
+$(2)_INSTALL_TARGET_OPTS		?= DESTDIR=$$(TARGET_DIR) install/fast
 
 $(2)_SRCDIR			= $$($(2)_DIR)/$$($(2)_SUBDIR)
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step
  2015-04-22 20:11 [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step Cédric Marie
@ 2015-04-22 21:58 ` Yann E. MORIN
  2015-04-22 22:53 ` Arnout Vandecappelle
  2015-04-23  7:50 ` Thomas Petazzoni
  2 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2015-04-22 21:58 UTC (permalink / raw)
  To: buildroot

C?dric, All,

On 2015-04-22 22:11 +0200, C?dric Marie spake thusly:
> With CMake build system, the "make install" command always compiles
> before installing, to make sure that everything is up-to-date.
> 
> In Buildroot environment, this is quite useless, because the package
> has always already been compiled, either at first build, or when
> invoking "make <package>-rebuild".
> In all cases, when it comes to staging or target installation step, the
> package has just been compiled.
> 
> Using "make install/fast" - in order to skip the compilation step - is
> therefore more appropriate, more consistent with what other build
> systems do, and saves time when you need to rebuild your package.
> 
> Signed-off-by: C?dric Marie <cedric.marie@openmailbox.org>
> ---
>  package/pkg-cmake.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 2262012..f17a883 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -57,8 +57,8 @@ $(2)_MAKE			?= $$(MAKE)
>  $(2)_MAKE_ENV			?=
>  $(2)_MAKE_OPTS			?=
>  $(2)_INSTALL_OPTS		?= install
> -$(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install
> -$(2)_INSTALL_TARGET_OPTS		?= DESTDIR=$$(TARGET_DIR) install
> +$(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install/fast
> +$(2)_INSTALL_TARGET_OPTS		?= DESTDIR=$$(TARGET_DIR) install/fast

Would it also make sense we install cmake itself with this rule, in
package/cmake/cmake.mk:47 , too?

Regards,
Yann E. MORIN.

>  $(2)_SRCDIR			= $$($(2)_DIR)/$$($(2)_SUBDIR)
>  
> -- 
> 2.1.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step
  2015-04-22 20:11 [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step Cédric Marie
  2015-04-22 21:58 ` Yann E. MORIN
@ 2015-04-22 22:53 ` Arnout Vandecappelle
  2015-04-23  6:59   ` Cédric Marie
  2015-04-23  7:50 ` Thomas Petazzoni
  2 siblings, 1 reply; 7+ messages in thread
From: Arnout Vandecappelle @ 2015-04-22 22:53 UTC (permalink / raw)
  To: buildroot

On 04/22/15 22:11, C?dric Marie wrote:
> With CMake build system, the "make install" command always compiles
> before installing, to make sure that everything is up-to-date.
> 
> In Buildroot environment, this is quite useless, because the package
> has always already been compiled, either at first build, or when
> invoking "make <package>-rebuild".
> In all cases, when it comes to staging or target installation step, the
> package has just been compiled.
> 
> Using "make install/fast" - in order to skip the compilation step - is
> therefore more appropriate, more consistent with what other build
> systems do, and saves time when you need to rebuild your package.
> 
> Signed-off-by: C?dric Marie <cedric.marie@openmailbox.org>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Doing it for host-cmake itself can be a separate patch. And not very important
either, I can't measure the time difference...

 Regards,
 Arnout

> ---
>  package/pkg-cmake.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 2262012..f17a883 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -57,8 +57,8 @@ $(2)_MAKE			?= $$(MAKE)
>  $(2)_MAKE_ENV			?=
>  $(2)_MAKE_OPTS			?=
>  $(2)_INSTALL_OPTS		?= install
> -$(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install
> -$(2)_INSTALL_TARGET_OPTS		?= DESTDIR=$$(TARGET_DIR) install
> +$(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install/fast
> +$(2)_INSTALL_TARGET_OPTS		?= DESTDIR=$$(TARGET_DIR) install/fast
>  
>  $(2)_SRCDIR			= $$($(2)_DIR)/$$($(2)_SUBDIR)
>  
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step
  2015-04-22 22:53 ` Arnout Vandecappelle
@ 2015-04-23  6:59   ` Cédric Marie
  0 siblings, 0 replies; 7+ messages in thread
From: Cédric Marie @ 2015-04-23  6:59 UTC (permalink / raw)
  To: buildroot

Hi,

> Would it also make sense we install cmake itself with this rule, in
> package/cmake/cmake.mk:47 , too?

That could make sense, yes. I had not thought about CMake being compiled 
with CMake generated makefiles.


> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 
>  Doing it for host-cmake itself can be a separate patch. And not very 
> important
> either, I can't measure the time difference...

OK for a separate patch.

I agree the time difference is not so big. But it can be several seconds 
with some packages (it is done twice: staging + target). When you have 
to rebuild your package regularly, you certainly appreciate saving these 
few seconds. I do :)

In fact, it is a little bit strange that the default behaviour of CMake 
install is to compile before installing. I understand it can be useful 
to check that everything is up-to-date, and maybe check if a new 
installation rule has been added. But outside Buildroot, when installing 
a CMake package to your computer, it might result in compiling with root 
privileges (since make install is likely to be called with root 
privileges). This point is out-of-scope regarding Buildroot, I was just 
wondering about CMake default behaviour...


-- 
C?dric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step
  2015-04-22 20:11 [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step Cédric Marie
  2015-04-22 21:58 ` Yann E. MORIN
  2015-04-22 22:53 ` Arnout Vandecappelle
@ 2015-04-23  7:50 ` Thomas Petazzoni
  2015-04-23  9:06   ` Cédric Marie
  2 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2015-04-23  7:50 UTC (permalink / raw)
  To: buildroot

Dear C?dric Marie,

On Wed, 22 Apr 2015 22:11:56 +0200, C?dric Marie wrote:
> With CMake build system, the "make install" command always compiles
> before installing, to make sure that everything is up-to-date.
> 
> In Buildroot environment, this is quite useless, because the package
> has always already been compiled, either at first build, or when
> invoking "make <package>-rebuild".
> In all cases, when it comes to staging or target installation step, the
> package has just been compiled.
> 
> Using "make install/fast" - in order to skip the compilation step - is
> therefore more appropriate, more consistent with what other build
> systems do, and saves time when you need to rebuild your package.
> 
> Signed-off-by: C?dric Marie <cedric.marie@openmailbox.org>
> ---
>  package/pkg-cmake.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step
  2015-04-23  7:50 ` Thomas Petazzoni
@ 2015-04-23  9:06   ` Cédric Marie
  2015-04-23 16:44     ` Yann E. MORIN
  0 siblings, 1 reply; 7+ messages in thread
From: Cédric Marie @ 2015-04-23  9:06 UTC (permalink / raw)
  To: buildroot

Le 2015-04-23 09:50, Thomas Petazzoni a ?crit?:
> Applied, thanks.

Thank you.
Should I provide the patch for host-cmake as well?

-- 
C?dric

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step
  2015-04-23  9:06   ` Cédric Marie
@ 2015-04-23 16:44     ` Yann E. MORIN
  0 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2015-04-23 16:44 UTC (permalink / raw)
  To: buildroot

C?dric, All,

On 2015-04-23 11:06 +0200, C?dric Marie spake thusly:
> Le 2015-04-23 09:50, Thomas Petazzoni a ?crit?:
> >Applied, thanks.
> 
> Thank you.
> Should I provide the patch for host-cmake as well?

Yes, please. :-)

Even if the gain in time is not that important, I guess it is good to
use the same trick everywhere cmake is used.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-23 16:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-22 20:11 [Buildroot] [PATCH] pkg-cmake: Skip compilation in installation step Cédric Marie
2015-04-22 21:58 ` Yann E. MORIN
2015-04-22 22:53 ` Arnout Vandecappelle
2015-04-23  6:59   ` Cédric Marie
2015-04-23  7:50 ` Thomas Petazzoni
2015-04-23  9:06   ` Cédric Marie
2015-04-23 16:44     ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox