Bug 237165

Summary: sysutils/bareos-server: linker error: undefined reference to json
Product: Ports & Packages Reporter: O. Hartmann <ohartmann>
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Many People CC: bas, pi
Priority: --- Flags: bugzilla: maintainer-feedback? (acm)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 261226    
Bug Blocks:    
Attachments:
Description Flags
bareos-server patch: add -ljansson to ports main Makefile LDFLAGS none

Description O. Hartmann 2019-04-09 16:40:14 UTC
Recent update of port susutils/bareos-server fails with the error:

[...]
Linking bareos-sd ...
/usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/libtool --silent --tag=CXX --mode=link /usr/bin/c++  -L/usr/local/lib -L/usr/local/lib  -L/usr/local/lib -fstack-protector -L. -L../lib -o bareos-sd append.o askdir.o authenticate.o dir_cmd.o fd_cmds.o job.o mac.o ndmp_tape.o read.o sd_cmds.o sd_stats.o socket_server.o status.o stored.o  -L../ndmp -lbareosndmp -lbareossd -lbareoscfg -lbareos -lm  -lpthread  -lintl      -lwrap   /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib  -L/usr/lib -lssl -lcrypto  -L/usr/local/lib -ljansson
--- bcopy ---
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_delete
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_dumps
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_integer
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_object
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_object_set_new
ld: error: /usr/ports/sysutils/bareos-server/work/bareos-Release-17.2.7/src/stored/.libs/libbareossd.so: undefined reference to json_string
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [bcopy] Error code 1
Comment 1 O. Hartmann 2019-04-26 09:25:41 UTC
Created attachment 204035 [details]
bareos-server patch: add -ljansson to ports main Makefile LDFLAGS

Attached, you'll find a patch to workaround the problem I discovered while compiling sysutils/bareos-server. Obviously, the linker does not find libjansson.so, so adding "-ljansson" to port's Makefile LDFLAG tag solves the problem for me. See attached pacth.
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-05-09 18:05:18 UTC
A commit references this bug:

Author: acm
Date: Thu May  9 18:04:41 UTC 2019
New revision: 501125
URL: https://svnweb.freebsd.org/changeset/ports/501125

Log:
  - Copy bareos-* ports to bareos17-* ports. bareos-* ports will be updated to
    latest version
  - Fix bareos17-server build [1]
  - Fix installation of sample files
  - Bump PORTREVISION

  PR:		230456 237165
  Reported by:	ohartmann at walstatt.org [1], okrg at ukr.net [1]

Changes:
  head/sysutils/Makefile
  head/sysutils/bareos17-client/
  head/sysutils/bareos17-client/Makefile
  head/sysutils/bareos17-server/
  head/sysutils/bareos17-server/Makefile
  head/sysutils/bareos17-server/files/patch-src-dird-Makefile.in
  head/sysutils/bareos17-server/files/patch-src-filed-Makefile.in
  head/sysutils/bareos17-server/files/patch-src-stored-Makefile.in
Comment 3 O. Hartmann 2019-06-05 08:36:50 UTC
This problem is now again present in sysutils/bareos-server (18.2.6)!

The same "trick" as described prior for Version 17 makes the port compile as well as with poudriere and via make.

Please fix. See patch above.

Thanks in advance.
Comment 4 O. Hartmann 2019-07-27 19:25:35 UTC
The problem is still present!
Comment 5 O. Hartmann 2019-10-14 12:54:41 UTC
The problem reported is still present with poudriere on a CURRENT server running poudriere for a FreeBSD 12-STABLE jail:

host: FreeBSD 13.0-CURRENT #3 r353485: Mon Oct 14 07:07:10 CEST 2019 amd64
ports tree: r514457
poudriere: 3.3.2_1
Jail OSVERSION: 1201500 (12-STABLE)

Linking of bareos-server 18 fails at the same stage as reported initially in this PR.

There is no problem running same as above poudriere with a jail 11.3-RELENG!

Jail CURRENT is also failing.
Comment 6 bas 2019-11-07 12:42:30 UTC
Fails on 12.1-RELEASE as well. Workaround patch by O. Hartmann fixes it for me.
Comment 7 Kurt Jaeger freebsd_committer freebsd_triage 2019-12-09 13:04:59 UTC
testbuilds @work
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-12-09 13:57:27 UTC
A commit references this bug:

Author: pi
Date: Mon Dec  9 13:56:52 UTC 2019
New revision: 519610
URL: https://svnweb.freebsd.org/changeset/ports/519610

Log:
  sysutils/bareos-server: fix build on 12.x

  PR:		237165
  Submitted by:	Oliver Hartmann <ohartmann@walstatt.org>
  Approved by:	acm (maintainer timeout)

Changes:
  head/sysutils/bareos-server/Makefile
Comment 9 O. Hartmann 2022-01-15 14:58:22 UTC
This recurring "bug" renders build failing again. See PR 261226.