Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve build deps before run deps #6683

Merged
merged 1 commit into from Jun 24, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -830,18 +830,18 @@ function _Resolve-ScaffoldingDependencies {
function _Set_DependencyArrays {
# Build `${pkg_all_deps_resolved[@]}` containing all direct build and run
# dependencies. The build dependencies appear before the run dependencies.
$script:pkg_all_deps_resolved = $pkg_deps_resolved + $pkg_build_deps_resolved
$script:pkg_all_deps_resolved = $pkg_build_deps_resolved + $pkg_deps_resolved
# Build an ordered set of all build and run dependencies (direct and
# transitive). The order is important as this gets used when setting the
# `$PATH` ordering in the build environment. To give priority to direct
# dependencies over transitive ones the order of packages is the following:
#
# 1. All direct run dependencies
# 2. All direct build dependencies
# 3. All unique transitive run dependencies that aren't already added
# 4. All unique transitive build dependencies that aren't already added
$script:pkg_all_tdeps_resolved = $pkg_deps_resolved + $pkg_build_deps_resolved
foreach($dep in ($pkg_tdeps_resolved + $pkg_build_tdeps_resolved)) {
# 1. All direct build dependencies
# 2. All direct run dependencies
# 3. All unique transitive build dependencies that aren't already added
# 4. All unique transitive run dependencies that aren't already added
$script:pkg_all_tdeps_resolved = $pkg_build_deps_resolved + $pkg_deps_resolved
foreach($dep in ($pkg_build_tdeps_resolved + $pkg_tdeps_resolved)) {
$script:pkg_all_tdeps_resolved = @(_return_or_append_to_set $dep $pkg_all_tdeps_resolved)
}
}
@@ -1144,24 +1144,24 @@ _populate_dependency_arrays() {
# Build `${pkg_all_deps_resolved[@]}` containing all direct build and run
# dependencies. The build dependencies appear before the run dependencies.
pkg_all_deps_resolved=(
"${pkg_deps_resolved[@]}"
"${pkg_build_deps_resolved[@]}"
"${pkg_deps_resolved[@]}"
)

# Build an ordered set of all build and run dependencies (direct and
# transitive). The order is important as this gets used when setting the
# `$PATH` ordering in the build environment. To give priority to direct
# dependencies over transitive ones the order of packages is the following:
#
# 1. All direct run dependencies
# 2. All direct build dependencies
# 3. All unique transitive run dependencies that aren't already added
# 4. All unique transitive build dependencies that aren't already added
# 1. All direct build dependencies
# 2. All direct run dependencies
# 3. All unique transitive build dependencies that aren't already added
# 4. All unique transitive run dependencies that aren't already added
pkg_all_tdeps_resolved=(
"${pkg_deps_resolved[@]}"
"${pkg_build_deps_resolved[@]}"
"${pkg_deps_resolved[@]}"
)
for dep in "${pkg_tdeps_resolved[@]}" "${pkg_build_tdeps_resolved[@]}"; do
for dep in "${pkg_build_tdeps_resolved[@]}" "${pkg_tdeps_resolved[@]}"; do

This comment has been minimized.

Copy link
@christophermaier

christophermaier Jun 24, 2019

Contributor

Is it possible to have some tests for this behavior? It's hard to determine from reading the code if this does the right thing (or if this is reversed by the code adding these to the $PATH)

😭

read -r -a pkg_all_tdeps_resolved <<< "$(_return_or_append_to_set "$dep" "${pkg_all_tdeps_resolved[@]}")" # See syntax note @ _return_or_append_to_set
done
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.