1- workspace (name = "angular_cli" )
1+ workspace (
2+ name = "angular_cli" ,
3+ managed_directories = {"@npm" : ["node_modules" ]},
4+ )
25
3- load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "git_repository" )
46load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
7+ load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "git_repository" )
58
69http_archive (
710 name = "build_bazel_rules_nodejs" ,
8- sha256 = "fb87ed5965cef93188af9a7287511639403f4b0da418961ce6defb9dcf658f51 " ,
9- urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.7 /rules_nodejs-0.27.7 .tar.gz" ],
11+ sha256 = "6625259f9f77ef90d795d20df1d0385d9b3ce63b6619325f702b6358abb4ab33 " ,
12+ urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.35.0 /rules_nodejs-0.35.0 .tar.gz" ],
1013)
1114
1215# We use protocol buffers for the Build Event Protocol
1316git_repository (
1417 name = "com_google_protobuf" ,
1518 commit = "beaeaeda34e97a6ff9735b33a66e011102ab506b" ,
1619 remote = "https://github.com/protocolbuffers/protobuf" ,
20+ shallow_since = "1559159889 -0400" ,
1721)
1822
1923load ("@com_google_protobuf//:protobuf_deps.bzl" , "protobuf_deps" )
2024
2125protobuf_deps ()
2226
23- load ("@build_bazel_rules_nodejs//:defs.bzl" , "check_bazel_version" , "node_repositories" , "yarn_install" )
24-
25- # 0.18.0 is needed for .bazelignore
26- check_bazel_version (minimum_bazel_version = "0.18.0" )
27+ # Check the bazel version and download npm dependencies
28+ load ("@build_bazel_rules_nodejs//:defs.bzl" , "check_bazel_version" , "check_rules_nodejs_version" , "node_repositories" , "yarn_install" )
29+
30+ # Bazel version must be at least the following version because:
31+ # - 0.26.0 managed_directories feature added which is required for nodejs rules 0.30.0
32+ # - 0.27.0 has a fix for managed_directories after `rm -rf node_modules`
33+ check_bazel_version (
34+ message = """
35+ You no longer need to install Bazel on your machine.
36+ Angular has a dependency on the @bazel/bazel package which supplies it.
37+ Try running `yarn bazel` instead.
38+ (If you did run that, check that you've got a fresh `yarn install`)
39+ """ ,
40+ minimum_bazel_version = "0.27.0" ,
41+ )
2742
43+ # The NodeJS rules version must be at least the following version because:
44+ # - 0.15.2 Re-introduced the prod_only attribute on yarn_install
45+ # - 0.15.3 Includes a fix for the `jasmine_node_test` rule ignoring target tags
46+ # - 0.16.8 Supports npm installed bazel workspaces
47+ # - 0.26.0 Fix for data files in yarn_install and npm_install
48+ # - 0.27.12 Adds NodeModuleSources provider for transtive npm deps support
49+ # - 0.30.0 yarn_install now uses symlinked node_modules with new managed directories Bazel 0.26.0 feature
50+ # - 0.31.1 entry_point attribute of nodejs_binary & rollup_bundle is now a label
51+ # - 0.32.0 yarn_install and npm_install no longer puts build files under symlinked node_modules
52+ # - 0.32.1 remove override of @bazel/tsetse & exclude typescript lib declarations in node_module_library transitive_declarations
53+ # - 0.32.2 resolves bug in @bazel/hide-bazel-files postinstall step
54+ # - 0.34.0 introduces protractor rule
55+ check_rules_nodejs_version (minimum_version_string = "0.34.0" )
56+
57+ # Setup the Node.js toolchain
2858node_repositories (
2959 node_repositories = {
30- "10.9.0-darwin_amd64" : (
31- "node-v10.9.0-darwin-x64.tar.gz" ,
32- "node-v10.9.0-darwin-x64" ,
33- "3c4fe75dacfcc495a432a7ba2dec9045cff359af2a5d7d0429c84a424ef686fc" ,
34- ),
35- "10.9.0-linux_amd64" : (
36- "node-v10.9.0-linux-x64.tar.xz" ,
37- "node-v10.9.0-linux-x64" ,
38- "c5acb8b7055ee0b6ac653dc4e458c5db45348cecc564b388f4ed1def84a329ff" ,
39- ),
40- "10.9.0-windows_amd64" : (
41- "node-v10.9.0-win-x64.zip" ,
42- "node-v10.9.0-win-x64" ,
43- "6a75cdbb69d62ed242d6cbf0238a470bcbf628567ee339d4d098a5efcda2401e" ,
44- ),
45- },
46- node_version = "10.9.0" ,
47- yarn_repositories = {
48- "1.9.2" : (
49- "yarn-v1.9.2.tar.gz" ,
50- "yarn-v1.9.2" ,
51- "3ad69cc7f68159a562c676e21998eb21b44138cae7e8fe0749a7d620cf940204" ,
52- ),
60+ "10.16.0-darwin_amd64" : ("node-v10.16.0-darwin-x64.tar.gz" , "node-v10.16.0-darwin-x64" , "6c009df1b724026d84ae9a838c5b382662e30f6c5563a0995532f2bece39fa9c" ),
61+ "10.16.0-linux_amd64" : ("node-v10.16.0-linux-x64.tar.xz" , "node-v10.16.0-linux-x64" , "1827f5b99084740234de0c506f4dd2202a696ed60f76059696747c34339b9d48" ),
62+ "10.16.0-windows_amd64" : ("node-v10.16.0-win-x64.zip" , "node-v10.16.0-win-x64" , "aa22cb357f0fb54ccbc06b19b60e37eefea5d7dd9940912675d3ed988bf9a059" ),
5363 },
54- yarn_version = "1.9.2" ,
64+ node_version = "10.16.0" ,
65+ package_json = ["//:package.json" ],
66+ # yarn 1.13.0 under Bazel has a regression on Windows that causes build errors on rebuilds:
67+ # ```
68+ # ERROR: Source forest creation failed: C:/.../fyuc5c3n/execroot/angular/external (Directory not empty)
69+ # ```
70+ # See https://github.com/angular/angular/pull/29431 for more information.
71+ # It possible that versions of yarn past 1.13.0 do not have this issue, however, before
72+ # advancing this version we need to test manually on Windows that the above error does not
73+ # happen as the issue is not caught by CI.
74+ yarn_version = "1.12.1" ,
5575)
5676
5777yarn_install (
@@ -60,6 +80,7 @@ yarn_install(
6080 "//:tools/yarn/check-yarn.js" ,
6181 ],
6282 package_json = "//:package.json" ,
83+ symlink_node_modules = False ,
6384 yarn_lock = "//:yarn.lock" ,
6485)
6586
@@ -87,27 +108,30 @@ web_test_repositories()
87108# Bring in bazel_toolchains for RBE setup configuration.
88109http_archive (
89110 name = "bazel_toolchains" ,
90- sha256 = "54764b510cf45754c01ac65c9ba83e5f8fc8a033b8296ef74c4e4d6d1dbfaf21 " ,
91- strip_prefix = "bazel-toolchains-d67435097bd65153a592ecdcc83094474914c205 " ,
92- urls = [ "https://github.com/xingao267 /bazel-toolchains/archive/d67435097bd65153a592ecdcc83094474914c205. tar.gz" ] ,
111+ sha256 = "dcb58e7e5f0b4da54c6c5f8ebc65e63fcfb37414466010cf82ceff912162296e " ,
112+ strip_prefix = "bazel-toolchains-0.28.2 " ,
113+ url = "https://github.com/bazelbuild /bazel-toolchains/archive/0.28.2. tar.gz" ,
93114)
94115
95116load ("@bazel_toolchains//rules:environments.bzl" , "clang_env" )
96117load ("@bazel_toolchains//rules:rbe_repo.bzl" , "rbe_autoconfig" )
97118
98119rbe_autoconfig (
99120 name = "rbe_ubuntu1604_angular" ,
100- # The sha256 of marketplace.gcr.io/google/rbe-ubuntu16-04 container that is
101- # used by rbe_autoconfig() to pair toolchain configs in the @bazel_toolchains repo.
102- base_container_digest = "sha256:677c1317f14c6fd5eba2fd8ec645bfdc5119f64b3e5e944e13c89e0525cc8ad1" ,
121+ # Need to specify a base container digest in order to ensure that we can use the checked-in
122+ # platform configurations for the "ubuntu16_04" image. Otherwise the autoconfig rule would
123+ # need to pull the image and run it in order determine the toolchain configuration. See:
124+ # https://github.com/bazelbuild/bazel-toolchains/blob/0.27.0/configs/ubuntu16_04_clang/versions.bzl
125+ base_container_digest = "sha256:94d7d8552902d228c32c8c148cc13f0effc2b4837757a6e95b73fdc5c5e4b07b" ,
103126 # Note that if you change the `digest`, you might also need to update the
104127 # `base_container_digest` to make sure marketplace.gcr.io/google/rbe-ubuntu16-04-webtest:<digest>
105128 # and marketplace.gcr.io/google/rbe-ubuntu16-04:<base_container_digest> have
106- # the same Clang and JDK installed.
107- # Clang is needed because of the dependency on @com_google_protobuf.
108- # Java is needed for the Bazel's test executor Java tool.
109- digest = "sha256:74a8e9dca4781d5f277a7bd8e7ea7ed0f5906c79c9cd996205b6d32f090c62f3" ,
129+ # the same Clang and JDK installed. Clang is needed because of the dependency on
130+ # @com_google_protobuf. Java is needed for the Bazel's test executor Java tool.
131+ digest = "sha256:76e2e4a894f9ffbea0a0cb2fbde741b5d223d40f265dbb9bca78655430173990" ,
110132 env = clang_env (),
111133 registry = "marketplace.gcr.io" ,
134+ # We can't use the default "ubuntu16_04" RBE image provided by the autoconfig because we need
135+ # a specific Linux kernel that comes with "libx11" in order to run headless browser tests.
112136 repository = "google/rbe-ubuntu16-04-webtest" ,
113137)
0 commit comments