Bug 251041

Summary: graphics/rawtherapee: Fails to link: ar: unrecognized option `--plugin'
Product: Ports & Packages Reporter: rozhuk.im
Component: Individual Port(s)Assignee: Matthias Andree <mandree>
Status: Closed FIXED    
Severity: Affects Only Me CC: lumiwa, rozhuk.im
Priority: --- Flags: mandree: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 240594    

Description rozhuk.im 2020-11-11 10:08:59 UTC
...
[39/284] : && /usr/local/bin/cmake -E rm -f rtexif/librtexif.a && gcc-ar9 qc rtexif/librtexif.a  rtexif/CMakeFiles/rtexif.dir/canonattribs.cc.o rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o rtexif/CMakeFiles/rtexif.dir/kodakattribs.cc.o rtexif/CMakeFiles/rtexif.dir/nikonattribs.cc.o rtexif/CMakeFiles/rtexif.dir/olympusattribs.cc.o rtexif/CMakeFiles/rtexif.dir/panasonicattribs.cc.o rtexif/CMakeFiles/rtexif.dir/pentaxattribs.cc.o rtexif/CMakeFiles/rtexif.dir/rtexif.cc.o rtexif/CMakeFiles/rtexif.dir/sonyminoltaattribs.cc.o rtexif/CMakeFiles/rtexif.dir/stdattribs.cc.o && gcc-ranlib9 rtexif/librtexif.a && :
FAILED: rtexif/librtexif.a 
: && /usr/local/bin/cmake -E rm -f rtexif/librtexif.a && gcc-ar9 qc rtexif/librtexif.a  rtexif/CMakeFiles/rtexif.dir/canonattribs.cc.o rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o rtexif/CMakeFiles/rtexif.dir/kodakattribs.cc.o rtexif/CMakeFiles/rtexif.dir/nikonattribs.cc.o rtexif/CMakeFiles/rtexif.dir/olympusattribs.cc.o rtexif/CMakeFiles/rtexif.dir/panasonicattribs.cc.o rtexif/CMakeFiles/rtexif.dir/pentaxattribs.cc.o rtexif/CMakeFiles/rtexif.dir/rtexif.cc.o rtexif/CMakeFiles/rtexif.dir/sonyminoltaattribs.cc.o rtexif/CMakeFiles/rtexif.dir/stdattribs.cc.o && gcc-ranlib9 rtexif/librtexif.a && :
ar: unrecognized option `--plugin'
usage:  ar -d [-Tjsvz] archive file ...
	ar -m [-Tjsvz] archive file ...
	ar -m [-Tabijsvz] position archive file ...
	ar -p [-Tv] archive [file ...]
	ar -q [-TcDjsUvz] archive file ...
	ar -r [-TcDjsUuvz] archive file ...
	ar -r [-TabcDijsUuvz] position archive file ...
	ar -s [-jz] archive
	ar -t [-Tv] archive [file ...]
	ar -x [-CTouv] archive [file ...]
	ar -V
...
Comment 1 Matthias Andree freebsd_committer 2020-11-11 20:11:50 UTC
Note I cannot reproduce this on amd64, 12.1 (poudriere) and 12.2 (running system, "make -C /usr/ports/graphics/rawtherapee"). Please provide logs, else nobody can help you. I've sent a list of what's needed directly by e-mail.

This pretty much looks as though the binutils installation were damaged. Please try reinstalling binutils and gcc9.
Comment 2 Matthias Andree freebsd_committer 2020-11-11 20:20:33 UTC
We've had the same report before, and you didn't really assist in helping find the cause and didn't investigate the direction I've pointed to.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240594#c9
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240594#c13
and following.

You really need to make sure $LOCALBASE/bin is in path, and possibly retry with  $PREFIX == $LOCALBASE, and that your installation is using official means and not some contorted way.

I don't want to spend my time digging into somebody else's system with insufficient information and support on behalf of the reporter.

*** This bug has been marked as a duplicate of bug 240594 ***
Comment 3 Matthias Andree freebsd_committer 2020-11-11 20:21:40 UTC
(fixing up relationship between this and the earlier report)
Comment 4 Matthias Andree freebsd_committer 2020-11-11 20:23:21 UTC
BTW, a poudriere testport with PREFIX!=LOCALBASE also succeeds here, including some self-tests (smoke tests).  Let's for now assume your installation is somehow damaged.
Comment 5 lumiwa 2020-11-11 23:42:13 UTC
It doesn't build on my FreeBSD 12.2-RELEASE (amd64):

