build: allow bazel build ... (#22168)

Note, the reason this commit removes `firebase-tools` is:

1) firebase-tools has an optional dependency on
https://www.npmjs.com/package/@google-cloud/functions-emulator
2) yarn's `--ignore-optional` doesn't work for transitive deps, so
there's no way to yarn install without getting that functions-emulator
package
3) functions-emulator has a transitive dep on `grpc`
4) the version of `grpc` we get has `BUILD` files and no `WORKSPACE`
file so it always breaks `bazel build ...`

It could be solved by any of:
1) remove firebase-tools - this is what I did
2) fix yarn so you can omit optional deps of a transitive dep
3) make functions-emulator depend transitively on a more recent `grpc`
version
4) patch `grpc` after install by doing an `rm` command in our
postinstall or something

In its place we must install protobufjs. This is needed by the
ngc-wrapped test, which needs jasmine as well as bazel's worker mode
dependencies, and therefore cannot simply rely on
node_modules =
"@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules"

PR Close #22168
This commit is contained in:
Alex Eagle 2018-02-12 08:34:57 -08:00 committed by Matias Niemelä
parent fa7d8907d0
commit 265ac8a106
4 changed files with 78 additions and 1593 deletions

View File

@ -76,7 +76,7 @@ jobs:
# Use bazel query so that we explicitly ask for all buildable targets to be built as well
# This avoids waiting for a build command to finish before running the first test
# See https://github.com/bazelbuild/bazel/issues/4257
- run: bazel query --output=label '//modules/... union //packages/... union //tools/...' | xargs bazel test
- run: bazel query --output=label //... | xargs bazel test
# CircleCI will allow us to go back and view/download these artifacts from past builds.
# Also we can use a service like https://buildsize.org/ to automatically track binary size of these artifacts.

View File

@ -28,6 +28,11 @@ local_repository(
path = "node_modules/rxjs/src",
)
local_repository(
name = "bazel_integration_test",
path = "integration/bazel",
)
git_repository(
name = "com_github_bazelbuild_buildtools",
remote = "https://github.com/bazelbuild/buildtools.git",

View File

@ -63,7 +63,6 @@
"cors": "2.8.4",
"domino": "1.0.29",
"entities": "1.1.1",
"firebase-tools": "3.12.0",
"firefox-profile": "1.0.3",
"fs-extra": "4.0.2",
"glob": "7.1.2",
@ -86,6 +85,7 @@
"madge": "0.5.0",
"minimist": "1.2.0",
"node-uuid": "1.4.8",
"protobufjs": "5.0.0",
"protractor": "5.1.2",
"rewire": "2.5.2",
"rollup": "0.47.4",

1662
yarn.lock

File diff suppressed because it is too large Load Diff