Bug 256978 - sysutils/xen-tools: Fails to link when lang/go is installed: ld: error: unable to find library -lyajl
Summary: sysutils/xen-tools: Fails to link when lang/go is installed: ld: error: unabl...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Roger Pau Monné
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2021-07-04 15:23 UTC by Ting-Wei Lan
Modified: 2021-07-08 17:06 UTC (History)
3 users (show)

See Also:
fernape: maintainer-feedback? (royger)
koobs: merge-quarterly?


Attachments
xen-tools-4.15.0_1 build log (66.08 KB, application/zstd)
2021-07-04 15:24 UTC, Ting-Wei Lan
no flags Details
Proposed fix (2.85 KB, patch)
2021-07-06 14:51 UTC, Roger Pau Monné
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2021-07-04 15:23:12 UTC
Xen automatically enables Go bindings for xenlight when it finds a Go compiler, but it fails to find the some libraries installed in /usr/local/lib.

# xenbits.xenproject.org/git-http/xen.git/tools/golang/xenlight
ld: error: unable to find library -lyajl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[7]: *** [Makefile:30: build] Error 2
gmake[7]: Leaving directory '/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools/golang/xenlight'
gmake[6]: *** [/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools/golang/../../tools/Rules.mk:161: subdir-install-xenlight] Error 2
gmake[6]: Leaving directory '/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools/golang'
gmake[5]: *** [/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools/golang/../../tools/Rules.mk:156: subdirs-install] Error 2
gmake[5]: Leaving directory '/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools/golang'
gmake[4]: *** [/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools/../tools/Rules.mk:161: subdir-install-golang] Error 2
gmake[4]: Leaving directory '/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools'
gmake[3]: *** [/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools/../tools/Rules.mk:156: subdirs-install] Error 2
gmake[3]: Leaving directory '/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools'
gmake[2]: *** [Makefile:66: install] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0/tools'
gmake[1]: *** [Makefile:140: install-tools] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.15.0'
*** Error code 2

Stop.
make: stopped in /usr/ports/sysutils/xen-tools
Comment 1 Ting-Wei Lan 2021-07-04 15:24:16 UTC
Created attachment 226220 [details]
xen-tools-4.15.0_1 build log
Comment 2 Roger Pau Monné freebsd_committer freebsd_triage 2021-07-06 14:51:10 UTC
Created attachment 226270 [details]
Proposed fix

Can you please check if the attached patch fixes the issue?

Thanks, Roger.
Comment 3 Ting-Wei Lan 2021-07-06 17:22:21 UTC
(In reply to Roger Pau Monné from comment #2)
Yes, it fixes the problem, but building Go bindings is probably not very useful if we don't install them.
Comment 4 Ting-Wei Lan 2021-07-06 17:23:53 UTC
Comment on attachment 226270 [details]
Proposed fix

>+From fc345ccc1effcf89239aaf452071a8cf35b43934 Mon Sep 17 00:00:00 2001
>+From: Roger Pau Monne <roger.pau@citrix.com>
>+Date: Tue, 6 Jul 2021 16:03:24 +0200
>+Subject: [PATCH] tools/go: honor append build flags
>+MIME-Version: 1.0
>+Content-Type: text/plain; charset=UTF-8
>+Content-Transfer-Encoding: 8bit
>+
>+Make the go build use APPEND_{C/LD}FLAGS when necessary, just like
>+other parts od the build.

'od' looks like a typo of 'of'.
Comment 5 Roger Pau Monné freebsd_committer freebsd_triage 2021-07-06 18:21:31 UTC
(In reply to Ting-Wei Lan from comment #3)
Sorry, I'm not really a ports guy myself. Aren't they installed by `make install-tools` if the system has the go compiler present? Or what's not in pkg-plist is simply not installed?

I don't think there's any user of that library ATM. I think it makes more sense to package the go module separately from xen-tools, so the right fix would be to disable building the go bindings in the configure step. I will prepare a patch.

I will also submit the go build fix upstream, do you mind if I also add your tested-by to the patch?

Thanks, Roger.
Comment 6 Roger Pau Monné freebsd_committer freebsd_triage 2021-07-06 18:21:54 UTC
(In reply to Ting-Wei Lan from comment #3)
Sorry, I'm not really a ports guy myself. Aren't they installed by `make install-tools` if the system has the go compiler present? Or what's not in pkg-plist is simply not installed?

I don't think there's any user of that library ATM. I think it makes more sense to package the go module separately from xen-tools, so the right fix would be to disable building the go bindings in the configure step. I will prepare a patch.

I will also submit the go build fix upstream, do you mind if I also add your tested-by to the patch?

Thanks, Roger.
Comment 7 commit-hook freebsd_committer freebsd_triage 2021-07-07 07:23:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=53c01d65985faea7bd864702cefb2f9e6ef4d3a8

commit 53c01d65985faea7bd864702cefb2f9e6ef4d3a8
Author:     Roger Pau Monné <royger@FreeBSD.org>
AuthorDate: 2021-07-06 14:05:55 +0000
Commit:     Roger Pau Monné <royger@FreeBSD.org>
CommitDate: 2021-07-07 07:22:29 +0000

    sysutils/xen-tools: fix build with go installed

    Unconditionally disable building the Go bindings. Such bindings
    should be packaged in a separate port.

    PR:             256978
    Reported by:    Ting-Wei Lan <lantw44@gmail.com>
    Approved by:    bapt (implicit)

 sysutils/xen-tools/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Comment 8 Roger Pau Monné freebsd_committer freebsd_triage 2021-07-07 07:24:08 UTC
Should be fixed
Comment 9 Ting-Wei Lan 2021-07-08 17:06:47 UTC
(In reply to Roger Pau Monné from comment #6)
They are installed into the stage directory, but files not listed in pkg-plist won't be packaged or installed into the system. If you run 'make check-plist', it will report these uninstalled files as pkg-plist issues.

It is OK to add tested-by to the patch.