Merge pull request #4069 from davydden/fix_transitive_build_dep

only add direct build-only dependencies to PATH
This commit is contained in:
scheibelp 2017-05-03 18:41:26 -07:00 committed by GitHub
commit bee105fbb9

View File

@ -248,7 +248,7 @@ def set_build_environment_variables(pkg, env, dirty=False):
dirty (bool): Skip unsetting the user's environment settings dirty (bool): Skip unsetting the user's environment settings
""" """
# Gather information about various types of dependencies # Gather information about various types of dependencies
build_deps = pkg.spec.traverse(root=False, deptype=('build')) build_deps = pkg.spec.dependencies(deptype='build')
link_deps = pkg.spec.traverse(root=False, deptype=('link')) link_deps = pkg.spec.traverse(root=False, deptype=('link'))
build_link_deps = pkg.spec.traverse(root=False, deptype=('build', 'link')) build_link_deps = pkg.spec.traverse(root=False, deptype=('build', 'link'))
rpath_deps = get_rpath_deps(pkg) rpath_deps = get_rpath_deps(pkg)
@ -258,6 +258,11 @@ def set_build_environment_variables(pkg, env, dirty=False):
build_link_prefixes = [dep.prefix for dep in build_link_deps] build_link_prefixes = [dep.prefix for dep in build_link_deps]
rpath_prefixes = [dep.prefix for dep in rpath_deps] rpath_prefixes = [dep.prefix for dep in rpath_deps]
# add run-time dependencies of direct build-time dependencies:
for bd in build_deps:
for rd in bd.dependencies(deptype='run'):
build_prefixes.append(rd.prefix)
# Filter out system paths: ['/', '/usr', '/usr/local'] # Filter out system paths: ['/', '/usr', '/usr/local']
# These paths can be introduced into the build when an external package # These paths can be introduced into the build when an external package
# is added as a dependency. The problem with these paths is that they often # is added as a dependency. The problem with these paths is that they often