Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorBoard doesn’t build with Bazel 0.27 (and once it builds it doesn’t run) #2355

Closed
wchargin opened this issue Jun 17, 2019 · 2 comments
Assignees

Comments

@wchargin
Copy link
Contributor

wchargin commented Jun 17, 2019

New incompatible flags:

$ ~/Downloads/bazel-0.27.0-linux-x86_64 build //tensorboard 2>&1
Loading: 0 packages loaded
Analyzing: target //tensorboard:tensorboard (0 packages loaded, 0 targets configured)
INFO: Call stack for the definition of repository 'org_pocoo_werkzeug' which is a http_archive (rule definition at /HOMEDIR/.bazel-output-base/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):
 - /HOMEDIR/git/tensorboard/third_party/python.bzl:69:5
 - /HOMEDIR/git/tensorboard/third_party/workspace.bzl:32:3
 - /HOMEDIR/git/tensorboard/WORKSPACE:70:1
ERROR: /HOMEDIR/.bazel-output-base/external/com_google_protobuf/protobuf.bzl:130:19: Traceback (most recent call last):
	File "/HOMEDIR/.bazel-output-base/external/com_google_protobuf/protobuf.bzl", line 125
		rule(attrs = {"srcs": attr.label_list...()}, <2 more arguments>)
	File "/HOMEDIR/.bazel-output-base/external/com_google_protobuf/protobuf.bzl", line 130, in rule
		attr.label(cfg = "host", executable = True, sin..., ...)
'single_file' is no longer supported. use allow_single_file instead. You can use --incompatible_disable_deprecated_attr_params=false to temporarily disable this check.
ERROR: /HOMEDIR/git/tensorboard/tensorboard/BUILD:168:1: error loading package 'tensorboard/plugins/histogram': in /HOMEDIR/git/tensorboard/tensorboard/defs/protos.bzl: Extension file 'protobuf.bzl' has errors and referenced by '//tensorboard:default'
ERROR: Analysis of target '//tensorboard:tensorboard' failed; build aborted: error loading package 'tensorboard/plugins/histogram': in /HOMEDIR/git/tensorboard/tensorboard/defs/protos.bzl: Extension file 'protobuf.bzl' has errors
INFO: Elapsed time: 0.139s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 4 targets configured)
FAILED: Build did NOT complete successfully (0 packages loaded, 4 targets configured)

The following flags suffice to get the build to work:

--incompatible_depset_is_not_iterable=false \
--incompatible_disable_deprecated_attr_params=false \
--incompatible_new_actions_api=false \
--incompatible_no_support_tools_in_action_inputs=false \
;

You need to additionally add

--incompatible_use_python_toolchains=false

for Python virtualenv imports to resolve at runtime.

It’s not obvious to me why depset_is_not_iterable is back, given that
we fixed those already, but I’ll look into it.

@wchargin wchargin self-assigned this Jun 17, 2019
wchargin added a commit that referenced this issue Jun 20, 2019
Summary:
One of many changes needed for Bazel 0.27.0; see #2355.

Test Plan:
The following command now works on Bazel 0.27.0:

```
bazel run \
  --incompatible_depset_is_not_iterable=true \
  --incompatible_disable_deprecated_attr_params=false \
  --incompatible_new_actions_api=false \
  --incompatible_no_support_tools_in_action_inputs=false \
  --incompatible_use_python_toolchains=false \
  //tensorboard -- --logdir ~/tensorboard_data
```

With the same `--incompatible_*` flags, all targets build and all tests
pass.

wchargin-branch: bazel-depset-is-not-iterable
wchargin added a commit that referenced this issue Jun 20, 2019
Summary:
One of many changes needed for Bazel 0.27.0; see #2355. This one is
solved by a simple protobuf upgrade.

Test Plan:
The following command now works on Bazel 0.27.0:

