From f22e4ab3f510258b1e2753567af5809bd167edaf Mon Sep 17 00:00:00 2001 From: Anthony DiGirolamo Date: Fri, 29 Apr 2022 09:31:12 -0700 Subject: [PATCH] pw_build: Add deps, fix pip.lock file The existing pip.lock file was getting created for each toolchain. This CL changes it to use only a single pip.lock file in the out dir. Additionally it adds two missing python_deps and fixes the Python metadata gn_target_name value. Change-Id: I01be778397687099bcdc8a1106a0cfb1124583ab Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/92820 Commit-Queue: Auto-Submit Reviewed-by: Ted Pudlik Reviewed-by: Armando Montanez Pigweed-Auto-Submit: Anthony DiGirolamo --- pw_build/cc_blob_library.gni | 1 + pw_build/host_tool.gni | 1 + pw_build/python.gni | 3 ++- pw_build/python_action.gni | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pw_build/cc_blob_library.gni b/pw_build/cc_blob_library.gni index 0a8a9d0f53..7e794d9961 100644 --- a/pw_build/cc_blob_library.gni +++ b/pw_build/cc_blob_library.gni @@ -60,6 +60,7 @@ template("pw_cc_blob_library") { "public_deps", ]) module = "pw_build.generate_cc_blob_library" + python_deps = [ "$dir_pw_build/py" ] _header = "${target_gen_dir}/public/" + invoker.out_header _source = diff --git a/pw_build/host_tool.gni b/pw_build/host_tool.gni index 53344f3bba..ac7d7c8a7e 100644 --- a/pw_build/host_tool.gni +++ b/pw_build/host_tool.gni @@ -44,6 +44,7 @@ template("pw_host_tool") { script = "$dir_pw_build/py/pw_build/host_tool.py" args = _script_args deps = [ invoker.tool ] + python_deps = [ "$dir_pw_cli/py" ] stamp = true } } diff --git a/pw_build/python.gni b/pw_build/python.gni index 0f8de8fcea..3b069fd1a4 100644 --- a/pw_build/python.gni +++ b/pw_build/python.gni @@ -328,7 +328,8 @@ template("pw_python_package") { # Get Python package metadata and write to disk as JSON. _package_metadata = { - gn_target_name = get_label_info(invoker.target_name, "label_no_toolchain") + gn_target_name = + get_label_info(":${invoker.target_name}", "label_no_toolchain") # Get package source files sources = rebase_path(_sources, root_build_dir) diff --git a/pw_build/python_action.gni b/pw_build/python_action.gni index 1110535cf6..7fc160f77d 100644 --- a/pw_build/python_action.gni +++ b/pw_build/python_action.gni @@ -68,8 +68,9 @@ template("pw_python_action") { # pip lockfile, prevents pip from running in parallel with other Python # actions. "--lockfile", - rebase_path("$root_out_dir/pip.lock", root_build_dir), + # Use a single lockfile for the entire out directory. + "pip.lock", "--default-toolchain=$default_toolchain", "--current-toolchain=$current_toolchain", ]