Skip to content

Commit

Permalink
Update to rules_nodejs 0.16.6, rules_webtesting 0.3.0 and Bazel 0.22.0
Browse files Browse the repository at this point in the history
Closes bazel-contrib#394

PiperOrigin-RevId: 231647001
  • Loading branch information
gregmagolan authored and Keen Yee Liau committed Jan 30, 2019
1 parent 6189c9a commit a3707ef
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,13 @@

## IMPORTANT
# If you change the `docker_image` version, also change the `cache_key` suffix
var_1: &docker_image angular/ngcontainer:0.7.0
var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-0.7.0
var_1: &docker_image circleci/node:10.12-browsers
var_2: &cache_key rules_typescript-{{ checksum "yarn.lock" }}-internal/karma:{{ checksum "internal/karma/yarn.lock" }}-node:10.12-browsers
var_3: &setup-bazel-remote-cache
run:
name: Start up bazel remote cache proxy
command: ~/bazel-remote-proxy -backend circleci://
background: true
# Move node binaries out of the way to enforce that Bazel uses
# only the hermetic ones it downloads
var_4: &hide_node_and_yarn_local_binaries
run:
name: Move node, npm, and yarn binaries
command: |
sudo mv /usr/local/bin/node /usr/local/bin/node_
sudo mv /usr/local/bin/npm /usr/local/bin/npm_
sudo mv /usr/local/bin/yarn /usr/local/bin/yarn_

# Settings common to each job
anchor_1: &job_defaults
Expand All @@ -49,14 +40,14 @@ jobs:
- run: .circleci/setup_cache.sh
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
- *setup-bazel-remote-cache
- *hide_node_and_yarn_local_binaries

- restore_cache:
key: *cache_key
- run: bazel info release
- run: bazel build ...
- run: bazel test ...
- run: bazel build @disable_tsetse_for_external_test//...

- run: yarn install
- run: yarn bazel info release
- run: yarn bazel build ...
- run: yarn bazel test ...
- run: yarn bazel build @disable_tsetse_for_external_test//...

# This job tests the same stuff, but without the .bazelrc file.
# It disables worker mode, for example.
Expand All @@ -68,17 +59,17 @@ jobs:
- run: .circleci/setup_cache.sh
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
- *setup-bazel-remote-cache
- *hide_node_and_yarn_local_binaries

- restore_cache:
key: *cache_key
- run: bazel --bazelrc=/dev/null info release

- run: yarn install
- run: yarn bazel --bazelrc=/dev/null info release
# We cherry pick the memory utilization options from .circleci/bazel.rc here.
# Since the default CircleCI container has only 4G, limiting the memory
# is required to keep Bazel from exhausting the memory.
- run: bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0
- run: bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g test ... --local_resources=2560,1.0,1.0
- run: bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build @disable_tsetse_for_external_test//... --local_resources=2560,1.0,1.0
- run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build ... --local_resources=2560,1.0,1.0
- run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g test ... --local_resources=2560,1.0,1.0
- run: yarn bazel --bazelrc=/dev/null --host_jvm_args=-Xmx3g build @disable_tsetse_for_external_test//... --local_resources=2560,1.0,1.0

- save_cache:
key: *cache_key
Expand All @@ -95,17 +86,14 @@ jobs:
- run: .circleci/setup_cache.sh
- run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc
- *setup-bazel-remote-cache
- *hide_node_and_yarn_local_binaries
- restore_cache:
key: *cache_key

- run: yarn install
# Build the npm packages which are used in the e2e tests
- run: bazel build //internal:npm_package
- run: bazel build //internal/karma:npm_package
# Run yarn as e2e tests depend on self managed node_modules
- run: bazel run @nodejs//:bin/yarn
# Don't occupy the bazel server, as this test wants to run Bazel itself
- run: bazel run @nodejs//:bin/yarn e2e --script_path=yarn_e2e.sh
- run: xvfb-run -a ./yarn_e2e.sh
- run: yarn bazel build //internal:npm_package
- run: yarn bazel build //internal/karma:npm_package
- run: xvfb-run -a yarn e2e

lint:
<<: *job_defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ go_test(
name = "go_default_test",
srcs = ["concatjs_test.go"],
embed = [":go_default_library"],
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@ go_test(
],
embed = [":go_default_library"],
)

Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ filegroup(
srcs = glob(["**/*"]),
visibility = ["//visibility:public"],
)

Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["runfiles.go"],
importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles",
visibility = ["//visibility:public"],
deps = [
"@io_bazel_rules_go//go/tools/bazel:go_default_library",
],
importpath = "github.com/bazelbuild/rules_typescript/devserver/runfiles",
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ local_repository(
)
load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dependencies")
rules_typescript_dependencies()
load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dependencies")
rules_nodejs_dependencies()
load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install")
node_repositories()
yarn_install(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ npm_package(
"package.json",
],
deps = [
":check_version_copy",
":bazel_karma",
":check_version_copy",
":license_copy",
],
)
Expand Down
19 changes: 9 additions & 10 deletions packages/concatjs/third_party/google3/rules_typescript/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ def rules_typescript_dependencies():
_maybe(
http_archive,
name = "build_bazel_rules_nodejs",
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.4.zip"],
strip_prefix = "rules_nodejs-0.16.4",
urls = ["https://github.com/bazelbuild/rules_nodejs/archive/0.16.6.zip"],
strip_prefix = "rules_nodejs-0.16.6",
)