```
bazel run \
  --incompatible_depset_is_not_iterable=true \
  --incompatible_disable_deprecated_attr_params=true \
  --incompatible_new_actions_api=false \
  --incompatible_no_support_tools_in_action_inputs=false \
  --incompatible_use_python_toolchains=false \
  //tensorboard -- --logdir ~/tensorboard_data
```

With the same `--incompatible_*` flags, all targets build and all tests
pass.

wchargin-branch: bazel-disable-deprecated-attr-params
wchargin added a commit that referenced this issue Jun 20, 2019
Summary:
One of many changes needed for Bazel 0.27.0; see #2355.

TODO: Is using `paths.join` everywhere really the recommended path? The
previous form was substantially more convenient and no less principled,
and the documentation on `paths.join` suggests that it doesn’t insert
backslashes properly on Windows.

Test Plan:
The following command now works on Bazel 0.27.0:

```
bazel run \
  --incompatible_depset_is_not_iterable=true \
  --incompatible_disable_deprecated_attr_params=true \
  --incompatible_new_actions_api=true \
  --incompatible_no_support_tools_in_action_inputs=false \
  --incompatible_use_python_toolchains=false \
  //tensorboard -- --logdir ~/tensorboard_data
```

With the same `--incompatible_*` flags, all targets build and all tests
pass.

wchargin-branch: bazel-new-actions-api
wchargin added a commit that referenced this issue Jun 20, 2019
Summary:
One of many changes needed for Bazel 0.27.0; see #2355.

As mentioned in a comment, the fact that `collect_runfiles` continues to
be required surprises me: the `_tsc` `sh_binary` clearly declares `data`
dependencies on both Node and `tsc.js`, but those are apparently not
being included in the runfiles even when `_tsc` is passed in `tools`.

Test Plan:
The following command now works on Bazel 0.27.0:

```
bazel run \
  --incompatible_depset_is_not_iterable=true \
  --incompatible_disable_deprecated_attr_params=true \
  --incompatible_new_actions_api=true \
  --incompatible_no_support_tools_in_action_inputs=true \
  --incompatible_use_python_toolchains=false \
  //tensorboard -- --logdir ~/tensorboard_data
```

With the same `--incompatible_*` flags, all targets build and all tests
pass.

wchargin-branch: bazel-no-support-tools-in-action-inputs
@wchargin wchargin changed the title TensorBoard doesn’t build with Bazel 0.27 TensorBoard doesn’t build with Bazel 0.27 (and once it builds it doesn’t run) Jun 20, 2019
wchargin added a commit that referenced this issue Jun 21, 2019
Summary:
One of many changes needed for Bazel 0.27.0; see #2355.

Test Plan:
The following command now works on Bazel 0.27.0:

```
bazel run \
  --incompatible_depset_is_not_iterable=true \
  --incompatible_disable_deprecated_attr_params=false \
  --incompatible_new_actions_api=false \
  --incompatible_no_support_tools_in_action_inputs=false \
  --incompatible_use_python_toolchains=false \
  //tensorboard -- --logdir ~/tensorboard_data
```

With the same `--incompatible_*` flags, all targets build and all tests
pass.

wchargin-branch: bazel-depset-is-not-iterable
wchargin added a commit that referenced this issue Jun 21, 2019
Summary:
One of many changes needed for Bazel 0.27.0; see #2355. This one is
solved by a simple protobuf upgrade.

Test Plan:
The following command now works on Bazel 0.27.0:

```
bazel run \
  --incompatible_depset_is_not_iterable=true \
  --incompatible_disable_deprecated_attr_params=true \
  --incompatible_new_actions_api=false \
  --incompatible_no_support_tools_in_action_inputs=false \
  --incompatible_use_python_toolchains=false \
  //tensorboard -- --logdir ~/tensorboard_data
```

With the same `--incompatible_*` flags, all targets build and all tests
pass.

wchargin-branch: bazel-disable-deprecated-attr-params
wchargin added a commit that referenced this issue Jun 21, 2019
Summary:
One of many changes needed for Bazel 0.27.0; see #2355.

