Skip to content

Commit 12443ea

Browse files
devversionAndrewKushnir
authored andcommitted
build: remove skydoc and rules_sass from repository (angular#42760)
Skydoc is no longer used as `@angular/bazel` is no longer a public API. The Sass rules were only used in a single place in the repo where Sass is not really needed and has just been added by accident most likely. We want to remove the Sass dependency in preparation for Rules NodeJS v4.x where the Sass rules currently still use an older version of `@bazel/worker` that is incompatible. PR Close angular#42760
1 parent 53b281a commit 12443ea

9 files changed

Lines changed: 15 additions & 98 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ version: 2.1
2424
# **NOTE 2 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
2525
# **NOTE 3 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
2626
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
27-
var_3: &cache_key v4-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
27+
var_3: &cache_key v4-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
2828
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
2929
# folder will contain all previously used versions and ultimately cause the cache restoring to
3030
# be slower due to its growing size.
3131
var_4: &cache_key_fallback v4-angular-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
3232

3333
# Windows needs its own cache key because binaries in node_modules are different.
34-
var_3_win: &cache_key_win v4-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
34+
var_3_win: &cache_key_win v4-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "aio/yarn.lock" }}
3535
var_4_win: &cache_key_win_fallback v4-angular-win-node-14-{{ checksum "month.txt" }}-{{ checksum ".bazelversion" }}
3636

3737
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the

WORKSPACE

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ yarn_install(
3434
yarn_lock = "//:yarn.lock",
3535
)
3636

37-
# Load angular dependencies
38-
load("//packages/bazel:package.bzl", "rules_angular_dev_dependencies")
39-
40-
rules_angular_dev_dependencies()
41-
4237
# Load protractor dependencies
4338
load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
4439

@@ -52,13 +47,3 @@ web_test_repositories()
5247
load("//dev-infra/bazel/browsers:browser_repositories.bzl", "browser_repositories")
5348

5449
browser_repositories()
55-
56-
# Setup the rules_sass toolchain
57-
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
58-
59-
sass_repositories()
60-
61-
# Setup the skydoc toolchain
62-
load("@io_bazel_skydoc//skylark:skylark.bzl", "skydoc_repositories")
63-
64-
skydoc_repositories()

integration/bazel/src/hello-world/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package(default_visibility = ["//visibility:public"])
2-
31
load("@npm//@bazel/concatjs:index.bzl", "karma_web_test_suite")
42
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
53
load("@npm//@angular/bazel:index.bzl", "ng_package")
64
load("//tools:ng_ts_library.bzl", "ng_ts_library")
75

6+
package(default_visibility = ["//visibility:public"])
7+
88
sass_binary(
99
name = "hello-world-styles",
1010
src = "hello-world.component.scss",

modules/benchmarks/src/class_bindings/BUILD.bazel

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
package(default_visibility = ["//modules/benchmarks:__subpackages__"])
2-
3-
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
41
load("//dev-infra/benchmark/component_benchmark:component_benchmark.bzl", "component_benchmark")
52

6-
sass_binary(
7-
name = "class_bindings_styles",
8-
src = ":styles.scss",
9-
)
3+
package(default_visibility = ["//modules/benchmarks:__subpackages__"])
104

115
component_benchmark(
126
name = "benchmark",
@@ -28,5 +22,5 @@ component_benchmark(
2822
exclude = ["**/*.perf-spec.ts"],
2923
),
3024
prefix = "",
31-
styles = [":class_bindings_styles"],
25+
styles = ["styles.css"],
3226
)
File renamed without changes.

packages/bazel/package.bzl

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/bazel/src/BUILD.bazel

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
2+
13
# BEGIN-DEV-ONLY
24
package(default_visibility = ["//packages/bazel:__subpackages__"])
35

@@ -6,11 +8,6 @@ filegroup(
68
srcs = glob(["*"]),
79
)
810

9-
# For generating skydoc
10-
exports_files(glob(["*.bzl"]))
11-
12-
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
13-
1411
nodejs_binary(
1512
name = "modify_tsconfig",
1613
data = [

packages/bazel/src/ng_module.bzl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -693,19 +693,11 @@ def _ng_module_impl(ctx):
693693

694694
return ts_providers_dict_to_struct(ts_providers)
695695

696-
local_deps_aspects = [node_modules_aspect, _collect_summaries_aspect]
697-
698-
# Workaround skydoc bug which assumes DEPS_ASPECTS is a str type
699-
[local_deps_aspects.append(a) for a in DEPS_ASPECTS]
700-
701696
NG_MODULE_ATTRIBUTES = {
702697
"srcs": attr.label_list(allow_files = [".ts"]),
703-
704-
# Note: DEPS_ASPECTS is already a list, we add the cast to workaround
705-
# https://github.com/bazelbuild/skydoc/issues/21
706698
"deps": attr.label_list(
707699
doc = "Targets that are imported by this target",
708-
aspects = local_deps_aspects,
700+
aspects = [node_modules_aspect, _collect_summaries_aspect] + DEPS_ASPECTS,
709701
),
710702
"assets": attr.label_list(
711703
doc = ".html and .css files needed by the Angular compiler",

packages/bazel/src/ng_package/ng_package.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ WELL_KNOWN_GLOBALS = {p: _global_name(p) for p in [
125125
"rxjs/operators",
126126
]}
127127

128-
# skydoc fails with type(depset()) so using "depset" here instead
129-
# TODO(gregmagolan): clean this up
130-
_DEPSET_TYPE = "depset"
131-
132128
def _compute_node_modules_root(ctx):
133129
"""Computes the node_modules root from the node_modules and deps attributes.
134130
@@ -282,7 +278,11 @@ def _flatten_paths(directory):
282278
# Optionally can filter out files that do not belong to a specified package path.
283279
def _filter_out_generated_files(files, extension, package_path = None):
284280
result = []
285-
files_list = files.to_list() if type(files) == _DEPSET_TYPE else files
281+
282+
# If `files` is a depset, convert it to a list. Note that we do not compare the type
283+
# of files against a literal as per best practices within Bazel Starlark.
284+
# https://docs.bazel.build/versions/main/skylark/lib/globals.html#type.
285+
files_list = files.to_list() if type(files) == type(depset()) else files
286286
for file in files_list:
287287
# If the "package_path" parameter has been specified, filter out files
288288
# that do not start with the specified package path.
@@ -298,7 +298,7 @@ def _filter_out_generated_files(files, extension, package_path = None):
298298
return depset(result)
299299

300300
def _filter_js_inputs(all_inputs):
301-
all_inputs_list = all_inputs.to_list() if type(all_inputs) == _DEPSET_TYPE else all_inputs
301+
all_inputs_list = all_inputs.to_list() if type(all_inputs) == type(depset()) else all_inputs
302302
return [
303303
f
304304
for f in all_inputs_list

0 commit comments

Comments
 (0)