Refactor the files and runfiles fields from strings to the DefaultInfo() provider.
This is the beginning of removing the legacy providers, per https://github.com/bazelbuild/bazel/issues/7347
See https://docs.bazel.build/versions/master/skylark/rules.html#migrating-from-legacy-providers:
"
The fields files, runfiles, data_runfiles, default_runfiles, and executable correspond to the same-named fields of DefaultInfo. It is not allowed to specify any of these fields while also returning a DefaultInfo modern provider.
"
PiperOrigin-RevId: 264941716
diff --git a/internal/common/compilation.bzl b/internal/common/compilation.bzl
index 7e08587..6af26b5 100644
--- a/internal/common/compilation.bzl
+++ b/internal/common/compilation.bzl
@@ -468,7 +468,18 @@
transitive_es6_sources = depset(transitive = [transitive_es6_sources, es6_sources])
return {
- "files": depset(transitive = files_depsets),
+ "providers": [
+ DefaultInfo(
+ runfiles = ctx.runfiles(
+ # Note: don't include files=... here, or they will *always* be built
+ # by any dependent rule, regardless of whether it needs them.
+ # But these attributes are needed to pass along any input runfiles:
+ collect_default = True,
+ collect_data = True,
+ ),
+ files = depset(transitive = files_depsets),
+ ),
+ ],
"instrumented_files": {
"dependency_attributes": ["deps", "runtime_deps"],
"extensions": ["ts"],
@@ -482,13 +493,6 @@
"es5_sources": es5_sources,
"es6_sources": es6_sources,
},
- "runfiles": ctx.runfiles(
- # Note: don't include files=... here, or they will *always* be built
- # by any dependent rule, regardless of whether it needs them.
- # But these attributes are needed to pass along any input runfiles:
- collect_default = True,
- collect_data = True,
- ),
# Expose the tags so that a Skylark aspect can access them.
"tags": ctx.attr.tags if hasattr(ctx.attr, "tags") else ctx.rule.attr.tags,
# TODO(martinprobst): Prune transitive deps, only re-export what's needed.