diff --git a/WORKSPACE b/WORKSPACE index e45a8e2efa3a..cb0b0cf370bf 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -5,8 +5,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Add NodeJS rules http_archive( name = "build_bazel_rules_nodejs", - sha256 = "ad4be2c6f40f5af70c7edf294955f9d9a0222c8e2756109731b25f79ea2ccea0", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.38.3/rules_nodejs-0.38.3.tar.gz"], + sha256 = "3d7296d834208792fa3b2ded8ec04e75068e3de172fae79db217615bd75a6ff7", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.39.1/rules_nodejs-0.39.1.tar.gz"], ) # Add sass rules @@ -21,8 +21,8 @@ http_archive( load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install") -# The minimum bazel version to use with this repo is 0.27.0 -check_bazel_version("0.27.0") +# The minimum bazel version to use with this repo is 1.0.0 +check_bazel_version("1.0.0") node_repositories( node_repositories = { @@ -44,7 +44,6 @@ yarn_install( # are executed in the Bazel sandbox. data = [ "//:angular-tsconfig.json", - "//:tools/bazel/angular_bazel_0.38.2.patch", "//:tools/bazel/flat_module_factory_resolution.patch", "//:tools/bazel/manifest_externs_hermeticity.patch", "//:tools/bazel/postinstall-patches.js", @@ -100,9 +99,9 @@ sass_repositories() # Bring in bazel_toolchains for RBE setup configuration. http_archive( name = "bazel_toolchains", - sha256 = "ab0d8aaeaeeef413ddb03922dbdb99bbae9e1b2c157a87c77d70d45a830be5b0", - strip_prefix = "bazel-toolchains-0.29.1", - url = "https://github.com/bazelbuild/bazel-toolchains/archive/0.29.1.tar.gz", + sha256 = "0b36eef8a66f39c8dbae88e522d5bbbef49d5e66e834a982402c79962281be10", + strip_prefix = "bazel-toolchains-1.0.1", + url = "https://github.com/bazelbuild/bazel-toolchains/archive/1.0.1.tar.gz", ) load("@bazel_toolchains//repositories:repositories.bzl", bazel_toolchains_repositories = "repositories") diff --git a/package.json b/package.json index 16db4e3ebfe9..924d8bc6df5f 100644 --- a/package.json +++ b/package.json @@ -71,13 +71,13 @@ "@angular/platform-server": "^9.0.0-rc.0", "@angular/router": "^9.0.0-rc.0", "@angular/upgrade": "^9.0.0-rc.0", - "@bazel/bazel": "^0.29.0", + "@bazel/bazel": "1.0.0", "@bazel/buildifier": "^0.29.0", "@bazel/ibazel": "^0.10.3", - "@bazel/jasmine": "^0.38.3", - "@bazel/karma": "^0.38.3", - "@bazel/protractor": "^0.38.3", - "@bazel/typescript": "^0.38.3", + "@bazel/jasmine": "^0.39.1", + "@bazel/karma": "^0.39.1", + "@bazel/protractor": "^0.39.1", + "@bazel/typescript": "^0.39.1", "@firebase/app-types": "^0.3.2", "@octokit/rest": "^16.28.7", "@schematics/angular": "^9.0.0-rc.0", diff --git a/tools/bazel/angular_bazel_0.38.2.patch b/tools/bazel/angular_bazel_0.38.2.patch deleted file mode 100644 index b7949bf860b4..000000000000 --- a/tools/bazel/angular_bazel_0.38.2.patch +++ /dev/null @@ -1,146 +0,0 @@ -diff --git node_modules/@angular/bazel/src/external.bzl node_modules/@angular/bazel/src/external.bzl -index 9cdb543..8b8d4d6 100755 ---- node_modules/@angular/bazel/src/external.bzl -+++ node_modules/@angular/bazel/src/external.bzl -@@ -14,9 +14,9 @@ load( - _ts_providers_dict_to_struct = "ts_providers_dict_to_struct", - ) - load( -- "@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", -- _NodeModuleSources = "NodeModuleSources", -- _collect_node_modules_aspect = "collect_node_modules_aspect", -+ "@build_bazel_rules_nodejs//internal/common:npm_package_info.bzl", -+ _NpmPackageInfo = "NpmPackageInfo", -+ _node_modules_aspect = "node_modules_aspect", - ) - load( - "@npm_bazel_typescript//internal:ts_config.bzl", -@@ -24,11 +24,12 @@ load( - ) - load( - "@build_bazel_rules_nodejs//:providers.bzl", -- _transitive_js_ecma_script_module_info = "transitive_js_ecma_script_module_info", -+ _js_ecma_script_module_info = "js_ecma_script_module_info", -+ _js_named_module_info = "js_named_module_info", - ) - --NodeModuleSources = _NodeModuleSources --collect_node_modules_aspect = _collect_node_modules_aspect -+NpmPackageInfo = _NpmPackageInfo -+node_modules_aspect = _node_modules_aspect - - tsc_wrapped_tsconfig = _tsc_wrapped_tsconfig - COMMON_ATTRIBUTES = _COMMON_ATTRIBUTES -@@ -42,4 +43,5 @@ DEFAULT_NG_COMPILER = "@npm//@angular/bazel/bin:ngc-wrapped" - DEFAULT_NG_XI18N = "@npm//@angular/bazel/bin:xi18n" - FLAT_DTS_FILE_SUFFIX = ".bundle.d.ts" - TsConfigInfo = _TsConfigInfo --transitive_js_ecma_script_module_info = _transitive_js_ecma_script_module_info -+js_ecma_script_module_info = _js_ecma_script_module_info -+js_named_module_info = _js_named_module_info -diff --git node_modules/@angular/bazel/src/ng_module.bzl node_modules/@angular/bazel/src/ng_module.bzl -index 2b31963..98479f7 100755 ---- node_modules/@angular/bazel/src/ng_module.bzl -+++ node_modules/@angular/bazel/src/ng_module.bzl -@@ -13,11 +13,12 @@ load( - "DEFAULT_NG_COMPILER", - "DEFAULT_NG_XI18N", - "DEPS_ASPECTS", -- "NodeModuleSources", -+ "NpmPackageInfo", - "TsConfigInfo", -- "collect_node_modules_aspect", -+ "node_modules_aspect", - "compile_ts", -- "transitive_js_ecma_script_module_info", -+ "js_ecma_script_module_info", -+ "js_named_module_info", - "ts_providers_dict_to_struct", - "tsc_wrapped_tsconfig", - ) -@@ -527,11 +528,11 @@ def _compile_action( - file_inputs += ctx.attr.tsconfig[TsConfigInfo].deps - - # Also include files from npm fine grained deps as action_inputs. -- # These deps are identified by the NodeModuleSources provider. -+ # These deps are identified by the NpmPackageInfo provider. - for d in ctx.attr.deps: -- if NodeModuleSources in d: -+ if NpmPackageInfo in d: - # Note: we can't avoid calling .to_list() on sources -- file_inputs.extend(_filter_ts_inputs(d[NodeModuleSources].sources.to_list())) -+ file_inputs.extend(_filter_ts_inputs(d[NpmPackageInfo].sources.to_list())) - - # Collect the inputs and summary files from our deps - action_inputs = depset( -@@ -617,7 +618,11 @@ def _ng_module_impl(ctx): - - # Add in new JS providers - ts_providers["providers"].extend([ -- transitive_js_ecma_script_module_info( -+ js_named_module_info( -+ sources = ts_providers["typescript"]["es5_sources"], -+ deps = ctx.attr.deps, -+ ), -+ js_ecma_script_module_info( - sources = ts_providers["typescript"]["es6_sources"], - deps = ctx.attr.deps, - ), -@@ -625,7 +630,7 @@ def _ng_module_impl(ctx): - - return ts_providers_dict_to_struct(ts_providers) - --local_deps_aspects = [collect_node_modules_aspect, _collect_summaries_aspect] -+local_deps_aspects = [node_modules_aspect, _collect_summaries_aspect] - - # Workaround skydoc bug which assumes DEPS_ASPECTS is a str type - [local_deps_aspects.append(a) for a in DEPS_ASPECTS] -diff --git node_modules/@angular/bazel/src/ng_package/ng_package.bzl node_modules/@angular/bazel/src/ng_package/ng_package.bzl -index 2eb79b1..bde9e0d 100755 ---- node_modules/@angular/bazel/src/ng_package/ng_package.bzl -+++ node_modules/@angular/bazel/src/ng_package/ng_package.bzl -@@ -14,8 +14,8 @@ specification of this format at https://goo.gl/jB3GVv - """ - - load("@build_bazel_rules_nodejs//internal/common:collect_es6_sources.bzl", "collect_es6_sources") --load("@build_bazel_rules_nodejs//internal/common:node_module_info.bzl", "NodeModuleSources") --load("@build_bazel_rules_nodejs//internal/common:sources_aspect.bzl", "sources_aspect") -+load("@build_bazel_rules_nodejs//:providers.bzl", "JSNamedModuleInfo") -+load("@build_bazel_rules_nodejs//internal/common:npm_package_info.bzl", "NpmPackageInfo") - load( - "@build_bazel_rules_nodejs//internal/rollup:rollup_bundle.bzl", - "ROLLUP_ATTRS", -@@ -347,9 +347,9 @@ def _ng_package_impl(ctx): - node_modules_files = _filter_js_inputs(ctx.files.node_modules) - - # Also include files from npm fine grained deps as inputs. -- # These deps are identified by the NodeModuleSources provider. -+ # These deps are identified by the NpmPackageInfo provider. - for d in ctx.attr.deps: -- if NodeModuleSources in d: -+ if NpmPackageInfo in d: - node_modules_files += _filter_js_inputs(d.files) - esm5_rollup_inputs = depset(node_modules_files, transitive = [esm5_sources]) - -@@ -455,9 +455,9 @@ def _ng_package_impl(ctx): - - devfiles = depset() - if ctx.attr.include_devmode_srcs: -- for d in ctx.attr.deps: -- if hasattr(d, "node_sources"): -- devfiles = depset(transitive = [devfiles, d.node_sources]) -+ for dep in ctx.attr.deps: -+ if JSNamedModuleInfo in dep: -+ devfiles = depset(transitive = [devfiles, dep[JSNamedModuleInfo].sources]) - - # Re-use the create_package function from the nodejs npm_package rule. - package_dir = create_package( -@@ -469,7 +469,7 @@ def _ng_package_impl(ctx): - files = depset([package_dir]), - )] - --DEPS_ASPECTS = [esm5_outputs_aspect, sources_aspect] -+DEPS_ASPECTS = [esm5_outputs_aspect] - - # Workaround skydoc bug which assumes ROLLUP_DEPS_ASPECTS is a str type - [DEPS_ASPECTS.append(a) for a in ROLLUP_DEPS_ASPECTS] diff --git a/yarn.lock b/yarn.lock index 0f843ce67d72..6265664b51a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -227,31 +227,31 @@ lodash "^4.17.11" to-fast-properties "^2.0.0" -"@bazel/bazel-darwin_x64@0.29.0": - version "0.29.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.29.0.tgz#d2ebcb95bc66031b0545dd8b0e597b3aa5b9024b" - integrity sha512-q6snNakVA3wzv3VIuFlsw3/xcB/ygsAMhkigsuZXv1yHmwnuBOI4UJ2r2+Ttc4HPHflS0aWuI/raHDq81vBYKw== +"@bazel/bazel-darwin_x64@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-1.0.0.tgz#8ab7ecba867130d87e3ecd6cfd5757e59ea274ab" + integrity sha512-2J8qPpUAhSsuZ1P0kMFLvAQUz8zB8mkKmGL3/8raXUnw9TblsykwAdeg3QlJwTLORn+ZqdAjOYEQIarnTpS1NA== -"@bazel/bazel-linux_x64@0.29.0": - version "0.29.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.29.0.tgz#95250ad8463425bec81a95736056f432c186cb9d" - integrity sha512-QxWdtlsFKMi3SJ++osjA8QQbWOlGZXU0/TtUTiswsRwWdOEwZhOa2c1ljIQY5QBgzc3CCh2clRnkjWQj0/V/Dw== +"@bazel/bazel-linux_x64@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-1.0.0.tgz#7043cc41eaf7b1d2618766e0759d513873bb9659" + integrity sha512-/ZpOrYyDNGqUyAGPHFr4Y1kn8xCG1G4Lg2VMZtfCZzDohzoYFYs8iyQGU2/8PwldH8XX+oJT9atWqSt1EyoeAw== -"@bazel/bazel-win32_x64@0.29.0": - version "0.29.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.29.0.tgz#62af30d4ccf0a31e656a6ac9337e928d29a4598d" - integrity sha512-r0DhNarJrzzcXrvRbey43hGVO4J2QBAS43VrgjrxVw+1kyjKkIOQIh3wKr/OKx2jKOX0y3hCrLpL/aivHqub4g== +"@bazel/bazel-win32_x64@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-1.0.0.tgz#1111e4910c155a1917162ae96fd3737d062d20dd" + integrity sha512-p5LpQ/WiijwOS+eBkdD7UewHL8JwK+8gpb4tIKqgh/a2yawgzEQPJDPBUV9ykss5t+s85BL2kEMhduuDewt/MA== -"@bazel/bazel@^0.29.0": - version "0.29.0" - resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.29.0.tgz#bf4ecf47d6e67e8df8d342d24c146bd732d78640" - integrity sha512-OBxPv+V73PtADVG4qsGJ7Zj0wJrJorRbHgYE8qsRBNKls6e6rf0jkjSIQvAvP1Dyt7x4MGyhIzzK/5IsPeQZIA== +"@bazel/bazel@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-1.0.0.tgz#7c6e306d8ced3a6e087f041861364ef742560342" + integrity sha512-bxNjlieM1HwgIgqx+AqtNeUA6bvqIQ0X5YysWuCCtT24Dd+wTs6fRSx1KGOA1NiRBrg+kpk7ebitOU8yaM+tiA== dependencies: "@bazel/hide-bazel-files" latest optionalDependencies: - "@bazel/bazel-darwin_x64" "0.29.0" - "@bazel/bazel-linux_x64" "0.29.0" - "@bazel/bazel-win32_x64" "0.29.0" + "@bazel/bazel-darwin_x64" "1.0.0" + "@bazel/bazel-linux_x64" "1.0.0" + "@bazel/bazel-win32_x64" "1.0.0" "@bazel/buildifier-darwin_x64@0.29.0": version "0.29.0" @@ -287,19 +287,19 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.10.3.tgz#2e2b8a1d3e885946eac41db2b1aa6801fb319887" integrity sha512-v1nXbMTHVlMM4z4uWp6XiRoHAyUlYggF1SOboLLWRp0+D22kWixqArWqnozLw2mOtnxr97BdLjluWiho6A8Hjg== -"@bazel/jasmine@^0.38.3": - version "0.38.3" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.38.3.tgz#f010f0555acd1d363eca9fc90865704fcf510d3f" - integrity sha512-wTD+EoNUvOfLNmicLa7g/09gFHEpJE3A6xhz/UMF2KowCg+yBfzKGa2bSuqIMhwoDH0EpIOWZg2lmiBqz/w9/Q== +"@bazel/jasmine@^0.39.1": + version "0.39.1" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.39.1.tgz#fd78c8dbe2d927ca358df506e181a07d5c0cbb9d" + integrity sha512-l+IerE7rKuHYShkWk7L71x65X1mlrNFrAPk/EGlyRpuY+lDDP6P8ElHBV4e+32s0Yt5Ewi46BvGMYkOWHdbzgA== dependencies: jasmine "~3.4.0" jasmine-core "~3.4.0" v8-coverage "1.0.9" -"@bazel/karma@^0.38.3": - version "0.38.3" - resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.38.3.tgz#4db94a2227d7e8863505dfcfe9de81a2cb1f7d0b" - integrity sha512-5ywjZsigJpdG4wr1iy2UNkfEgQcBvRjHoVfUQqLF1Dp0uBdqG7Qq2quu0Zypd/UodbvTye1pHWQ+Lq7cEz6JWg== +"@bazel/karma@^0.39.1": + version "0.39.1" + resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.39.1.tgz#23898875444a5ef1fd9ac0dbaebcdd05b90d51f8" + integrity sha512-P4LNCeopKGmhwRJrA6qtMLAvMgIalq5I9XYlaPOLjkoYKcjwAReBKyWY9VYhDEYld2P/P1YJmx/+nQDZAowocA== dependencies: jasmine-core "2.8.0" karma "~4.1.0" @@ -313,17 +313,17 @@ semver "5.6.0" tmp "0.0.33" -"@bazel/protractor@^0.38.3": - version "0.38.3" - resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-0.38.3.tgz#e9599271e87527378e56d97de960919f72256746" - integrity sha512-vs5Zi9Gw3FZ0OnmdJxDzOZJaA2Aeqq3GcAvK8jlQ6fzVc9w8TP6BmAhraOHJYFPj5rMz2fQF/e3Ovrtn4KA3Zw== +"@bazel/protractor@^0.39.1": + version "0.39.1" + resolved "https://registry.yarnpkg.com/@bazel/protractor/-/protractor-0.39.1.tgz#24988e12eaa3efbcdbb7e80dba20105e379e4016" + integrity sha512-zVbCrK8Uyfd2D93laHYp+YLvoR2Pfov/i13b6MTDkgDkzWd0NoPIlPqLAXuKhOUi5rYUcbp+DoY9A+HA2Rfy1g== dependencies: protractor "^5.4.2" -"@bazel/typescript@^0.38.3": - version "0.38.3" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.38.3.tgz#0e452413ca81fc9429404ceabf60ebfb4f13474a" - integrity sha512-sFPYNDEE5h/k+Arop3q8XWaqoTwSy0IUS0a/YSeLhR/yz7pNmOltjPyeseLmo004BhgH7X4X+LjUQjcgv7lpXw== +"@bazel/typescript@^0.39.1": + version "0.39.1" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.39.1.tgz#fbe3f9e287aa294935987bbbd9f2dce5341a9b02" + integrity sha512-n4P6VKir1L3+rM/DgHa5mnlCfT7Wo0ra+TnkbTuZ08SeN/r8HTmClK6YADoDc5ORMQhzq8eXuVuLWeUUsFJyHQ== dependencies: protobufjs "6.8.8" semver "5.6.0"