Skip to content

Commit

Permalink
pw_build: Add deps, fix pip.lock file
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Ted Pudlik <[email protected]>
Reviewed-by: Armando Montanez <[email protected]>
Pigweed-Auto-Submit: Anthony DiGirolamo <[email protected]>
  • Loading branch information
AnthonyDiGirolamo authored and CQ Bot Account committed Apr 29, 2022
1 parent fadddbc commit f22e4ab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions pw_build/cc_blob_library.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
1 change: 1 addition & 0 deletions pw_build/host_tool.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
3 changes: 2 additions & 1 deletion pw_build/python.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion pw_build/python_action.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down

0 comments on commit f22e4ab

Please sign in to comment.