Bug 245438 - Mk/Scripts/do-depends.sh fails to propagate DEBUG_MK_* environment variables to find-lib.sh
Summary: Mk/Scripts/do-depends.sh fails to propagate DEBUG_MK_* environment variables ...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
Depends on:
Reported: 2020-04-07 21:52 UTC by mrT
Modified: 2020-06-16 11:21 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description mrT 2020-04-07 21:52:09 UTC
Revision 531029: /head/Mk/Scripts/do-depends.sh
When building a port with make DEBUG_MK_SCRIPTS=1
                     or   make DEBUG_MK_SCRIPTS_FIND_LIB=1
when Mk/Scripts/do-depends.sh is called 
[ -n "${DEBUG_MK_SCRIPTS}" -o -n "${DEBUG_MK_SCRIPTS_FIND_LIB}" ] && set -x
and the shell tracing works as expected. (set -x)

However, when do-depends.sh calls sub-script: Mk/Scripts/find-lib.sh
there is no shell tracing for find-lib.sh

I believe the the cause is in Mk/Scripts/do-depends.sh
{ ... 
  libfile=$(env -i PATH="${PATH}" LIB_DIRS="${dp_LIB_DIRS}" LOCALBASE="${dp_LOCALBASE}" ${dp_SH} ${dp_SCRIPTSDIR}/find-lib.sh $1)

When ports calls Mk/Scripts/do-depends.sh
from: Mk/bsd.port.mk
it is using:   ${SETENV} \
            		dp_RAWDEPENDS="${${deptype}_DEPENDS}" \
            		dp_DEPTYPE="${deptype}_DEPENDS" \
                        ${SH} ${SCRIPTSDIR}/do-depends.sh

SETENV = /usr/bin/env

NOTE: I tried to use the 'preview' tab but it does not seem to be working,
      only get a blank description box.