TODO: Is using `paths.join` everywhere really the recommended path? The
previous form was substantially more convenient and no less principled,
and the documentation on `paths.join` suggests that it doesn’t insert
backslashes properly on Windows.

Test Plan:
The following command now works on Bazel 0.27.0:

```
bazel run \
  --incompatible_depset_is_not_iterable=true \
  --incompatible_disable_deprecated_attr_params=true \
  --incompatible_new_actions_api=true \
  --incompatible_no_support_tools_in_action_inputs=false \
  --incompatible_use_python_toolchains=false \
  //tensorboard -- --logdir ~/tensorboard_data
```

With the same `--incompatible_*` flags, all targets build and all tests
pass.

wchargin-branch: bazel-new-actions-api
wchargin added a commit that referenced this issue Jun 21, 2019
Summary:
One of many changes needed for Bazel 0.27.0; see #2355.

As mentioned in a comment, the fact that `collect_runfiles` continues to
be required surprises me: the `_tsc` `sh_binary` clearly declares `data`
dependencies on both Node and `tsc.js`, but those are apparently not
being included in the runfiles even when `_tsc` is passed in `tools`.

Test Plan:
The following command now works on Bazel 0.27.0:

```
bazel run \
  --incompatible_depset_is_not_iterable=true \
  --incompatible_disable_deprecated_attr_params=true \
  --incompatible_new_actions_api=true \
  --incompatible_no_support_tools_in_action_inputs=true \
  --incompatible_use_python_toolchains=false \
  //tensorboard -- --logdir ~/tensorboard_data
```

With the same `--incompatible_*` flags, all targets build and all tests
pass.

wchargin-branch: bazel-no-support-tools-in-action-inputs
@wchargin
Copy link
Contributor Author

wchargin commented Aug 9, 2019

Update: All the syntax errors have been fixed, but the semantics are
still broken due to Python toolchains as described above. As of 0.28.1,
passing --incompatible_use_python_toolchains=false does suffice to get
everything working.

I’ve just learned that Bazel supports workspace-level .bazelrcs
in addition to the standard home directory .bazelrcs. Indeed, after

diff --git a/.bazelrc b/.bazelrc
new file mode 100644
index 00000000..5cc98e94
--- /dev/null
+++ b/.bazelrc
@@ -0,0 +1 @@
+common --incompatible_use_python_toolchains=false

I can run bazel run //tensorboard -- --logdir ~/tensorboard_data with
no trouble on 0.28.1. (Which also means that there were no breaking
changes in 0.28—nice!) All tests pass, too. Perhaps we should adopt such
a file so that we can remain just a bit closer to stable? (edit: #2535)

wchargin added a commit that referenced this issue Aug 9, 2019
Summary:
This expands our forward-compatibility window to at least 0.29.0rc4 by
opting out of the `--incompatible_use_python_toolchains` flag whose
default was flipped in 0.27.0 (see #2355).

Test Plan:
On Bazel 0.29.0rc4, verify that `//tensorboard` builds and runs
correctly and that all tests pass, without the need to manually specify
any flags to Bazel.

wchargin-branch: bazelrc-toolchains
wchargin added a commit that referenced this issue Aug 9, 2019
Summary:
This expands our forward-compatibility window to at least 0.29.0rc4 by
opting out of the `--incompatible_use_python_toolchains` flag whose
default was flipped in 0.27.0 (see #2355).

Fixes #2534.

Test Plan:
On Bazel 0.29.0rc4, verify that `//tensorboard` fetches, builds, and
runs correctly and that all tests pass, without the need to manually
specify any flags to Bazel.

wchargin-branch: bazelrc-toolchains
@wchargin
Copy link
Contributor Author

We now actually do build on 0.27.0 through 0.29.0rc4, so I’m going to
close this even though we rely on a .bazelrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant