-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mostly Autoconf cleanups #240
Conversation
Minor nitpicks:
|
@@ -466,10 +466,8 @@ AC_ARG_ENABLE([coverage], | |||
AC_ARG_ENABLE([slow-tests], | |||
[AS_HELP_STRING([--enable-slow-tests],[build and run slow tests])]) | |||
|
|||
if test x"$with_check" = xyes; then | |||
AC_ARG_ENABLE([syslog-tests], | |||
[AS_HELP_STRING([--enable-syslog-tests],[build and run syslog tests])]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you advise as to whether this conditional is sensible, please?
My original intention was to lay an egg as carefully as possible because
libtool warns that foo_LDFLAGS = -module
is not portable.
Any idea of having this portability tested in some minimalistic way
and turning "syslog-tests" on automatically if positive?
Or is it more a spurious warning of libtool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see any such warning. Where and how do you get it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, cannot reproduce that easily, it might have been on FreeBSD 10.2 VM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reproduced on Linux box, but had to go back in history:
$ make distclean
$ git co -b syslog-test 642f74d
$ ./autogen.sh && ./configure --enable-syslog-tests && make check
...
*** Warning: Linking the executable log.test against the loadable module
*** _syslog_override.so is not portable!
...
Hard to say what resolved this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, just have discovered that commit too; nice to have this positive
side effect :-)
In the new light, I would suggest dropping --enable-syslog-tests
and enabling it unconditionally when the test suite is enabled as a whole.
I intend to do it subsequently on top of your PR, but feel free to drop
it right now without attempting to rectify anything related needlessly.
The [ default="no" ] branches were sense- and (mostly) harmless.
So let's use the more friendly syntax.
This reduces overlinking of qb-blackbox. Being a seldom used executable, the gains are mostly theoretical, but at least this silences warnings from some QA tools.
I implemented your nits and reordered that patches. The last two (GitHub doesn't show them in ancestry order) may not be necessary if you intend to drop the |
#241 works for me perfectly, thanks. |
AX_SAVE_FLAGS | ||
AC_SEARCH_LIBS([dlopen],[dl],,[AC_MSG_ERROR([cannot find dlopen() function])]) | ||
AC_SUBST([dlopen_LIBS],[$LIBS]) | ||
AX_RESTORE_FLAGS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wferi, discussed with @chrissie-c, she raised concerns about "keeping large(ish) chunks of other people's code in there just for simple things, it's just more stuff to keep up-to-date" and I must admit there's some grain of truth in it as all we really need here is just to backup+restore LIBS
, nothing more, nothing less. Would you mind reopening this PR (if possible, I am not sure) and reflecting this comment, please? Indeed, I can do it as another follow up, but better to keep history clean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right there you don't even need to save LIBS
, because it's empty. It's a little more interesting around the pthread function tests, where we also manipulate CFLAGS
(which might be set by the user). Sure, all uses of AX_SAVE/RESTORE_FLAGS
could easily be replaced by custom code. I decided to use them in this pull request, though, mostly for demo.
The main point is that they save you from thinking globally when doing local changes: you gain modularity and composability. You are free to add more involved checks (possibly requiring other flag changes) inside the save/restore pair or reorder them at will. They also reduce the room for error (I might be biased, but a couple of weeks ago I found the insidious CFLAGS="-I/usr/include/security $CLFAGS"
and CPPFLAGS="$ac_save_CFLAGS"
in the same configure.ac
— after far too much head scratching).
Concerning the other point, all three macro files are straight from the Autoconf Archive. They seldom need updates, and when they do, it's a simple replace. Another option is requiring the archive to be installed for building libqb from Git.
On 09/12/16 13:12 -0800, wferi wrote:
wferi commented on this pull request.
> @@ -108,7 +108,10 @@ dnl it will always be "none needed", but it is not true
dnl when linking libraries. Looks like a bug.
AC_SEARCH_LIBS([pthread_create], [pthread])
AC_SEARCH_LIBS([mq_open], [rt])
-AC_SEARCH_LIBS([dlopen], [dl])
+AX_SAVE_FLAGS
+AC_SEARCH_LIBS([dlopen],[dl],,[AC_MSG_ERROR([cannot find dlopen() function])])
+AC_SUBST([dlopen_LIBS],[$LIBS])
+AX_RESTORE_FLAGS
Right there you don't even need to save `LIBS`, because it's empty.
It's a little more interesting around the pthread function tests,
where we also manipulate `CFLAGS` (which might be set by the user).
Ah, next time, I will not forward anything semi-unconsciously (for
some reason, I went by just the easy cases).
Sure, all uses of `AX_SAVE/RESTORE_FLAGS` could easily be replaced
by custom code. I decided to use them in this pull request, though,
mostly for demo.
The main point is that they save you from thinking globally when
doing local changes: you gain modularity and composability. You are
free to add more involved checks (possibly requiring other flag
changes) inside the save/restore pair or reorder them at will. They
also reduce the room for error (I might be biased, but a couple of
weeks ago I found the insidious `CFLAGS="-I/usr/include/security
$CLFAGS"` and `CPPFLAGS="$ac_save_CFLAGS"` in the same
`configure.ac` — after far too much head scratching).
Yes, the ability to offload some tasks to well-tested, self-contained
solution, is appealing. No doubts about that.
Concerning the other point, all three macro files are straight from
the Autoconf Archive. They seldom need updates, and when they do,
it's a simple replace. Another option is requiring the archive to be
installed for building libqb from Git.
That would just complicate consumption, in-tree is OK I believe.
I guess I let Chrissie speak for herself.
Btw. if there's anything to be done about the commits, I would have
a tiny wish (feel free to ignore if the PR would eventually be
accepted as is):
"configure: restrict pthreads to where it's actually needed" commit
could mention that mq_open is no longer relevant beyond commit
70a9623.
Thanks for bearing with me (us).
…--
Jan (Poki)
|
mq_open() is no longer relevant beyond 70a9623 (Remove message queues).
Jan Pokorný <[email protected]> writes:
"configure: restrict pthreads to where it's actually needed" commit
could mention that mq_open is no longer relevant beyond commit
70a9623.
True; I added this note and dropped the last two commits reorganizing
--enable-syslog-tests, since you'll remove that anyway.
Thanks for bearing with me (us).
Come on, I actually count on you being picky and careful. I've only got
a very narrow view of the project and zero experience with maintaining it.
--
Regards,
Feri
|
... and the Travis checks failed. On code which is exactly the same as 2908242 in #241. Is this failure genuine? Or maybe the |
On 12/12/16 03:14 -0800, wferi wrote:
... and the Travis checks failed. On code which is exactly the same
as 2908242 in #241. Is this failure genuine? Or maybe the `ipc.test`
has some race?
Yes, I suspect something like this:
#234
The HPPA buildd failed
[differently](https://buildd.debian.org/status/fetch.php?pkg=libqb&arch=hppa&ver=1.0.1-1&stamp=1481130367).
(Hurd and kFreeBSD also fail some tests.)
check_ipc.c:1007:E:ipc_stress_connections_shm:test_ipc_stress_connections_shm:0:
(after this point) Test timeout expired
^ just adjusting the timeout for that test might help here.
Anyway, updated #241 and it passed:
https://travis-ci.org/ClusterLabs/libqb/builds/183218749
…--
Jan (Poki)
|
The timeout for the stress test has to be HUGE on some platforms. I think it's set to an hour or so even from *BSD |
PR #240 + addendum (drop syslog-tests opt-in switch)
It now causes a following problem with EL6:
Note that I already encountered something similar with pacemaker, ClusterLabs/pacemaker@36f7196#diff-a5522b90382504dc530177f63ced5209R46 @wferi, if you are OK with such a change, I'll go ahead along with |
@jnpkrn, what do you think about introducing a "legacy" M4 file like for example https://github.com/varnishcache/varnish-cache/blob/master/varnish-legacy.m4? Definitions of missing macros could be put there as needed in the future. We could start with something like
which is basically a conditionalized copy of the |
On 18/12/16 02:01 -0800, wferi wrote:
@jnpkrn, what do you think about introducing a "legacy" M4 file like
Sounds reasonable, though it needs to be tested if it would be indeed
the "fixed point" for ~el6 already or more and more macros would have
to be introduced like this, which is something we would rather avoid.
Will have a look early in 2017, holiday season for me till then
(in case you have it similar, enjoy).
…--
Jan (Poki)
|
Sure we can return to this next year.
I'm already on holiday. Merry Christmas!
--
Feri
|
Thanks for the merge, @jnpkrn. |
On 31/05/17 07:53 -0700, wferi wrote:
How did you solve the problem of `AS_VAR_COPY` being undefined under
EL6 in the end?
It rests on the back burner so far, will hopefully get to is soon.
…--
Jan (Poki)
|
I made a patch inouekazu@4b3c4c7. how is it? I pulled request it #267. |
Looks fine, but is it enough to fix the EL6 build, as @jnpkrn queried? |
Yes. I checked with RHEL 6.9.
|
A couple of small things I noticed during packaging the 1.0.1 release. They don't make a big difference for a small project like libqb, but I decided to offer them for the sake of consistency and future-proofing.
Especially for pthreads, where I switched to the standard macro from the Autoconf Archive.
I couldn't fully test this on systems where
gethostbyname
or the socket functions aren't in libc, so some corrections might be needed if you support them for real.Please consider incorporating these patches.