- Rename pw_python_script to pw_python_action, which more clearly
describes the intent of the template (wrapper around action) and
avoids confusion with the new pw_python_package template.
- Make pw_python_script as an alias for pw_python_action.
- Update the documentation and comments, and do some minor cleanup.
- Create python_script.gni file for backwards compatibility.
Change-Id: I98ab99021c57b1357c18ec23b50c59272c61c7b9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22001
Reviewed-by: Alexei Frolov <frolv@google.com>
Rename the python_script.gni file to python_action.gni to prepare to
rename the pw_python_script template.
An alias .gni file is created in separate change so that Git tracks this
as a file move rather than an update.
Change-Id: I812cf3bd73909593c5369c7437da16529e1a375a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22000
Reviewed-by: Alexei Frolov <frolv@google.com>
- Don't implicitly convert paths and labels in python_runner.py.
- To enable finding target outputs, support explicit resolution with
the <TARGET_FILE($target)> expression.
- Use the standard GN rebase_path approach to resolve GN paths to
filesystem paths for scripts. Remove workarounds that are no longer
necessary.
- Update build files to use rebase_path and <TARGET_FILE(target)>.
- Add tests for python_runner.py.
Bug: 110
Change-Id: Iae262820bb265c648c270c2b78d058f20e1d3d1f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/14801
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
This change updates the pw_exec GN template and wrapper script to hide
the output of the program unless it exits unsuccessfully.
Sample output:
20200103 13:40:06 ERR
20200103 13:40:06 ERR Command failed with exit code 2 in GN build.
20200103 13:40:06 ERR
20200103 13:40:06 ERR Build target:
20200103 13:40:06 ERR
20200103 13:40:06 ERR pw_target_runner_client_pw_go_get
20200103 13:40:06 ERR
20200103 13:40:06 ERR Full command:
20200103 13:40:06 ERR
20200103 13:40:06 ERR go got github.com/golang/protobuf/proto google.golang.org/grpc
20200103 13:40:06 ERR
20200103 13:40:06 ERR Process output:
go got: unknown command
Run 'go help' for usage.
20200103 13:40:06 ERR
Bug: 34
Change-Id: I7e7b2a6d359ecf1eeff6918d56defb909141cbfd
This change updates the Go GN integration to download external
dependencies for Go packages before running "go build". These
dependencies are listed in the pw_go_package template using build
metadata and collected to a "go get" invocation.
To support this, the pw_exec template is expanded to allow setting
positional arguments from a file.
Change-Id: If4f6c71f037b35bb041984da9982a1629d1d36b0
This change adds support for defining environment variables in processes
run through pw_exec. Environment variables can either be specified
directly in the GN template or through a file (which could be generated
from build metadata).
Change-Id: Ic941b3f907143a648707a44de01da8332021270e
This change adds a GN template which executes a non-Python program to
avoid having to write custom Python wrappers every time.
Change-Id: I36aa607dc99072d26ea7242f6ce110f2b43f71db