Summary: | sysutils/bacula-client 7.0.4_1 and sysutils/bacula-server 7.0.4_1 don't compile on 10-STABLE when 5.x is already installed. | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Larry Rosenman <ler> | ||||
Component: | Individual Port(s) | Assignee: | Dan Langille <dvl> | ||||
Status: | Closed DUPLICATE | ||||||
Severity: | Affects Only Me | CC: | antiduh | ||||
Priority: | --- | ||||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193641 | ||||||
Attachments: |
|
Description
Larry Rosenman
![]() ![]() thebighonker.lerctr.org /usr/ports/sysutils/bacula-client # uname -a FreeBSD thebighonker.lerctr.org 10.0-STABLE FreeBSD 10.0-STABLE #41 r269753M: Sat Aug 9 10:09:26 CDT 2014 root@thebighonker.lerctr.org:/usr/obj/usr/src/sys/GENERIC amd64 thebighonker.lerctr.org /usr/ports/sysutils/bacula-client # cat /etc/make.conf WITH_PKGNG=yes DEFAULT_VERSIONS= perl5=5.16,pgsql=92 #__EXIM__ LOG_FILE_PATH="syslog:${LOGDIR}/%slog" LOGDIR=/var/log/exim # APACHE_DEFAULT=2.2 DEFAULT_VERSIONS+=apache=2.2 thebighonker.lerctr.org /usr/ports/sysutils/bacula-client # removing the NLS & SSL options does NOT change things. This also happens for bacula-server 7.0.4_1 on 10-STABLE... ua_status.o:ua_status.c:(.text+0xaaa): more undefined references to `d_msg(char const*, int, long, char const*, ...)' follow ua_status.o: In function `llist_scheduled_jobs(UAContext*)': ua_status.c:(.text+0x2386): undefined reference to `tm_ldom(int, int)' ua_status.c:(.text+0x2500): undefined reference to `bstrftime_dn(char*, int, long)' ua_status.c:(.text+0x2748): undefined reference to `d_msg(char const*, int, long, char const*, ...)' ua_status.o: In function `do_all_status(UAContext*)': ua_status.c:(.text+0x28bc): undefined reference to `d_msg(char const*, int, long, char const*, ...)' ua_status.c:(.text+0x2a52): undefined reference to `d_msg(char const*, int, long, char const*, ...)' ua_tree.o: In function `insert_tree_handler(void*, int, char**)': ua_tree.c:(.text+0x1167): undefined reference to `d_msg(char const*, int, long, char const*, ...)' ua_tree.c:(.text+0x1263): undefined reference to `d_msg(char const*, int, long, char const*, ...)' ua_tree.o:ua_tree.c:(.text+0x132f): more undefined references to `d_msg(char const*, int, long, char const*, ...)' follow vbackup.o: In function `do_vbackup(JCR*)': vbackup.c:(.text+0x57c): undefined reference to `sellist::set_string(char const*, bool)' vbackup.c:(.text+0x5ae): undefined reference to `sellist::get_expanded_list()' vbackup.c:(.text+0x629): undefined reference to `sellist::get_expanded_list()' vbackup.c:(.text+0x84e): undefined reference to `d_msg(char const*, int, long, char const*, ...)' vbackup.c:(.text+0x9b4): undefined reference to `d_msg(char const*, int, long, char const*, ...)' vbackup.c:(.text+0xa3b): undefined reference to `d_msg(char const*, int, long, char const*, ...)' vbackup.c:(.text+0xa8a): undefined reference to `JCR::setJobStarted()' vbackup.o: In function `vbackup_cleanup(JCR*, int)': vbackup.c:(.text+0xde0): undefined reference to `d_msg(char const*, int, long, char const*, ...)' vbackup.c:(.text+0x158c): undefined reference to `d_msg(char const*, int, long, char const*, ...)' verify.o: In function `do_verify(JCR*)': verify.c:(.text+0x179): undefined reference to `d_msg(char const*, int, long, char const*, ...)' verify.c:(.text+0x1bc): undefined reference to `d_msg(char const*, int, long, char const*, ...)' verify.c:(.text+0x21d): undefined reference to `d_msg(char const*, int, long, char const*, ...)' verify.o:verify.c:(.text+0x361): more undefined references to `d_msg(char const*, int, long, char const*, ...)' follow /usr/ports/sysutils/bacula-server/work/bacula-7.0.4/src/cats/.libs/libbacsql.so: undefined reference to `set_assert_msg(char const*, int, char const*)' c++: error: linker command failed with exit code 1 (use -v to see invocation) *** [bacula-dir] Error code 1 make[3]: stopped in /usr/ports/sysutils/bacula-server/work/bacula-7.0.4/src/dird 1 error make[3]: stopped in /usr/ports/sysutils/bacula-server/work/bacula-7.0.4/src/dird ====== Error in /usr/ports/sysutils/bacula-server/work/bacula-7.0.4/src/dird ====== *** [all] Error code 1 make[2]: stopped in /usr/ports/sysutils/bacula-server/work/bacula-7.0.4 1 error make[2]: stopped in /usr/ports/sysutils/bacula-server/work/bacula-7.0.4 ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make[1]: stopped in /usr/ports/sysutils/bacula-server *** Error code 1 Stop. make: stopped in /usr/ports/sysutils/bacula-server thebighonker.lerctr.org /usr/ports/sysutils/bacula-server # thebighonker.lerctr.org /usr/ports/sysutils/bacula-server # latest ports? This one was updated 3 times on Aug 9... (over to maintainer btw) yes thebighonker.lerctr.org /home/ler $ cd /usr/ports thebighonker.lerctr.org /usr/ports $ svn info Path: . Working Copy Root Path: /usr/ports URL: svn://svn.freebsd.org/ports/head Relative URL: ^/head Repository Root: svn://svn.freebsd.org/ports Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 Revision: 364443 Node Kind: directory Schedule: normal Last Changed Author: marino Last Changed Rev: 364443 Last Changed Date: 2014-08-09 08:54:07 -0500 (Sat, 09 Aug 2014) thebighonker.lerctr.org /usr/ports $ The linker line is failing to find functions defined in lib/message.c. lib was never compiled because something is wrong with variable expansions, causing ECHO to be recursively defined, seen below. Strangly, the build continues even though it failed to build lib: ==>Entering directory /usr/ports/sysutils/bacula-client/work/bacula-7.0.4/src/lib Variable ECHO is recursive. make[3]: stopped in /usr/ports/sysutils/bacula-client/work/bacula-7.0.4/src/lib *** Error code 1 Stop. make[2]: stopped in /usr/ports/sysutils/bacula-client/work/bacula-7.0.4 chmod: storage-ctl: No such file or directory chmod: bsg_persist: No such file or directory Cleaning up ==>Entering directory /usr/ports/sysutils/bacula-client/work/bacula-7.0.4/src ==>Entering directory /usr/ports/sysutils/bacula-client/work/bacula-7.0.4/src/lib ==>Entering directory /usr/ports/sysutils/bacula-client/work/bacula-7.0.4/src/findlib ... continues building. Not sure why 'Variable ECHO is recursive.' Ignore my last comment. The echo thing is a small problem, but it doesn't breka the build, and has nothing to do with your problem. I'm going to guess that you currently have bacula 5.x installed and are attempting to build sysutils/bacula-client to upgrade to bacula 7.x Consider this linker line: /usr/ports/sysutils/bacula-client/work/bacula-7.0.4/libtool --silent --tag=CXX --mode=link /usr/bin/c++ -L/usr/local/lib -L../lib -L../findlib -o bacula-fd filed.o authenticate.o acl.o backup.o estimate.o fd_plugins.o accurate.o filed_conf.o heartbeat.o job.o restore.o status.o verify.o verify_vol.o xattr.o -lz -lbacfind -lbaccfg -lbac -lm -lpthread -lintl -lwrap message.o is packed into libbac.la, found in freshly rebuilt in ../lib -lbac is being incorrectly satisfied by -L/usr/local/lib, since it's before -L../lib -L/usr/local/lib is necessary to cause the linker to link against the ports versions of openssl et al, instead of what it'll find in /usr/lib. -L/usr/local/lib is injected by the port's Makefile: # cat Makefile | grep LDFLAGS LDFLAGS+= -L${LOCALBASE}/lib The problem is that -L${LOCALBASE} needs to be injected to the end of the linker line. I'm not well versed enough in make/autoconf to know how to do that, unfortunately. Bacula has been plagued by this problem for a while; during the most recent kerfluffle of making the port work on 7.x, the maintainers had temporarily commented out LDFLAGS to make things work for them (probably because of the same problem you had). In https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192514#c20 we figure out that LDFLAGS being commented out breaks compilation of the server, because the server depends on the client being installed, so it can find the client's libbacfind in /usr/local/lib. Here, we find out it breaks the client if you're upgrading sysutils/bacula-client from bacula 5.x to bacula 7.x. So how do you inject -L${LOCALBASE}/lib to the end of the linker line? Ok, deinstalling the 5.x version allows the 7.x version to compile and install. > So how do you inject -L${LOCALBASE}/lib to the end of the linker line?
You don't. This is bacula's mistake, as best as I can tell:
angst(/usr/ports/sysutils/bacula-server) # make clean extract
===> Cleaning for bacula-server-7.0.4_1
===> Found saved configuration for bacula-server-7.0.4
...
angst(/usr/ports/sysutils/bacula-server/work/bacula-7.0.4/src) # find . | xargs grep -- '-L../lib'
./console/Makefile.in: $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
./console/Makefile.in: $(LIBTOOL_LINK) $(CXX) -static $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \
./stored/Makefile.in: $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -o $@ $(SDOBJS) $(ZLIBS) \
./stored/Makefile.in: $(LIBTOOL_LINK) $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -o $@ $(SDOBJS) $(ZLIBS) \
./stored/Makefile.in: $(LIBTOOL_LINK) $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -o $@ $(TAPEOBJS) \
...
Either we need to patch the Makefile.in files to move $(LDFLAGS) to the end, or have upstream do it for us.
Created attachment 145579 [details]
Patch file to rewrite LDFLAGS position
This patch moves all LDFLAGS references to after all other -L options, so as to give it the least priority. I've compile and tested the subsequent build on my particular system, but I encourage others to test as well.
IMO this patch should be committed upstream but I'd welcome some peer review before doing so.
Here's a quick test: 1) Uninstall all traces of any bacula version - server or client, 5.x or 7.x. 2) `make clean` bacula-server, bacula-client, bacula5-server and bacula5-client 2) Install sysutils/bacula5-client 3) DO NOT install my patch. Remove it from sysutils/bacula-server/files if you already have. 4) Temporarily remove the `CONFLICTS` lines from sysutils/bacula-server/Makefile 5) Attempt to `make build` sysutils/bacula-client 6) Observe sysutils/bacula-client fails to build. `make clean` sysutils/bacula-client 7) Install my patch into sysutils/bacula-server/files 8) Attempt to `make build` sysutils/bacula-client. 9) Observe that sysutils/bacula-client compiles cleanly. Thank you. I am AFK. is this patch similar to those removed when the port went from 5.x to 7.x? It looks familiar. Yeah, poking around in PR 191311 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=191311), it looks like the old port actually had patches to move LDFLAGS around. One of the obsolete patches in 191311 show those patch files getting updates, but I guess that everything got discarded in the update. I guess that means we should try to make a strong effort to get these patches merged upstream. Kevin: I discarded those patches after suggestions were made that they weren't useful. I will reinstate them. Is there a good way, other than svn, to add a comment to a patch file? Kevin: I'm also a Bacula developer, so I will send a patch there too once we get this working. Yeah, everything before the header is supposed to be ignored, according to the unified diff format. Svn et al use this to store stuff like 'Index:' lines. Typical unified diff: > --- src/console/Makefile.in.orig 2014-08-09 15:50:30.000000000 -0400 > +++ src/console/Makefile.in 2014-08-09 15:51:14.000000000 -0400 Unified diff with comments: > See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192526 for > the reasons this patch exists. > ======================================================================= > --- src/console/Makefile.in.orig 2014-08-09 15:50:30.000000000 -0400 > +++ src/console/Makefile.in 2014-08-09 15:51:14.000000000 -0400 I have posted to the bacula-users mailing list about this issue: http://marc.info/?l=bacula-devel&m=140856764725362&w=2 FYI, no reply yet on my email to the vendor mailing list. with 7.0.4 installed, the upgrade to 7.0.5 produces UNUSABLE binaries, as the new code looks for / links with the previous libbac*7.0.4 SO's. In previous version of this port, great lengths were taken to ensure it did not use 7.0.4 or 7.0.5, but 7. I was told this wasn't necessary and it was removed. Now it seems something else is required. Larry: when upgrading, what process did you use? portmaster bacula* was what I used. what do you get for pkg info -x bac? borg.lerctr.org /home/ler # pkg info -x bac bacula-bat-7.0.5 bacula-client-7.0.5 bacula-docs-7.0.3 bacula-server-7.0.5 borg.lerctr.org /home/ler # Further discussion is on https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193641 *** This bug has been marked as a duplicate of bug 193641 *** |