FAILED: rtexif/librtexif.a 
: && /usr/local/bin/cmake -E rm -f rtexif/librtexif.a && gcc-ar9 qc rtexif/librtexif.a  rtexif/CMakeFiles/rtexif.dir/canonattribs.cc.o rtexif/CMakeFiles/rtexif.dir/fujiattribs.cc.o rtexif/CMakeFiles/rtexif.dir/kodakattribs.cc.o rtexif/CMakeFiles/rtexif.dir/nikonattribs.cc.o rtexif/CMakeFiles/rtexif.dir/olympusattribs.cc.o rtexif/CMakeFiles/rtexif.dir/panasonicattribs.cc.o rtexif/CMakeFiles/rtexif.dir/pentaxattribs.cc.o rtexif/CMakeFiles/rtexif.dir/rtexif.cc.o rtexif/CMakeFiles/rtexif.dir/sonyminoltaattribs.cc.o rtexif/CMakeFiles/rtexif.dir/stdattribs.cc.o && gcc-ranlib9 rtexif/librtexif.a && :
ar: unrecognized option `--plugin'
usage:  ar -d [-Tjsvz] archive file ...
	ar -m [-Tjsvz] archive file ...
	ar -m [-Tabijsvz] position archive file ...
	ar -p [-Tv] archive [file ...]
	ar -q [-TcDjsUvz] archive file ...
	ar -r [-TcDjsUuvz] archive file ...
	ar -r [-TabcDijsUuvz] position archive file ...
	ar -s [-jz] archive
	ar -t [-Tv] archive [file ...]
	ar -x [-CTouv] archive [file ...]
	ar -V

Thank you.
Comment 6 Matthias Andree freebsd_committer 2020-11-12 01:23:29 UTC
(In reply to lumiwa from comment #5)
I believe there may be something, a PATH issue or binutils issue, but I certainly don't need "me too" comments that show the same failure mode, but I need information to debug this. 

Seriously. I cannot reproduce this with the information I have.

Something appears to be different on your systems, and we need to find out what it is.

Please provide:

- the full build log as attachment
- as copy&paste the system information from "uname -a" and
"freebsd-version -kru"
- as attachment a package list from "pkg info -qx".
- detailed information the exact working directory and command line you
use to build (copy & paste from console is fine)
- your relevant changed src.conf, make.conf and other build
configuration files

Preferably, the build log is from poudriere.

Only after the requested information is available here I will consider reopening the bug.
Comment 7 Matthias Andree freebsd_committer 2020-11-12 01:39:01 UTC
Detail: please also upload the configure cache, from work/.build/CMakeCache.txt, and state port options you may have changed, from /var/db/ports/graphics_rawtherapee/options
Comment 8 Matthias Andree freebsd_committer 2020-11-12 01:40:42 UTC
And the output of "which -a gcc-ar9" and the output of: echo $PATH
Comment 9 Matthias Andree freebsd_committer 2020-11-12 13:58:37 UTC
and I have made yet another successful test build in poudriere on 11.4 amd64.
Comment 10 Matthias Andree freebsd_committer 2020-11-12 16:05:01 UTC
I've found an old system where I could reproduce this. 
BINARY_ALIAS+=ar=${AR} ranlib=${RANLIB} appears to fix it. 

Testing...
Comment 11 commit-hook freebsd_committer 2020-11-12 22:42:20 UTC
A commit references this bug:

Author: mandree
Date: Thu Nov 12 22:41:57 UTC 2020
New revision: 554991
URL: https://svnweb.freebsd.org/changeset/ports/554991

Log:
  graphics/rawtherapee: build stability improvements

  - on some systems, the base binutils's ar does not support --plugin.
    Use BINARY_ALIAS to make sure the port/package binutils's ar and
    ranlib are used. [1]

  - while here, disable TCMALLOC on FreeBSD 11, which appears to cause
    strange errors in the run-time self-tests
    -> bump PORTREVISION to flush out old packages

  - while here, rearrange a bit per portclippy's suggestions

  PR:		251041 [1]
  PR:		240594 comment #9 [1]
  Reported by:	rozhuk.im@gmail.com [1]

Changes:
  head/graphics/rawtherapee/Makefile