build: avoid error in `build-packages-dist.sh` (#32923)

Not sure why it works on other people's environments, but after
217db9b21 I started getting the following error when running
`scripts/build-packages-dist.sh` (on Windows):

```
ERROR: C:/.../angular/packages/bazel/docs/BUILD.bazel:3:1: Generating Skylark documentation dir for docs (3 files) failed (Exit 1)
Traceback (most recent call last):
  File "c:\...\temp\Bazel.runfiles_u_l5te\runfiles\io_bazel_skydoc\skydoc\main.py", line 335, in <module>
    main(sys.argv)
  File "c:\...\temp\Bazel.runfiles_u_l5te\runfiles\io_bazel_skydoc\skydoc\main.py", line 303, in main
    load_symbols = load_sym_extractor.extract(bzl_file)
  File "c:\...\temp\Bazel.runfiles_u_l5te\runfiles\io_bazel_skydoc\skydoc\load_extractor.py", line 110, in extract
    load_symbols = self._extract_loads(bzl_file)
  File "c:\...\temp\Bazel.runfiles_u_l5te\runfiles\io_bazel_skydoc\skydoc\load_extractor.py", line 38, in _extract_loads
    tree = ast.parse(f.read(), bzl_file)
  File "C:\...\.windows-build-tools\python27\lib\ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "packages/bazel/src/ng_package/ng_package.bzl", line 39
    print("[ng_package.bzl]", *args)
                              ^
SyntaxError: invalid syntax
```

It seems expected, because `print` is not a function, so
`print(foo, *args)` is interpreted as printing a tuple (where `*args` is
invalid syntax). Not sure why it doesn't break on other people's
machines :/

This change makes the verbose logs a little less pretty, but that
shouldn't be a big issue (given that it is an opt-in feature and it can
always be overwritten locally, if necessary).

PR Close #32923
This commit is contained in:
George Kalpakas 2019-09-30 21:43:38 +03:00 committed by atscott
parent adb562bca6
commit 75fd407bbd
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ load("//packages/bazel/src/ng_package:collect-type-definitions.bzl", "collect_ty
# Prints a debug message if "--define=VERBOSE_LOGS=true" is specified. # Prints a debug message if "--define=VERBOSE_LOGS=true" is specified.
def _debug(vars, *args): def _debug(vars, *args):
if "VERBOSE_LOGS" in vars.keys(): if "VERBOSE_LOGS" in vars.keys():
print("[ng_package.bzl]", *args) print("[ng_package.bzl]", args)
_DEFAULT_NG_PACKAGER = "@npm//@angular/bazel/bin:packager" _DEFAULT_NG_PACKAGER = "@npm//@angular/bazel/bin:packager"