Skip to content
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

Fix distcheck #303

Merged
merged 1 commit into from
Mar 27, 2018
Merged

Fix distcheck #303

merged 1 commit into from
Mar 27, 2018

Conversation

chrissie-c
Copy link
Contributor

Miscellaneous fixes and cleanups to get 'make distcheck' to work on most platforms.

There's a thing in here to speed up the FreeBSD IPC stress tests. I know it means that the BSD test is no longer really a stress test, but it can take over an hour to run with 70000 iterations and that;s just getting in everyone's way.

@jnpkrn
Copy link
Contributor

jnpkrn commented Mar 20, 2018

There's a lot of context and some alignment with the existing checks
missing.

Under which circumstances does the check take 60+ minutes and does this
anomaly happen only with FreeBSD?

Just tried, "make check" incl. compilation took about 8 minutes,
FreeBSD 11.1, virtualized under KVM hypervisor, single CPU allocated
from 8 of i7-6820HQ.

Makefile.am Outdated
@@ -37,6 +37,10 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \

ACLOCAL_AMFLAGS = -I m4

DISTCHECK_CONFIGURE_FLAGS = --with-socket-dir=/tmp/libqb-$(VERSION)-$(shell echo $$$$)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only to be removed with subsequent commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I decided it was better done in the CI itself rather than hard-coding it in the Makefile.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But ... introducing temporary, unjustified inter-patchset noise is not
nice should anyone care about history, bisecting etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would have disappeared when I committed the final patch.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the typical approach is to evolve the patchset towards the final
form directly as a part of the review. I see you want to see the response
from the CI, but cannot you prototype using your fork for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I just want something that works. I hate working with autotools and it's ghastly friends. Every keypress I make regarding them makes me less and less motivated.

@@ -10,7 +10,7 @@ distclean maintainer-clean:
# includes, which are swiped when processing one subdir and then
# missing, as a hard error, for the other)
@$(MAKE) -C log_external $@
@mkdir .deps
@mkdir .deps 2>/dev/null || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You likely want mkdir -p instead of suppressing permission issues etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

@chrissie-c
Copy link
Contributor Author

I am no FreeBSD expert. All I know is that all the FreeBSD VMs I have ever tried this on (the 3 I have here on two different machines) and the one in the Jenkins CI all take around an hour to run. If a FreeBSD expert wants to fix this then it's fine by me, but I don't have the time to do it.

@jnpkrn
Copy link
Contributor

jnpkrn commented Mar 20, 2018

Wrt. alignment with the existing checks, there's --enable-slow-tests
to configure script. We can either reuse that, or perhaps better yet,
apply a similar logic with optional --disable-sticky-tests (work name).
As demonstrated, it should not be hard-wired to apply on FreeBSD
unconditionally because there are cases with this system where the
testsuite runs reasonably out-of-the-box.

@chrissie-c
Copy link
Contributor Author

Either of those is fine by me - and certainly tidier than what I had in there. My main aim here is just to get the stupid thing working :)

