rules_node icon indicating copy to clipboard operation
rules_node copied to clipboard

Cannot build node_binary depending on firebase module.

Open iphydf opened this issue 7 years ago • 2 comments

WORKSPACE:

RULES_NODE_COMMIT = "56eadbd6e7545411e740d97fe1741c56dab42285"

http_archive(
    name = "org_pubref_rules_node",
    sha256 = "9ed54e5fda5154aeff7b5ed51b85b83cbb630f70178ca1a1798af671c6cf945c",
    strip_prefix = "rules_node-%s" % RULES_NODE_COMMIT,
    url = "https://github.com/pubref/rules_node/archive/%s.zip" % RULES_NODE_COMMIT,
)

load("@org_pubref_rules_node//node:rules.bzl", "node_repositories", "yarn_modules")

node_repositories()

yarn_modules(
    name = "yarn_firebase",
    deps = {"firebase": "4.9.1"},
)

BUILD: any node_binary with deps = ["@yarn_firebase//:_all_"].

iphydf avatar Feb 18 '18 15:02 iphydf

_bin/build-runfiles (args bazel-out/k8-fastbuild/bin/cedar/backend/run.runfiles_manifest bazel-out/k8-fastbuild/bin/cedar/backend/run.runfiles): link or target filename contains space on line 6: 'toktok/cedar/backend/run_files/node_modules/@firebase/app/coverage/browser/HeadlessChrome 0.0.0 (Linux 0.0.0)/lcov.info /usr/local/home/iphy/.cache/bazel/_bazel_iphy/87c462f2b35b8d3dfe6f6c21308fd127/execroot/toktok/bazel-out/k8-fastbuild/bin/cedar/backend/run_files/node_modules/@firebase/app/coverage/browser/HeadlessChrome 0.0.0 (Linux 0.0.0)/lcov.info'

iphydf avatar Feb 18 '18 16:02 iphydf

Known issue: https://github.com/bazelbuild/bazel/issues/374

Wondering what the transitive dependency chain from firebase to headless chrome is. Clearly one does not actually need headless chrome to use the firebase node api. It may be a bug or design flaw in rules_node that puts the headless chrome dependency in _all_.

As a workaround, I'd try naming the deps more narrowly than _all_. You can query the available ones via bazel query @yarn_firebase//:* or less $(bazel info output_base)/external/yarn_firebase/BUILD.bazel

pcj avatar Feb 18 '18 19:02 pcj