public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] cmake-utils.eclass: two improvements
@ 2015-07-26  9:48 Andrew Savchenko
  2015-07-26 11:54 ` Vadim A. Misbakh-Soloviov
  2015-07-26 15:26 ` [gentoo-dev] " Michael Palimaka
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Savchenko @ 2015-07-26  9:48 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 1048 bytes --]

Hello all,

I propose two improvements to cmake-utils eclass:

1. Set default documentation directory

cmake allows to specify default docs installation directory
(analogue of --docdir for configure script), but cmake-utils.eclass
does nothing in this regard and many ebuilds in tree contain the
same duplicated code:

-DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF}

I propose to add this to the eclass, thus ebuilds can be
simplified. See attached patch.

2. Disable rpath for non-prefix builds

cmake allows to disable RPATH linking (enabled by default), this
leads to insecure rpath warning during install phase checks, logs
show that build directory (-Wl,-rpath /var/tmp/portage/...) is
added to linker options.

Many ebuilds fix this by adding one of the following or similar
options:
-DCMAKE_SKIP_RPATH=ON
-DENABLE_RPATH=OFF
-DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF

I propose to add this functionality to the eclass, thus ebuilds can
be simplified. See attached patch.

Comments?

Best regards,
Andrew Savchenko

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: cmake-utils.eclass-docdir.patch --]
[-- Type: text/x-diff; name="cmake-utils.eclass-docdir.patch", Size: 359 bytes --]

--- cmake-utils.eclass.orig	2015-02-18 09:31:10.000000000 +0300
+++ cmake-utils.eclass	2015-07-26 02:14:38.335700364 +0300
@@ -562,6 +562,7 @@
 		-DCMAKE_INSTALL_DO_STRIP=OFF
 		-DCMAKE_USER_MAKE_RULES_OVERRIDE="${build_rules}"
 		-DCMAKE_TOOLCHAIN_FILE="${toolchain_file}"
+		-DCMAKE_INSTALL_DOCDIR="/usr/share/doc/${PF}"
 		"${MYCMAKEARGS}"
 	)
 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: cmake-utils.eclass-rpath.patch --]
[-- Type: text/x-diff; name="cmake-utils.eclass-rpath.patch", Size: 476 bytes --]

--- cmake-utils.eclass.orig	2015-02-18 09:31:10.000000000 +0300
+++ cmake-utils.eclass	2015-07-26 02:19:25.807736804 +0300
@@ -569,6 +570,10 @@
 		cmakeargs+=( -C "${CMAKE_EXTRA_CACHE_FILE}" )
 	fi
 
+	if [[ -z ${EPREFIX} ]]; then
+		cmakeargs+=( -DCMAKE_SKIP_RPATH=ON )
+	fi
+
 	pushd "${BUILD_DIR}" > /dev/null
 	debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
 	echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [gentoo-dev] cmake-utils.eclass: two improvements
  2015-07-26  9:48 [gentoo-dev] cmake-utils.eclass: two improvements Andrew Savchenko
@ 2015-07-26 11:54 ` Vadim A. Misbakh-Soloviov
  2015-07-26 22:26   ` Andrew Savchenko
  2015-07-26 15:26 ` [gentoo-dev] " Michael Palimaka
  1 sibling, 1 reply; 6+ messages in thread
From: Vadim A. Misbakh-Soloviov @ 2015-07-26 11:54 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

It is bad way to just disable RPATH in eclass without any "buttons" to enable 
it back. Moreover, it is bad to disable it even with such "buttons". THe right 
way would be to detect if portage instance calling eclass is in PREFIX and 
depends on that — keep it or disable.

-- 
Best regards,
mva

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [gentoo-dev] Re: cmake-utils.eclass: two improvements
  2015-07-26  9:48 [gentoo-dev] cmake-utils.eclass: two improvements Andrew Savchenko
  2015-07-26 11:54 ` Vadim A. Misbakh-Soloviov
