Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Dec 2016 01:21:34 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 215542] ports-mgmt/portmaster: -r428604: mishandles USE_GCC=any context when lang/gcc6-devel is already installed, for example
Message-ID:  <bug-215542-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D215542

            Bug ID: 215542
           Summary: ports-mgmt/portmaster: -r428604: mishandles
                    USE_GCC=3Dany context when lang/gcc6-devel is already
                    installed, for example
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs@FreeBSD.org
          Reporter: markmi@dsl-only.net
                CC: gerald@FreeBSD.org, tz@freebsd.org
                CC: gerald@FreeBSD.org, tz@freebsd.org

This note uses lang/gcc6-devel and lang/gcc6 vs. ports-mgmt/postmaster
as an example of a more general issue. Another port having USE_GCC=3Dany
in use was involved and I had lang/gcc6-devel already installed (and
no other lang/gcc* ). lang/gcc6-devel has been installed via
portmaster.

The issue is tied to both of those lang/gcc6* 's install gcc6 . If one
is installed already the other should not be attempted: they conflict.

ports-mgmt/portmaster tried to install lang/gcc6 instead.

First I'll quote wha the gcc6 maintainer Gerald Pfeifer wrote about
the expected build environment behavior in a message-list exchange that
we had:

BEGIN QUOTE:
USE_GCC=3Dany is the equivalent of USE_GCC=3D4.2+, and lang/gcc6 and
lang/gcc6-devel should both meet this requirement.
. . . (omitted interlaced material from me) . . .
That works as designed.  USE_GCC=3Dyes defaults to lang/gcc.  USE_GCC=3Dany=
=20
tries to use an existing GCC system compiler and lang/gcc by default if=20
none is present.
. . .
It means gcc6 from lang/gcc6-devel is found
and identified as a suitable version of GCC.
. . .
Then Mk/bsd.gcc.mk adds

BUILD_DEPENDS+=3D gcc6:lang/gcc6

when it resolves USE_GCC=3Dany.

That should not trigger and pull in lang/gcc6, though, as long
as gcc6 is found.
END QUOTE.


But what I found for this context was that using postmaster
was that it checks via:

pkg query %n-%v lang/gcc6

and never via:

pkg query %n-%v gcc6

(or anything based on just gcc6 or on lang/gcc6-devel that had
been used for installation of gcc6 ).

In essence the USE_GCC=3Dany lead to use of the wrong "origin" for
gcc6 despite prior portmaster use to install gcc6 via gcc6-devel.


>From the "pkg query %n-%v lang/gcc6" test result portmaster is
programmed to try to install lang/gcc6 even if gcc6 is already
installed.

The attempt fails because of conflicts between lang/gcc6-devel and
lang/gcc6 . (The conflicts are expected/required.)

I temporarily edited portmaster to use "sh -x" so that its execution
could be observed in detail and logged. The relevant part was:

+ pm_cd /usr/ports/lang/gcc6
+ builtin cd /usr/ports/lang/gcc6
+ grep -ql ^CONFLICTS Makefile
+ origin=3Dlang/gcc6
+ iport_from_origin lang/gcc6
+ local sn dir
+ [ -n yes ]
+ pkg query %n-%v lang/gcc6
+ return 1
+ iport=3D''
+ check_exclude lang/gcc6
+ [ -n '' ]
+ return 0
+ [ -n '' -a -n '' ]
+ [ -n '' -a -n '' ]
+ [ -n '' ]
+ check_interactive lang/gcc6
+ [ -n '' ]
+ return 0
+ update_port lang/gcc6
+ local deps
+ [ -n '' ]
+ [ -z '' ]
+ echo '=3D=3D=3D>>> Launching child to install lang/gcc6'
=3D=3D=3D>>> Launching child to install lang/gcc6
+ dep_of_deps=3D2
+ [ -n pm_first_pass ]
+ [ ! '(' -n '' -a -n '' ')' ]
+ num_of_deps=3D2
+ deps=3D'(2/2)'
+ term_printf ' >> devel/kBuild >> lang/gcc6 (2/2)'
+ echo -e '\n=3D=3D=3D>>> emulators/virtualbox-ose-additions >> devel/kBuil=
d >>
lang/gcc6 (2/2)'

=3D=3D=3D>>> emulators/virtualbox-ose-additions >> devel/kBuild >> lang/gcc=
6 (2/2)
+ [ -n '' ]
+ printf '\033]0;portmaster: emulators/virtualbox-ose-additions >> devel/kB=
uild
>> lang/gcc6 (2/2)\007'
ESC]0;portmaster: emulators/virtualbox-ose-additions >> devel/kBuild >>
lang/gcc6 (2/2)^G+ [ -n doing_dep_check -o '(' -n '' -a -n pm_first_pass ')=
' ]
+ unset NO_DEP_UPDATES
+ [ -z '' -o -n pm_first_pass ]
+ sh -x /usr/local/sbin/portmaster -D -K lang/gcc6
+ trap trap_exit INT


(So devel/kBuild was what was using USE_GCC=3Dany in my specific example.)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-215542-13>