Discussion:
[PATCH] >=samba-4.0 automagically depends on dmapi (libdm.so)
Lars Wendler
2013-12-06 11:30:43 UTC
Permalink
From: Andreas Sturmlechner <andreas.sturmlechner at gmail.com>

This fixes https://bugs.gentoo.org/474492

Signed-off-by: Lars Wendler <polynomial-c at gentoo.org>
---
source3/wscript | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index b09c2db..ca40ed2 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -193,28 +193,29 @@ main() {
elif check_for_fam:
Logs.warn('no suitable FAM library found')

- # check for DMAPI libs
- Logs.info("Checking for DMAPI library existence")
conf.env['dmapi_lib'] = ''
samba_dmapi_lib = ''
- if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'dm'):
- samba_dmapi_lib = 'dm'
- else:
- if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'jfsdm'):
- samba_dmapi_lib = 'jfsdm'
+ if Options.options.with_dmapi == True:
+ # check for DMAPI libs
+ Logs.info("Checking for DMAPI library existence")
+ if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'dm'):
+ samba_dmapi_lib = 'dm'
else:
- if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'dmapi'):
- samba_dmapi_lib = 'dmapi'
+ if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'jfsdm'):
+ samba_dmapi_lib = 'jfsdm'
else:
- if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'xdsm'):
- samba_dmapi_lib = 'xdsm'
- # only bother to test headers and compilation when a candidate
- # library has been found
- if Options.options.with_dmapi == True and samba_dmapi_lib == '':
- conf.fatal('DMAPI support requested, but no suitable DMAPI library found')
- else:
- conf.CHECK_HEADERS('sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h dmapi.h')
- conf.CHECK_CODE('''
+ if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'dmapi'):
+ samba_dmapi_lib = 'dmapi'
+ else:
+ if conf.CHECK_FUNCS_IN('dm_get_eventlist', 'xdsm'):
+ samba_dmapi_lib = 'xdsm'
+ # only bother to test headers and compilation when a candidate
+ # library has been found
+ if samba_dmapi_lib == '':
+ conf.fatal('DMAPI support requested, but no suitable DMAPI library found')
+ else:
+ conf.CHECK_HEADERS('sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h dmapi.h')
+ conf.CHECK_CODE('''
#include <time.h> /* needed by Tru64 */
#include <sys/types.h> /* needed by AIX */
#ifdef HAVE_XFS_DMAPI_H
@@ -253,8 +254,7 @@ int main(int argc, char **argv)
if conf.CONFIG_SET('USE_DMAPI'):
conf.env['dmapi_lib'] = samba_dmapi_lib
else:
- if Options.options.with_dmapi == True:
- conf.fatal('DMAPI support requested but not found');
+ conf.fatal('DMAPI support requested but not found');

# Check for various members of the stat structure
conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_blocks', define='HAVE_STAT_ST_BLOCKS',
--
1.8.5.1
Stefan (metze) Metzmacher
2013-12-08 21:46:14 UTC
Permalink
Hi Lars,
Post by Lars Wendler
From: Andreas Sturmlechner <andreas.sturmlechner at gmail.com>
This fixes https://bugs.gentoo.org/474492
Signed-off-by: Lars Wendler <polynomial-c at gentoo.org>
--with-dmapi=no should do what you want. It was intended to change the
default
to 'auto'.

metze
Jelmer Vernooij
2013-12-08 21:47:52 UTC
Permalink
Post by Stefan (metze) Metzmacher
Hi Lars,
Post by Lars Wendler
From: Andreas Sturmlechner <andreas.sturmlechner at gmail.com>
This fixes https://bugs.gentoo.org/474492
Signed-off-by: Lars Wendler <polynomial-c at gentoo.org>
--with-dmapi=no should do what you want. It was intended to change the
default
to 'auto'.
That should probably be --without-dmapi. --with-X doesn't take an
option in waf.

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131208/85f820da/attachment.pgp>
Stefan (metze) Metzmacher
2013-12-08 21:53:47 UTC
Permalink
Post by Jelmer Vernooij
Post by Stefan (metze) Metzmacher
Hi Lars,
Post by Lars Wendler
From: Andreas Sturmlechner <andreas.sturmlechner at gmail.com>
This fixes https://bugs.gentoo.org/474492
Signed-off-by: Lars Wendler <polynomial-c at gentoo.org>
--with-dmapi=no should do what you want. It was intended to change the
default
to 'auto'.
That should probably be --without-dmapi. --with-X doesn't take an
option in waf.
Yes, correct, sorry!

metze
Lars Wendler
2013-12-09 13:55:29 UTC
Permalink
Am Sun, 08 Dec 2013 22:46:14 +0100
Post by Stefan (metze) Metzmacher
Hi Lars,
Post by Lars Wendler
From: Andreas Sturmlechner <andreas.sturmlechner at gmail.com>
This fixes https://bugs.gentoo.org/474492
Signed-off-by: Lars Wendler <polynomial-c at gentoo.org>
--with-dmapi=no should do what you want. It was intended to change the
default
to 'auto'.
metze
Hello Stefan,

thank you for your replies.

So what is the correct way to compile samba without linking to dmapi
(libdm.so) when that lib is installed in the system?

We also have similar problems with samba "automagically" linking to

attr (libattr.so) [1]
libaio (libaio.so) [2]
pam (libpam.so) [3]

What is the correct procedure to not make samba link against any of
these libs when they are installed on a system?

[1] https://bugs.gentoo.org/489748
[2] https://bugs.gentoo.org/489764
[3] https://bugs.gentoo.org/489770


kind regards
--
Lars Wendler
Gentoo package maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131209/77b874dc/attachment.pgp>
Andrew Bartlett
2013-12-09 20:56:30 UTC
Permalink
Post by Lars Wendler
Am Sun, 08 Dec 2013 22:46:14 +0100
Post by Stefan (metze) Metzmacher
Hi Lars,
Post by Lars Wendler
From: Andreas Sturmlechner <andreas.sturmlechner at gmail.com>
This fixes https://bugs.gentoo.org/474492
Signed-off-by: Lars Wendler <polynomial-c at gentoo.org>
--with-dmapi=no should do what you want. It was intended to change the
default
to 'auto'.
metze
Hello Stefan,
thank you for your replies.
So what is the correct way to compile samba without linking to dmapi
(libdm.so) when that lib is installed in the system?
We also have similar problems with samba "automagically" linking to
attr (libattr.so) [1]
libaio (libaio.so) [2]
pam (libpam.so) [3]
What is the correct procedure to not make samba link against any of
these libs when they are installed on a system?
[1] https://bugs.gentoo.org/489748
[2] https://bugs.gentoo.org/489764
[3] https://bugs.gentoo.org/489770
Why are you trying to stop Samba using these important libraries?

This reminds me, we should get back to making the build scripts assert
that we have xattr, acl and ldap libs, rather than silently failing to
have certain features.

Andrew Bartlett
--
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Catalyst IT http://catalyst.net.nz/services/samba



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131210/59a5feb1/attachment.pgp>
Lars Wendler
2013-12-10 07:23:07 UTC
Permalink
Am Tue, 10 Dec 2013 09:56:30 +1300
Post by Andrew Bartlett
Post by Lars Wendler
Am Sun, 08 Dec 2013 22:46:14 +0100
Post by Stefan (metze) Metzmacher
Hi Lars,
Post by Lars Wendler
From: Andreas Sturmlechner <andreas.sturmlechner at gmail.com>
This fixes https://bugs.gentoo.org/474492
Signed-off-by: Lars Wendler <polynomial-c at gentoo.org>
--with-dmapi=no should do what you want. It was intended to
change the default
to 'auto'.
metze
Hello Stefan,
thank you for your replies.
So what is the correct way to compile samba without linking to dmapi
(libdm.so) when that lib is installed in the system?
We also have similar problems with samba "automagically" linking to
attr (libattr.so) [1]
libaio (libaio.so) [2]
pam (libpam.so) [3]
What is the correct procedure to not make samba link against any of
these libs when they are installed on a system?
[1] https://bugs.gentoo.org/489748
[2] https://bugs.gentoo.org/489764
[3] https://bugs.gentoo.org/489770
Why are you trying to stop Samba using these important libraries?
I do not want to entirely stop our samba packages from using these
libs. But samba's build system provides these configure switches and
they behave not like they should.
We (Gentoo) usually try to provide our users the opportunity to
en-/disable optional features as much as possible. For example, if a
user does not want/need xattr in his system we usually try to make
xattr optional for every package he compiles unless it's a hard
requirement of the package. According to samba's build system neither
of the libs I mentioned above seem to be hard requirements. So we want
to keep them optional for our users.

Another problem is that automagic dependencies are really bad. Please
have a look at [1] to get a picture why we want to avoid automagic
dependencies.
Post by Andrew Bartlett
This reminds me, we should get back to making the build scripts assert
that we have xattr, acl and ldap libs, rather than silently failing to
have certain features.
Andrew Bartlett
[1]
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies

Kind regards
--
Lars Wendler
Gentoo package maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131210/dd86d561/attachment.pgp>
Jelmer Vernooij
2013-12-15 23:56:20 UTC
Permalink
Post by Lars Wendler
Am Tue, 10 Dec 2013 09:56:30 +1300
Post by Andrew Bartlett
Post by Lars Wendler
Am Sun, 08 Dec 2013 22:46:14 +0100
Post by Stefan (metze) Metzmacher
Hi Lars,
Post by Lars Wendler
From: Andreas Sturmlechner <andreas.sturmlechner at gmail.com>
This fixes https://bugs.gentoo.org/474492
Signed-off-by: Lars Wendler <polynomial-c at gentoo.org>
--with-dmapi=no should do what you want. It was intended to
change the default
to 'auto'.
metze
Hello Stefan,
thank you for your replies.
So what is the correct way to compile samba without linking to dmapi
(libdm.so) when that lib is installed in the system?
We also have similar problems with samba "automagically" linking to
attr (libattr.so) [1]
libaio (libaio.so) [2]
pam (libpam.so) [3]
What is the correct procedure to not make samba link against any of
these libs when they are installed on a system?
[1] https://bugs.gentoo.org/489748
[2] https://bugs.gentoo.org/489764
[3] https://bugs.gentoo.org/489770
Why are you trying to stop Samba using these important libraries?
I do not want to entirely stop our samba packages from using these
libs. But samba's build system provides these configure switches and
they behave not like they should.
We (Gentoo) usually try to provide our users the opportunity to
en-/disable optional features as much as possible. For example, if a
user does not want/need xattr in his system we usually try to make
xattr optional for every package he compiles unless it's a hard
requirement of the package. According to samba's build system neither
of the libs I mentioned above seem to be hard requirements. So we want
to keep them optional for our users.
Another problem is that automagic dependencies are really bad. Please
have a look at [1] to get a picture why we want to avoid automagic
dependencies.
Post by Andrew Bartlett
This reminds me, we should get back to making the build scripts assert
that we have xattr, acl and ldap libs, rather than silently failing to
have certain features.
Andrew Bartlett
[1]
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies
This page actually lists the behaviour that we have in Samba (test by
default, but allow flags to force behaviour either way) as one of the
possible acceptable solutions for Gentoo.

Samba's configure has --with{out,}-pam, --with{out,}-aio-support and
--with{out,}-attr flags.

That said, building without aio or attr on Linux is not a very good idea.

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20131215/992c1058/attachment.pgp>
Loading...