@@ -137,6 +137,8 @@ install-exec-hook: qblog_script.ld
sed -i -- "s/libqb.so.<digit>/$${so_ver}/" \
"$(DESTDIR)$(libdir)/libqb.so-t" "$(DESTDIR)$(pkgconfigexecdir)/libqb.pc"
mv -f "$(DESTDIR)$(libdir)/libqb.so-t" "$(DESTDIR)$(libdir)/libqb.so"
rm -f "$(DESTDIR)$(pkgconfigexecdir)/libqb.pc--"
rm -f "$(DESTDIR)$(libdir)/libqb.so-t--"
endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took me some moments to realize the issue -- there's an ambiguity
across systems as to whether -- should be considered as an argument
to -i option or whether this option should be considered orphan (not
accompanied with any argument as it's optional, anyway), followed with
delimiter indicating the end of options:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a better answer to this other than just removing the junk files? That chunk of shell code is extremely opaque (I remember commenting on that at the time.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me include the fix for that into #288 I am going to overhaul a bit
(incl. a solution for backdated OpenBSD per #299). We need to get
rid of sed -i as it's not POSIX :-/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, don't get me started ... spent way too much time yesterday trying to come up with a portable function to replace sed -i and gave up -- it's not impossible, but far uglier than this simple workaround:

sed ... "$INFILE" > "${INFILE}.$$"
mv -- "${INFILE}.$$" "$INFILE"

It obviously only works on one input file at a time. If you need to preserve permissions, you have to do this first:

cp -p "$INFILE" > "${INFILE}.$$"

(A portable way to preserve permissions without copying the entire file is also too ugly for words.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you had suspicion what triggered this response of mine, you were right,
I came by that pacemaker commit, thanks for insights.

@@ -82,6 +82,7 @@ check-headers: $(auto_c_files:.c=.o)

distclean-compile:
rm -rf auto_*.c
rm -rf .deps
Copy link
Contributor

@jnpkrn jnpkrn Mar 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to me the target should rather be named distclean-local,
cannot find any evidence for this one to be supported, hence we
should avoid surprises with the gray zone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting! All these built-in destinations still throw me, and some are hard to find in the doc. disclean-local works for me so I''m happy to change it.

Is there a good reference for these things? the info files seem to be unhelpful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://www.gnu.org/software/automake/manual/automake.html#Clean
(as applicable to many other cases incl. pacemaker: single-page compilation,
finding through the page, even though info pages map 1:1 for most GNU
projects, IIRC)

@@ -64,7 +64,7 @@ static const int MAX_MSG_SIZE = DEFAULT_MAX_MSG_SIZE;
#define GIANT_MSG_DATA_SIZE MAX_MSG_SIZE - sizeof(struct qb_ipc_response_header) - 8

/* This can take AGES (like, an hour) on FreeBSD */
#ifdef __FreeBSD__
#ifndef HAVE_SLOW_TESTS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should relax testing being in place for several years already
only on demand, through that sketched --disable-sticky-tests equivalent.
The hypothesis that it's always slow on FreeBSD has been invalidated,
so only a very very specific subset of all setups is affected (VMs with
FreeBSD lacking virtio support under KVM?).

@chrissie-c
Copy link
Contributor Author

We don' t know whether it's a small or a large subset of FreeBSD installations that are slow - we have 3 data points. As it stands (because it affects the ones I'm using), I'm more inclined to put the original #ifdef FreedBSD back in (I agree, disabling it on Linux is a a bad move) unless someone has a proper fix or can explain why all all my VMs (and Fabio's) exhibit the problem and how to fix it.

@jnpkrn
Copy link
Contributor

jnpkrn commented Mar 22, 2018

Can you at least collect which FreeBSD versions are you talking about?
freebsd-version should do. Point is, if they are rather outdated, I guess
we should not care at all in the build not instructed otherwise.

@fabbione
Copy link
Member

fabbione commented Mar 23, 2018 via email

@chrissie-c
Copy link
Contributor Author

Both the slow FreeBSD VMs are 11.1 and were recently installed. They are also on three different hosts - though all using KVM as the virtualisation platform. I really don't want to get stuck on this. I'm happy to take the ifdef out completely if it annoys people.

@chrissie-c
Copy link
Contributor Author

OK. I just moved my FreeBSD VM to another host and the full 70000 iteration tests completed in 8 minutes, same as yours Poki, so I'm happy it's a hosting problem. from that I suspect that people running it on bare metal are probably not seeing the problem and I'm going to remove that ifdef completely.

@jnpkrn
Copy link
Contributor

jnpkrn commented Mar 26, 2018

Sounds like it may actually be the host the causes this (either with dated
kernel/KVM and or being virtualized on its own, i.e., nested virtualization?).

@fabbione
Copy link
Member

fabbione commented Mar 26, 2018 via email

@chrissie-c
Copy link
Contributor Author

7.4 kernels are slow here too. (no nested virt - that's insane). Fedora 27 kernel seems to run reasonably though

Miscellaneous fixes and cleanups to get 'make distcheck' to work on most
platforms.

Signed-off-by: Christine Caulfield <[email protected]>
@jfriesse
Copy link
Member

@chrissie-c Patchset looks ok for me, so ACK from my side.

@chrissie-c chrissie-c merged commit 3730644 into master Mar 27, 2018
@chrissie-c
Copy link
Contributor Author

Thanks. I appreciate that the bit around the .ld file generation is suboptimal but we can fix that later if needs be. My main aim here is to get the tests back working.

@chrissie-c
Copy link
Contributor Author

Update on the 'slow BSD' problem - it's a Linux kernel bug and is fixed in the RHEL7.5 kernel where the BSD tests take 8 minutes again.

@chrissie-c chrissie-c deleted the fix-distcheck branch April 12, 2018 08:34
@jnpkrn
Copy link
Contributor

jnpkrn commented Apr 12, 2018

Thanks for the upgrade, resisting the immediate urge paid off this time.

@fabbione
Copy link
Member

We will upgrade the CI infrastructure probably next week as 7.5 just went GA and we need to plan downtime. The distcheck is temporary disabled for BSD for this few days we need for preparation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants