pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: pkgsrc/mk



On Wed, 11 Jul 2012 17:59:09 +0900, John Marino <netbsd%marino.st@localhost> 
wrote:

On 7/11/2012 06:55, OBATA Akio wrote:
On Wed, 11 Jul 2012 02:19:47 +0900, John Marino <netbsd%marino.st@localhost> 
wrote:

line 645 of mk/compiler/gcc.mk is where these variables start getting
added to the list:
.if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada)

Can you type:
bmake -V '${_GCCBINDIR}' '${_GCC_BIN_PREFIX}'
to see those variable values?
And then check to see if you've got a binary ending in "ada" that is
triggering this condition? Maybe the base compiler on Mac OSX has an
gcc driver called "ada" or "something-ada" like lang/gcc-aux does.

${_GCCBINDIR} point to ${WRKDIR}/.wrapper/bin and wrapper `ada' will be
picked up.
You can probably reproduce it by using sudo for SU_CMD.
(related to _ROOT_CMD in bsd.pkg.mk? it will set PATH)

workaround is followings, avoid to pick up cc in wrapper.

Index: mk/compiler/gcc.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/compiler/gcc.mk,v
retrieving revision 1.123
diff -u -r1.123 gcc.mk
--- mk/compiler/gcc.mk 9 Jul 2012 07:42:17 -0000 1.123
+++ mk/compiler/gcc.mk 11 Jul 2012 04:25:29 -0000
@@ -126,7 +126,7 @@
# _CC is the full path to the compiler named by ${CC} if it can be found.
.if !defined(_CC)
_CC:= ${CC:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
-. for _dir_ in ${PATH:C/\:/ /g}
+. for _dir_ in ${PATH:C/\:/ /g:N${WRAPPER_BINDIR}}
. if empty(_CC:M/*)
. if exists(${_dir_}/${CC:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//})
_CC:= ${_dir_}/${CC:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}




I haven't been able to reproduce it, but I might have a cleaner
workaround for you guys to test.

"ada" will exist in ${WRKDIR}/.wrapper/bin for all packages due to the
alias in the mk/wrapper/bsd.wrapper.mk
For packages with "ada" set in "USE_LANGUAGES", it will also exist in
${WRKDIR}/.gcc/bin, along with gnat, gnatmake, gnatbind, gnatlink, etc.
All the "gnat*" executables will only be in ${WRKDIR}/.gcc/bin and never
in ${WRKDIR}/.wrapper/bin.

So the proposed change to gcc.mk might be the better fix:
--- a/mk/compiler/gcc.mk
+++ b/mk/compiler/gcc.mk
@@ -642,7 +642,8 @@ F77PATH=    ${_GCCBINDIR}/${_GCC_BIN_PREFIX}gfortran
  PKG_FC:=      ${_GCC_FC}
  PKGSRC_FORTRAN?=      gfortran
  .endif
-.if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada)
+.if exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}ada) \
+ && exists(${_GCCBINDIR}/${_GCC_BIN_PREFIX}gnatmake)
  _GCC_VARS+=   ADA GMK GLK GBD CHP PRP GLS GNT
  _GCC_ADA=     ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}ada
  _GCC_GMK=     ${_GCC_DIR}/bin/${_GCC_BIN_PREFIX}gnatmake


Let me know if that fixes both cases and then I'll commit it.
The reason I check for both "ada" and "gnatmake" is that "gnatmake" is a
common used name that may be on the system for other reasons reasons,
but "ada" as a driver name is not commonly used.  So checking for both
may avoid another false positive.

Yes, it hide the problem.

Now then, following patch should fix the problem.
I've dug history of bsd.pkg.mk, but I cannot find the reason why modified PATH
must be used here.
It is originally added at r1.1012 (at the time, _PATH_ORIG did not exist yet),
and copy&paste again and again to similar context.

Anyone know about the reason why? or I'll commit later.

Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1981
diff -u -r1.1981 bsd.pkg.mk
--- mk/bsd.pkg.mk       24 May 2012 11:34:15 -0000      1.1981
+++ mk/bsd.pkg.mk       11 Jul 2012 12:16:40 -0000
@@ -601,11 +601,9 @@
 #      The additional flags that are passed to the make process.
 #

-# XXX: Shouldn't the $${PATH} be ${PATH} here? This may be related to
-# PR 34470.
 _ROOT_CMD=     cd ${.CURDIR} &&                                        \
                ${PKGSRC_SETENV} ${PKGSRC_MAKE_ENV}                             
\
-                       PATH="$${PATH}:"${SU_CMD_PATH_APPEND:Q}         \
+                       PATH=${_PATH_ORIG:Q}:${SU_CMD_PATH_APPEND:Q}    \
                ${MAKE} ${MAKEFLAGS} _PKGSRC_BARRIER=yes                \
                        PKG_DEBUG_LEVEL=${PKG_DEBUG_LEVEL:Q}            \
                        su-${.TARGET} ${MAKEFLAGS.su-${.TARGET}}


--
OBATA Akio / obache%NetBSD.org@localhost



Home | Main Index | Thread Index | Old Index