@ 2015-07-26 15:26 ` Michael Palimaka
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Palimaka @ 2015-07-26 15:26 UTC (permalink / raw
  To: gentoo-dev

On 26/07/15 19:48, Andrew Savchenko wrote:
> Hello all,
> 
> I propose two improvements to cmake-utils eclass:
> 
> 1. Set default documentation directory
> 
> cmake allows to specify default docs installation directory
> (analogue of --docdir for configure script), but cmake-utils.eclass
> does nothing in this regard and many ebuilds in tree contain the
> same duplicated code:
> 
> -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/${PF}
> 
> I propose to add this to the eclass, thus ebuilds can be
> simplified. See attached patch.

I count four packages using this option, with three different values
being passed. Use of CMAKE_INSTALL_DOCDIR is not standardised, and may
behave unpredictably between different packages.

> 
> 2. Disable rpath for non-prefix builds
> 
> cmake allows to disable RPATH linking (enabled by default), this
> leads to insecure rpath warning during install phase checks, logs
> show that build directory (-Wl,-rpath /var/tmp/portage/...) is
> added to linker options.
> 
> Many ebuilds fix this by adding one of the following or similar
> options:
> -DCMAKE_SKIP_RPATH=ON
> -DENABLE_RPATH=OFF
> -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF

This is usually a workaround for an underlying bug. Plus, this will
break any package that legitimately uses rpath.



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

* Re: [gentoo-dev] cmake-utils.eclass: two improvements
  2015-07-26 11:54 ` Vadim A. Misbakh-Soloviov
@ 2015-07-26 22:26   ` Andrew Savchenko
  2015-08-06 21:11     ` William Hubbs
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Savchenko @ 2015-07-26 22:26 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]

On Sun, 26 Jul 2015 17:54:52 +0600 Vadim A. Misbakh-Soloviov wrote:
> It is bad way to just disable RPATH in eclass without any "buttons" to enable 
> it back. Moreover, it is bad to disable it even with such "buttons". THe right 
> way would be to detect if portage instance calling eclass is in PREFIX and 
> depends on that — keep it or disable.

This is exactly what proposed patch is doing: it checks if EPREFIX
is empty, and only in such case disables RPATH, otherwise it is
enabled.

Best regards,
Andrew Savchenko

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [gentoo-dev] cmake-utils.eclass: two improvements
  2015-07-26 22:26   ` Andrew Savchenko
@ 2015-08-06 21:11     ` William Hubbs
  2015-08-06 21:32       ` William Hubbs
  0 siblings, 1 reply; 6+ messages in thread
From: William Hubbs @ 2015-08-06 21:11 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

All,

as I have always said, my views can evolve with civil discussion, and
there has been some good feedback on this.

I also got a suggestion for handling network file systems that would mean we
wouldn't have to keep track of the specific clients needed to mount
network file systems; we could let the distros tell us what the network
file system types are and which services should be started to support
them.

Look at the new-netmount branch for that. Basically it would be a series
of files in a directory which would have the name of a filesystem type
as their file name, then inside each file, the name of the service that
supports them.

The point of debate I suppose is the dependency type that should be used
for these. On the branch it is use, which requires you to add the
appropriate service to the runlevel netmount is in, but some want it to
be want once it is implemented.

Also, I want to talk more about netmount and localmount failing.

If netmount and localmount are set up to fail if one of the file systems
they mount fails (which is what other init systems out there do), the
sys admin can control whether the mount -a command cares about the
status of specific file systems by adding nofail to the mount options in
fstab. By default it would care, but if you add nofail to the mount
options, you would affectively tell mount -a to not be concerned about
whether the mount succeeds or not.

Thoughts?

William


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [gentoo-dev] cmake-utils.eclass: two improvements
  2015-08-06 21:11     ` William Hubbs
@ 2015-08-06 21:32       ` William Hubbs
  0 siblings, 0 replies; 6+ messages in thread
From: William Hubbs @ 2015-08-06 21:32 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 98 bytes --]

Folks,

disregard my previous msg on this thread, it was supposed to go
somewhere else.

William


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

end of thread, other threads:[~2015-08-06 21:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-26  9:48 [gentoo-dev] cmake-utils.eclass: two improvements Andrew Savchenko
2015-07-26 11:54 ` Vadim A. Misbakh-Soloviov
2015-07-26 22:26   ` Andrew Savchenko
2015-08-06 21:11     ` William Hubbs
2015-08-06 21:32       ` William Hubbs
2015-07-26 15:26 ` [gentoo-dev] " Michael Palimaka

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