# ts_web_test depends on the web testing rules to provision browsers.
_maybe(
http_archive,
name = "io_bazel_rules_webtesting",
urls = ["https://github.com/bazelbuild/rules_webtesting/archive/111d792b9a5b17f87b6e177e274dbbee46094791.zip"],
strip_prefix = "rules_webtesting-111d792b9a5b17f87b6e177e274dbbee46094791",
sha256 = "a13af63e928c34eff428d47d31bafeec4e38ee9b6940e70bf2c9cd47184c5c16",
urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.0/rules_webtesting.tar.gz"],
sha256 = "1c0900547bdbe33d22aa258637dc560ce6042230e41e9ea9dad5d7d2fca8bc42",
)

# ts_devserver depends on the Go rules.
Expand Down Expand Up @@ -81,11 +80,11 @@ def rules_typescript_dependencies():
sha256 = "9176a7df34dbed2cf5171eb56271868824560364e60644348219f852f593ae79",
)

###############################################
# Repeat the dependencies of rules_nodejs here!
# We can't load() from rules_nodejs yet, because we've only just fetched it.
# But we also don't want to make users load and call the rules_nodejs_dependencies
# function because we can do that for them, mostly hiding the transitive dependency.
# io_bazel_rules_webtesting depends on bazel_skylib. It is installed by
# web_test_repositories() but we depend on it here in case users don't call
# web_test_repositories(). This will get cleaned up by https://github.com/bazelbuild/rules_typescript/pull/374
# which introduces build_bazel_rules_karma with its own defs.bzl file
# that will allow this dep to be removed from rules_typescript_dependencies()
_maybe(
http_archive,
name = "bazel_skylib",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
"tsutils": "2.27.2"
},
"devDependencies": {
"@bazel/ibazel": "^0.2.0",
"@bazel/bazel": "~0.22.0",
"@bazel/buildifier": "^0.20.0",
"@bazel/ibazel": "^0.2.0",
"@bazel/typescript": "0.19.1",
"@types/jasmine": "^2.8.2",
"@types/long": "^4.0.0",
Expand Down
24 changes: 24 additions & 0 deletions packages/concatjs/third_party/google3/rules_typescript/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
# yarn lockfile v1


"@bazel/[email protected]":
version "0.22.0"
resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.22.0.tgz#a2bea5922dba9a32554a218ba4849a200115b248"
integrity sha512-LFxkyQgPATeB64z/1IvOWZhK+lc3JVHejbmdo96qB4lsoD8zselvOlgHvVXxlAjRxVZ9mlmXDvDRDyaXyyRdwA==

"@bazel/[email protected]":
version "0.22.0"
resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.22.0.tgz#12e5884f2a7b7f3b62afbef9f8da4de0976f3bc8"
integrity sha512-xDs8cb2bbGZ9uvzYZOzCVrMBywzRhLj0J/t+py+FYZj+VO5B3wVg9eUf6nWWR0oJ2mzvToI9h31t2tNdqwy2kQ==

"@bazel/[email protected]":
version "0.22.0"
resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.22.0.tgz#a8a65986639583a8cc7b018e001aedfdafe41b50"
integrity sha512-FbJaXVDoCLnpIFLnPHFkQdfriYPXfnfQNuf9EXMliERdRuoeBVbwEZfwcuArxZWNFus7bD8QiTj0XzKVWO+Wbw==

"@bazel/bazel@~0.22.0":
version "0.22.0"
resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.22.0.tgz#feb0f2d82f9d169cb47951d95d55e512eda72bc9"
integrity sha512-uaXZsfCXOASBXzmge56akRIhJnKYdShn1X3AdEBzq2NNCf2llkc1H25gKGm4BfuWDBXRbXDMmcXup+fw39h+WQ==
optionalDependencies:
"@bazel/bazel-darwin_x64" "0.22.0"
"@bazel/bazel-linux_x64" "0.22.0"
"@bazel/bazel-win32_x64" "0.22.0"

"@bazel/[email protected]":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@bazel/buildifier-darwin_x64/-/buildifier-darwin_x64-0.20.0.tgz#1aeceb5a1a57a62eef6415377dbe95091781a7d4"
Expand Down

0 comments on commit a3707ef

Please sign in to comment.