PAIR-code / what-if-tool

Source code/webpage/demos for the What-If Tool
https://pair-code.github.io/what-if-tool
Apache License 2.0
893 stars 167 forks source link

Unable to build 'Error: Could not resolve import...' #140

Open kgizdov opened 3 years ago

kgizdov commented 3 years ago

Cannot build version 1.7.0 with the following error:

ERROR: /build/python-tensorboard_plugin_wit/src/build-plugin/dc1744944b445923ba52f0a1ae122281/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/BUILD:31:13: Bundling JavaScript ../org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js [rollup] failed (Exit 1): process-wrapper failed: error executing command
  (cd /build/python-tensorboard_plugin_wit/src/build-plugin/dc1744944b445923ba52f0a1ae122281/sandbox/processwrapper-sandbox/233/execroot/ai_google_pair_wit && \
  exec env - \
    TMPDIR=/tmp \
  /build/python-tensorboard_plugin_wit/src/build-plugin/install/4755db98940076dafaee47a6425c53cc/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/build_bazel_rules_nodejs/internal/rollup/rollup --config bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/_plugin_lib_polymer_interop_binary.rollup.conf.js --output.file bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js --output.sourcemap --output.sourcemapFile bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js.map --silent) process-wrapper failed: error executing command
  (cd /build/python-tensorboard_plugin_wit/src/build-plugin/dc1744944b445923ba52f0a1ae122281/sandbox/processwrapper-sandbox/233/execroot/ai_google_pair_wit && \
  exec env - \
    TMPDIR=/tmp \
  /build/python-tensorboard_plugin_wit/src/build-plugin/install/4755db98940076dafaee47a6425c53cc/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/build_bazel_rules_nodejs/internal/rollup/rollup --config bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/_plugin_lib_polymer_interop_binary.rollup.conf.js --output.file bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js --output.sourcemap --output.sourcemapFile bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js.map --silent)
[!] (commonjs plugin) Error: Could not resolve import 'ai_google_pair_wit/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/polymer-interop' from 'undefined'
Error: Could not resolve import 'ai_google_pair_wit/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/polymer-interop' from 'undefined'
    at Object.notResolved (/build/python-tensorboard_plugin_wit/src/build-plugin/dc1744944b445923ba52f0a1ae122281/execroot/ai_google_pair_wit/bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/_plugin_lib_polymer_interop_binary.rollup.conf.js:163:11)
    at /build/python-tensorboard_plugin_wit/src/build-plugin/dc1744944b445923ba52f0a1ae122281/sandbox/processwrapper-sandbox/233/execroot/ai_google_pair_wit/bazel-out/host/bin/external/build_bazel_rules_nodejs/internal/rollup/rollup.runfiles/build_bazel_rules_nodejs_rollup_deps/node_modules/rollup-plugin-commonjs/src/utils.js:20:68

Target //tensorboard_plugin_wit/pip_package:build_pip_package failed to build
ERROR: /build/python-tensorboard_plugin_wit/src/tensorboard_plugin_wit-1.7.0/tensorboard_plugin_wit/pip_package/BUILD:12:10 Bundling JavaScript ../org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js [rollup] failed (Exit 1): process-wrapper failed: error executing command
  (cd /build/python-tensorboard_plugin_wit/src/build-plugin/dc1744944b445923ba52f0a1ae122281/sandbox/processwrapper-sandbox/233/execroot/ai_google_pair_wit && \
  exec env - \
    TMPDIR=/tmp \
  /build/python-tensorboard_plugin_wit/src/build-plugin/install/4755db98940076dafaee47a6425c53cc/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/build_bazel_rules_nodejs/internal/rollup/rollup --config bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/_plugin_lib_polymer_interop_binary.rollup.conf.js --output.file bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js --output.sourcemap --output.sourcemapFile bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js.map --silent) process-wrapper failed: error executing command
  (cd /build/python-tensorboard_plugin_wit/src/build-plugin/dc1744944b445923ba52f0a1ae122281/sandbox/processwrapper-sandbox/233/execroot/ai_google_pair_wit && \
  exec env - \
    TMPDIR=/tmp \
  /build/python-tensorboard_plugin_wit/src/build-plugin/install/4755db98940076dafaee47a6425c53cc/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/build_bazel_rules_nodejs/internal/rollup/rollup --config bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/_plugin_lib_polymer_interop_binary.rollup.conf.js --output.file bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js --output.sourcemap --output.sourcemapFile bazel-out/k8-fastbuild/bin/external/org_tensorflow_tensorboard/tensorboard/components/experimental/plugin_lib/plugin_lib_polymer_interop_binary.es2015.js.map --silent)
INFO: Elapsed time: 115.468s, Critical Path: 14.71s
INFO: 879 processes: 653 internal, 217 processwrapper-sandbox, 9 worker.
FAILED: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED: Build did NOT complete successfully

Environment is:

# OS: Arch Linux x86_64, GCC 10.2.0, Python 3.8.6
# Bazel: v3.7.0
# build commands:
srcdir="/build/python-tensorboard_plugin_wit/src"
cd "${srcdir}"
mkdir -p "${srcdir}/build-plugin" "${srcdir}/build-witwidget"
bazel --output_user_root "${srcdir}/build-plugin" run --verbose_failures --sandbox_debug tensorboard_plugin_wit/pip_package:build_pip_package
bazel --output_user_root "${srcdir}/build-witwidget" run --verbose_failures --sandbox_debug witwidget/pip_package:build_pip_package
jameswex commented 3 years ago

Thanks for the report. I realize I've been building with a much older version of bazel (0.27.0). Could you downgrade to that and try?

foutrelis commented 3 years ago

Bazel 3.6.0 appears to be the most recent version that has worked for us. Bazel 3.7.0 (and 3.7.1rc3) fail with the log posted by @kgizdov.

adamjstewart commented 2 years ago

tensorboard 2.5.0 now requires Bazel 3.7.0+, and depends on tensorboard-plugin-wit. We really need to start supporting modern versions of Bazel.

jameswex commented 2 years ago

Just curious why you need to rebuild tensorboard-plugin-wit. Are you making changes to it? Thanks.

adamjstewart commented 2 years ago

No changes, but I'm updating our Spack build recipes for tensorboard and tensorboard-plugin-wit. Spack builds all software from source so we can get optimized binaries for supercomputers. We could theoretically install from wheels if we need to, but we would rather avoid it if possible.