1
- workspace (name = "angular_cli" )
1
+ workspace (
2
+ name = "angular_cli" ,
3
+ managed_directories = {"@npm" : ["node_modules" ]},
4
+ )
2
5
3
- load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "git_repository" )
4
6
load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
7
+ load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "git_repository" )
5
8
6
9
http_archive (
7
10
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
+ # patch_args = ["-p1"],
12
+ # Patch https://github.com/bazelbuild/rules_nodejs/pull/903
13
+ # patches = ["//tools:rollup_bundle_commonjs_ignoreGlobal.patch"],
14
+ sha256 = "6625259f9f77ef90d795d20df1d0385d9b3ce63b6619325f702b6358abb4ab33" ,
15
+ urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.35.0/rules_nodejs-0.35.0.tar.gz" ],
10
16
)
11
17
12
18
# We use protocol buffers for the Build Event Protocol
13
19
git_repository (
14
20
name = "com_google_protobuf" ,
15
21
commit = "beaeaeda34e97a6ff9735b33a66e011102ab506b" ,
16
22
remote = "https://github.com/protocolbuffers/protobuf" ,
23
+ shallow_since = "1559159889 -0400" ,
17
24
)
18
25
19
26
load ("@com_google_protobuf//:protobuf_deps.bzl" , "protobuf_deps" )
20
27
21
28
protobuf_deps ()
22
29
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" )
30
+ # Check the bazel version and download npm dependencies
31
+ load ("@build_bazel_rules_nodejs//:defs.bzl" , "check_bazel_version" , "check_rules_nodejs_version" , "node_repositories" , "yarn_install" )
32
+
33
+ # Bazel version must be at least the following version because:
34
+ # - 0.26.0 managed_directories feature added which is required for nodejs rules 0.30.0
35
+ # - 0.27.0 has a fix for managed_directories after `rm -rf node_modules`
36
+ check_bazel_version (
37
+ message = """
38
+ You no longer need to install Bazel on your machine.
39
+ Angular has a dependency on the @bazel/bazel package which supplies it.
40
+ Try running `yarn bazel` instead.
41
+ (If you did run that, check that you've got a fresh `yarn install`)
42
+ """ ,
43
+ minimum_bazel_version = "0.27.0" ,
44
+ )
27
45
46
+ # The NodeJS rules version must be at least the following version because:
47
+ # - 0.15.2 Re-introduced the prod_only attribute on yarn_install
48
+ # - 0.15.3 Includes a fix for the `jasmine_node_test` rule ignoring target tags
49
+ # - 0.16.8 Supports npm installed bazel workspaces
50
+ # - 0.26.0 Fix for data files in yarn_install and npm_install
51
+ # - 0.27.12 Adds NodeModuleSources provider for transtive npm deps support
52
+ # - 0.30.0 yarn_install now uses symlinked node_modules with new managed directories Bazel 0.26.0 feature
53
+ # - 0.31.1 entry_point attribute of nodejs_binary & rollup_bundle is now a label
54
+ # - 0.32.0 yarn_install and npm_install no longer puts build files under symlinked node_modules
55
+ # - 0.32.1 remove override of @bazel/tsetse & exclude typescript lib declarations in node_module_library transitive_declarations
56
+ # - 0.32.2 resolves bug in @bazel/hide-bazel-files postinstall step
57
+ # - 0.34.0 introduces protractor rule
58
+ check_rules_nodejs_version (minimum_version_string = "0.34.0" )
59
+
60
+ # Setup the Node.js toolchain
28
61
node_repositories (
29
62
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
- ),
63
+ "10.16.0-darwin_amd64" : ("node-v10.16.0-darwin-x64.tar.gz" , "node-v10.16.0-darwin-x64" , "6c009df1b724026d84ae9a838c5b382662e30f6c5563a0995532f2bece39fa9c" ),
64
+ "10.16.0-linux_amd64" : ("node-v10.16.0-linux-x64.tar.xz" , "node-v10.16.0-linux-x64" , "1827f5b99084740234de0c506f4dd2202a696ed60f76059696747c34339b9d48" ),
65
+ "10.16.0-windows_amd64" : ("node-v10.16.0-win-x64.zip" , "node-v10.16.0-win-x64" , "aa22cb357f0fb54ccbc06b19b60e37eefea5d7dd9940912675d3ed988bf9a059" ),
53
66
},
54
- yarn_version = "1.9.2" ,
67
+ node_version = "10.16.0" ,
68
+ package_json = ["//:package.json" ],
69
+ # yarn 1.13.0 under Bazel has a regression on Windows that causes build errors on rebuilds:
70
+ # ```
71
+ # ERROR: Source forest creation failed: C:/.../fyuc5c3n/execroot/angular/external (Directory not empty)
72
+ # ```
73
+ # See https://github.com/angular/angular/pull/29431 for more information.
74
+ # It possible that versions of yarn past 1.13.0 do not have this issue, however, before
75
+ # advancing this version we need to test manually on Windows that the above error does not
76
+ # happen as the issue is not caught by CI.
77
+ yarn_version = "1.12.1" ,
55
78
)
56
79
57
80
yarn_install (
@@ -60,6 +83,7 @@ yarn_install(
60
83
"//:tools/yarn/check-yarn.js" ,
61
84
],
62
85
package_json = "//:package.json" ,
86
+ symlink_node_modules = False ,
63
87
yarn_lock = "//:yarn.lock" ,
64
88
)
65
89
@@ -87,27 +111,30 @@ web_test_repositories()
87
111
# Bring in bazel_toolchains for RBE setup configuration.
88
112
http_archive (
89
113
name = "bazel_toolchains" ,
90
- sha256 = "54764b510cf45754c01ac65c9ba83e5f8fc8a033b8296ef74c4e4d6d1dbfaf21 " ,
91
- strip_prefix = "bazel-toolchains-d67435097bd65153a592ecdcc83094474914c205 " ,
92
- urls = [ "https://github.com/xingao267 /bazel-toolchains/archive/d67435097bd65153a592ecdcc83094474914c205. tar.gz" ] ,
114
+ sha256 = "dcb58e7e5f0b4da54c6c5f8ebc65e63fcfb37414466010cf82ceff912162296e " ,
115
+ strip_prefix = "bazel-toolchains-0.28.2 " ,
116
+ url = "https://github.com/bazelbuild /bazel-toolchains/archive/0.28.2. tar.gz" ,
93
117
)
94
118
95
119
load ("@bazel_toolchains//rules:environments.bzl" , "clang_env" )
96
120
load ("@bazel_toolchains//rules:rbe_repo.bzl" , "rbe_autoconfig" )
97
121
98
122
rbe_autoconfig (
99
123
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" ,
124
+ # Need to specify a base container digest in order to ensure that we can use the checked-in
125
+ # platform configurations for the "ubuntu16_04" image. Otherwise the autoconfig rule would
126
+ # need to pull the image and run it in order determine the toolchain configuration. See:
127
+ # https://github.com/bazelbuild/bazel-toolchains/blob/0.27.0/configs/ubuntu16_04_clang/versions.bzl
128
+ base_container_digest = "sha256:94d7d8552902d228c32c8c148cc13f0effc2b4837757a6e95b73fdc5c5e4b07b" ,
103
129
# Note that if you change the `digest`, you might also need to update the
104
130
# `base_container_digest` to make sure marketplace.gcr.io/google/rbe-ubuntu16-04-webtest:<digest>
105
131
# 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" ,
132
+ # the same Clang and JDK installed. Clang is needed because of the dependency on
133
+ # @com_google_protobuf. Java is needed for the Bazel's test executor Java tool.
134
+ digest = "sha256:76e2e4a894f9ffbea0a0cb2fbde741b5d223d40f265dbb9bca78655430173990" ,
110
135
env = clang_env (),
111
136
registry = "marketplace.gcr.io" ,
137
+ # We can't use the default "ubuntu16_04" RBE image provided by the autoconfig because we need
138
+ # a specific Linux kernel that comes with "libx11" in order to run headless browser tests.
112
139
repository = "google/rbe-ubuntu16-04-webtest" ,
113
140
)
0 commit comments