Skip to content

Commit

Permalink
build: update ngcontainer to bazel 0.18.0 (angular#26465) (angular#26488
Browse files Browse the repository at this point in the history
)

* build: update ngcontainer to bazel 0.18.0

* build: update skylint to bazel 0.18

use .bazelignore file to ignore node_modules directory

PR Close angular#26488
  • Loading branch information
alexeagle authored and IgorMinar committed Oct 20, 2018
1 parent 6468711 commit 30d6233
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 29 deletions.
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 2 additions & 2 deletions tools/bazel.rc → .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ test --experimental_ui
################################
# Temporary Settings for Ivy #
################################
# to determine if the compiler used should be Ivy or ViewEngine one can use `--define=compile=local` on
# to determine if the compiler used should be Ivy or ViewEngine one can use `--define=compile=local` on
# any bazel target. This is a temporary flag until codebase is permanently switched to Ivy.
build --define=compile=legacy
build --define=compile=legacy
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
## IMPORTANT
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
var_1: &docker_image angular/ngcontainer:0.6.0
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.6.0
var_1: &docker_image angular/ngcontainer:0.7.0
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.7.0

# Define common ENV vars
var_3: &define_env_vars
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pubspec.lock
.settings/
*.swo
modules/.settings
.bazelrc
.vscode
modules/.vscode

Expand Down
3 changes: 1 addition & 2 deletions .pullapprove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ groups:
files:
include:
- "WORKSPACE"
- ".bazel*"
- "*.bazel"
- "*.bzl"
- "packages/bazel/*"
- "tools/bazel.rc"
- "/docs/BAZEL.md"
users:
- alexeagle #primary
Expand All @@ -108,7 +108,6 @@ groups:
- "*.lock"
- "tools/*"
exclude:
- "tools/bazel.rc"
- "tools/public_api_guard/*"
- "aio/*"
users:
Expand Down
21 changes: 6 additions & 15 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
workspace(name = "angular")

load(
"//packages/bazel:package.bzl",
"//packages/bazel:package.bzl",
"rules_angular_dependencies",
"rules_angular_dev_dependencies",
)
Expand All @@ -14,9 +14,11 @@ rules_angular_dev_dependencies()
#
# Point Bazel to WORKSPACEs that live in subdirectories
#
local_repository(
http_archive(
name = "rxjs",
path = "node_modules/rxjs/src",
url = "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz",
strip_prefix = "package/src",
sha256 = "72b0b4e517f43358f554c125e40e39f67688cd2738a8998b4a266981ed32f403",
)

# Point to the integration test workspace just so that Bazel doesn't descend into it
Expand All @@ -26,23 +28,12 @@ local_repository(
path = "integration/bazel",
)

# Prevent Bazel from trying to build rxjs under angular devkit
# TODO(alexeagle): remove after Bazel 0.18 upgrade
local_repository(
name = "rxjs_ignore_nested_1",
path = "node_modules/@angular-devkit/core/node_modules/rxjs/src",
)
local_repository(
name = "rxjs_ignore_nested_2",
path = "node_modules/@angular-devkit/schematics/node_modules/rxjs/src",
)

#
# Load and install our dependencies downloaded above.
#
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")

check_bazel_version("0.17.0", """
check_bazel_version("0.18.0", """
If you are on a Mac and using Homebrew, there is a breaking change to the installation in Bazel 0.16
See https://blog.bazel.build/2018/08/22/bazel-homebrew.html
Expand Down
4 changes: 2 additions & 2 deletions docs/BAZEL.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ keeps the outputs up-to-date as you save sources.

If you're experiencing problems with seemingly unrelated tests failing, it may be because you're not using the proper flags with your Bazel test runs in Angular.

See also: [`//tools/bazel.rc`](https://github.com/angular/angular/blob/master/tools/bazel.rc) where `--define=ivy=false` is defined as default.
See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc) where `--define=ivy=false` is defined as default.

- `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below)
- `--test_arg=--node_options=--inspect=9228`: change the inspector port.
Expand Down Expand Up @@ -165,7 +165,7 @@ You can see an overview at https://www.kchodorow.com/blog/2017/03/27/stamping-yo
In our repo, here is how it's configured:

1) In `tools/bazel_stamp_vars.sh` we run the `git` commands to generate our versioning info.
1) In `tools/bazel.rc` we register this script as the value for the `workspace_status_command` flag. Bazel will run the script when it needs to stamp a binary.
1) In `.bazelrc` we register this script as the value for the `workspace_status_command` flag. Bazel will run the script when it needs to stamp a binary.

Note that Bazel has a `--stamp` argument to `bazel build`, but this has no effect since our stamping takes place in Skylark rules. See https://github.com/bazelbuild/bazel/issues/1054

Expand Down
6 changes: 3 additions & 3 deletions packages/bazel/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def rules_angular_dev_dependencies():
# Fetching the Bazel source code allows us to compile the Skylark linter
http_archive(
name = "io_bazel",
sha256 = "ace8cced3b21e64a8fdad68508e9b0644201ec848ad583651719841d567fc66d",
strip_prefix = "bazel-0.17.1",
url = "https://github.com/bazelbuild/bazel/archive/0.17.1.zip",
sha256 = "978f7e0440dd82182563877e2e0b7c013b26b3368888b57837e9a0ae206fd396",
strip_prefix = "bazel-0.18.0",
url = "https://github.com/bazelbuild/bazel/archive/0.18.0.zip",
)

# This commit matches the version of buildifier in angular/ngcontainer
Expand Down
2 changes: 1 addition & 1 deletion tools/ngcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ USER root
# Bazel install
# See https://bazel.build/versions/master/docs/install-ubuntu.html#using-bazel-custom-apt-repository-recommended
# Note, only the latest release is available, see https://github.com/bazelbuild/bazel/issues/4947
RUN BAZEL_VERSION="0.17.1" \
RUN BAZEL_VERSION="0.18.0" \
&& wget -q -O - https://bazel.build/bazel-release.pub.gpg | apt-key add - \
&& echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list \
&& apt-get update \
Expand Down
2 changes: 1 addition & 1 deletion tools/ngcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This docker container provides everything needed to build and test Angular appli
- npm 6.2.0
- yarn 1.9.2
- Java 8 (for Closure Compiler and Bazel)
- Bazel build tool v0.17.1 - http://bazel.build
- Bazel build tool v0.18.0 - http://bazel.build
- Google Chrome 69.0.3497.81
- Mozilla Firefox 47.0.1
- xvfb (virtual framebuffer) for headless testing
Expand Down

0 comments on commit 30d6233

Please sign in to comment.