Skip to content

Commit

Permalink
pw_build: Fix output_logs_ unused warning
Browse files Browse the repository at this point in the history
This variable is only used when being built with the right toolchain.
In order to set this variable in fuchsia and not have GN complain it's
unused, it must be set as not_needed in other situations.

Bug: b/295524695
Change-Id: I9c1b235a49acbe7d2c4f41274146e5aa079cdfb6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/166991
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
  • Loading branch information
gilhooleyd authored and CQ Bot Account committed Aug 18, 2023
1 parent 7b76986 commit 10f0956
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pw_build/python_venv.gni
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ template("pw_python_venv") {
"_generated_requirements_file",
])
}
_output_logs = true
if (defined(invoker.output_logs)) {
_output_logs = invoker.output_logs
}
if (!defined(invoker.output_logs) ||
current_toolchain != pw_build_PYTHON_TOOLCHAIN) {
not_needed([ "_output_logs" ])
}

_source_package_labels = []
foreach(pkg, _source_packages) {
Expand Down Expand Up @@ -197,12 +205,6 @@ template("pw_python_venv") {

if (defined(invoker.source_packages) || defined(invoker.requirements)) {
if (current_toolchain == pw_build_PYTHON_TOOLCHAIN) {
if (defined(invoker.output_logs)) {
_output_logs = invoker.output_logs
} else {
_output_logs = true
}

# Compile requirements with hashes
pw_python_action("${target_name}._compile_requirements") {
module = "piptools"
Expand Down

0 comments on commit 10f0956

Please sign in to comment.