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

Use --concurrency with brew fetch #1244

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/tests/bottles_fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def fetch_bottles!(formula_name, args:)

tags.each do |tag|
cleanup_during!(args:)
test "brew", "fetch", "--retry", "--formulae", "--bottle-tag=#{tag}", formula_name
test "brew", "fetch", "--retry", "--formulae", "--bottle-tag=#{tag}",
"--concurrency", Homebrew::EnvConfig.make_jobs,
Copy link
Member

@reitermarkus reitermarkus Sep 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is Homebrew::EnvConfig.make_jobs in CI usually?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as default -- number of cores. So somewhere between 2-6.

formula_name
end
end
end
Expand Down
11 changes: 8 additions & 3 deletions lib/tests/formulae.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,16 @@ def setup_formulae_deps_instances(formula, formula_name, args:)

dependencies -= installed
@unchanged_dependencies = dependencies - @testing_formulae
test "brew", "fetch", "--formulae", "--retry", *@unchanged_dependencies unless @unchanged_dependencies.empty?
unless @unchanged_dependencies.empty?
test "brew", "fetch", "--formulae", "--retry",
"--concurrency", Homebrew::EnvConfig.make_jobs,
*@unchanged_dependencies
end

changed_dependencies = dependencies - @unchanged_dependencies
unless changed_dependencies.empty?
test "brew", "fetch", "--formulae", "--retry", "--build-from-source",
"--concurrency", Homebrew::EnvConfig.make_jobs,
*changed_dependencies

ignore_failures = !args.test_default_formula? && changed_dependencies.any? do |dep|
Expand Down Expand Up @@ -453,7 +458,7 @@ def formula!(formula_name, args:)
install_ca_certificates_if_needed

if (messages = unsatisfied_requirements_messages(formula))
test "brew", "fetch", "--formula", "--retry", *fetch_args
test "brew", "fetch", "--formula", "--retry", "--concurrency", Homebrew::EnvConfig.make_jobs, *fetch_args
test "brew", "audit", "--formula", *audit_args

skipped formula_name, messages
Expand Down Expand Up @@ -485,7 +490,7 @@ def formula!(formula_name, args:)

info_header "Starting tests for #{formula_name}"

test "brew", "fetch", "--formula", "--retry", *fetch_args
test "brew", "fetch", "--formula", "--retry", "--concurrency", Homebrew::EnvConfig.make_jobs, *fetch_args

env = {}
env["HOMEBREW_GIT_PATH"] = nil if deps.any? do |d|
Expand Down
6 changes: 4 additions & 2 deletions lib/tests/formulae_dependents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,16 @@ def install_dependent(dependent, testable_dependents, args:, build_from_source:

build_args << "--build-from-source"

test "brew", "fetch", "--build-from-source", "--retry", dependent.full_name
test "brew", "fetch", "--build-from-source", "--retry",
"--concurrency", Homebrew::EnvConfig.make_jobs,
dependent.full_name
return if steps.last.failed?
else
fetch_formulae << dependent.full_name
end

if fetch_formulae.present?
test "brew", "fetch", "--retry", *fetch_formulae
test "brew", "fetch", "--retry", "--concurrency", Homebrew::EnvConfig.make_jobs, *fetch_formulae
return if steps.last.failed?
end

Expand Down
Loading