| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
rules to declare which Make variables they need.
The idea is that they would depend on the future java_runtime_alias / cc_toolchain_alias and similar rules and thus Bazel will know which Make variables they actually need instead of pulling in the whole BuildConfiguration and also making it possible to compute these Make variables during analysis instead of configuration creation.
RELNOTES: None.
PiperOrigin-RevId: 161785868
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a legacy dependency on the configuration transition table, which is
only needed for static configurations. Dynamic configurations didn't actually
use anything in that table: this was just a convenience interface that could
have equally been defined somewhere else. So this cl defines it somewhere else.
There's still one last dependency: Transitions.configurationHook. We'll tackle
that in a followup cl.
PiperOrigin-RevId: 161141650
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The name attribute gets special treatment in the codebase, in that
it's not simply yet another attribute but stored in it's own field.
Thus, every callside dealing with attributes needs to be aware of
this special case and explicitly handle the name attribute. It's
easy to see that this can lead to bugs. For example, querying for
the name attribute is currently broken due the querying code not
being aware of the special case [1].
Discussions with experienced bazel developers came to the conclusion
that there is no need (anymore) to treat the name attribute specially
and thus we decided it's best to remove the special treatment and
handle the name attribute as any other attribute.
This change removes the handling of name attributes and also adds a test
case to verify that bug [1] is fixed.
[1] https://github.com/bazelbuild/bazel/issues/278
--
PiperOrigin-RevId: 147446345
MOS_MIGRATED_REVID=147446345
|
|
|
|
|
|
|
|
| |
(series 4/4 of open-sourcing coverage command for java test)
--
PiperOrigin-RevId: 141292977
MOS_MIGRATED_REVID=141292977
|
|
|
|
|
|
|
|
|
| |
This makes is easier to understand and change which attributes are checked.
Also turn off checking for "data" and java_* "resources" attributes.
--
MOS_MIGRATED_REVID=140771015
|
|
|
|
|
|
|
| |
There doesn't seem to be any reason to keep them separate.
--
MOS_MIGRATED_REVID=136145734
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=135241715
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Blaze with this CL breaks ~all targets: "There is already a built-in attribute 'name' which cannot be overridden."
*** Original change description ***
Proper error messages when built-in rule attributes are overridden #1811
--
MOS_MIGRATED_REVID=134857179
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=134823021
|
|
|
|
|
|
|
|
| |
A valid argument has been made for opening it up, and it's
not clear it's helping anyone by locking it down.
--
MOS_MIGRATED_REVID=130686109
|
|
|
|
|
|
|
|
|
| |
Previously we used labels in each configuration fragment that then got added to every test action. Instead, we now have a filegroup under //tools/test for coverage files that truly need to be on the inputs of every test action and collect language-specific support files in InstrumentedFilesProvider.
This makes configuration creation simpler and makes it possible to turn --crosstool_top into something else other than a filegroup (previously, it was that filegroup that got added to every test action)
--
MOS_MIGRATED_REVID=126170241
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As of 18c277f, we have special logic for mixing
selects and constraints. With that logic, a multiplaform
libray declares all environments it supports across
all select paths, then each path supports some subset of
those environments.
With this approach, there's no need for
compatible_with = select(). So we'd like to disallow
that pattern (and all its downsides) in preference for
what 18c277f allows.
--
MOS_MIGRATED_REVID=121294433
|
|
|
|
|
|
|
| |
Its old name was confusing because resolve() and getDefault() do radically different things: getDefault() returns a good enough lie for when BuildConfiguration is not available, and resolve() resolves the dependency when we do have a BuildConfiguration.
--
MOS_MIGRATED_REVID=120212630
|
|
|
|
|
|
|
| |
fully implemented but still being guinea pigged.
--
MOS_MIGRATED_REVID=116694206
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/bazelbuild/bazel/blo[]fbbd6a32b95ba746f09dae1eaeaccf675cd5b3/src/main/java/com/google/devtools/build/lib/packages/Attribute.java#L1045
This allows the default value computation for latebound attributes to consider
the values of configurable attributes. This is most directly useful for user-definable Skylark defaults, which have full access to the values of all non-latebound attributes.
Without this change, this kind of scenario crashes Bazel. For example:
------------------
select_rules.bzl:
------------------
def _impl(ctx):
ctx.file_action(
output=ctx.outputs.out_file,
content=ctx.attr.string_value,
)
return struct()
# Bug does not manifest without using this as a default.
def _derived_value(attrs, _):
return Label("//some:dep")
selector_rule = rule(
implementation=_impl,
attrs={
"string_value": attr.string(default=""),
"out_file": attr.output(),
"_derived": attr.label(default=_derived_value),
},
output_to_genfiles=True,
)
def selector_macro(name, out_file="", string_value=""):
# This will fail with selectors.
selector_rule(
name="%s_skylark" % name,
string_value=string_value,
out_file=out_file + ".skylark",
)
# This does not.
native.genrule(
name="%s_genrule" % name,
cmd="echo '" + string_value + "' > $@",
outs=[out_file + ".genrule"],
)
native.filegroup(
name=name,
srcs=[":%s_genrule" % name, "%s_skylark" % name],
)
------------------
BUILD.bzl:
------------------
config_setting(
name = "selector",
values = {"compilation_mode": "opt"},
)
selector_macro(
name = "this_rule",
string_value = """soup? """ + select({
":selector": "no, thank you.",
"//conditions:default": "yes, please!!",
}),
out_file = "this_rule.txt",
)
--
MOS_MIGRATED_REVID=114326474
|
|
|
|
|
|
|
| |
they're part of the static structure of a rule.
--
MOS_MIGRATED_REVID=114141259
|
|
|
|
|
|
|
|
|
| |
prepends the tools repository path to the given string and parses the result as a label.
This is a cleaner way to access the tools repository label.
--
MOS_MIGRATED_REVID=114105929
|
|
|
|
|
|
|
|
|
| |
referenced via the rule class provider (using the RuleDefinitionEnvironment).
This is the second phase of the removal of the TOOLS_REPOSITORY constants.
--
MOS_MIGRATED_REVID=113734334
|
|
|
|
|
|
|
| |
A prerequisite is to pass RuleContext to ConfiguredAspect, so we can read from it the registered actions when we build() the aspect.
--
MOS_MIGRATED_REVID=107997593
|
|
|
|
|
|
|
| |
respective macro in the attribute "generator_location".
--
MOS_MIGRATED_REVID=104757928
|
|
|
|
|
|
|
|
|
| |
repository.
This is necessary because we copy labels from the command line into tools/defaults/BUILD and currently there is no syntax to make a label in a remote repository refer to one in the main repository.
--
MOS_MIGRATED_REVID=104755206
|
|
|
|
|
|
|
|
|
|
|
| |
tools repository.
This is a no-op refactoring CL. The actual switch will be made once everything passes with the new setup.
As a side cleanup, change the awkward realAndroidSdk() / realAndroidCrosstoolTop() mechanism to a converter.
--
MOS_MIGRATED_REVID=104649067
|
|
|
|
|
|
|
|
|
|
|
| |
The headers were modified with
`find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'`
And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan.
The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand.
--
MOS_MIGRATED_REVID=103938715
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to Attribute.skipPrereqValidatorCheck.
This is to disambiguate the concept of "constraints" and keep
the word consciously focused on Bazel's *new* constraint system.
The changed methods refer to checks done by PrerequisiteValidator,
which is basically an adhoc version of the "old" system (e.g.
checking visibility)
--
MOS_MIGRATED_REVID=103872412
|
|
|
|
|
|
|
|
|
|
| |
- Label parsing can be simplified
- lib.syntax is only contains the code for Skylark and is reasonably independent from the problem domain of building things
This change is mostly only changes to imports declarations. The rest is reversing the dependency between :cmdline and :syntax and moving a tiny amount of code between Printer and FilesetEntry and the addition of SkylarkPrintableValue that I couldn't be bothered to separate out into its own change.
--
MOS_MIGRATED_REVID=103527877
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=103374106
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=103090380
|
|
|
|
|
|
|
|
| |
It's an implementation artifact that we declare this as a late bound
dependency, and having checks here doesn't make a lot of sense.
--
MOS_MIGRATED_REVID=102976439
|
|
|
|
|
|
|
|
|
| |
generator_name and generator_function.
Additionally, both Skylark macros and build extensions set the attribute generator_location in order to store the name of the file where generator_function was defined.
--
MOS_MIGRATED_REVID=101458757
|
|
|
|
|
|
|
|
|
|
|
| |
Coverage depends on quite a few moving parts, several of which were changed for this test:
- BuildConfiguration.getCoverageLabels() used to include gcov support, this is now replaced by the dedicated getGcovLabels() and a separate implicit attribute on TestBaseRule. This new attribute is then overridden in ExperimentalIosTest to use an xcode-compatible gcov.
- Objc's TestSupport now correctly registers instrumented files and sets the necessary runfiles for collecting coverage.
- ios_test's template exports gcda files for coverage computation after the test's execution.
--
MOS_MIGRATED_REVID=99374435
|
|
|
|
|
|
|
| |
The enables the use of extra actions with Skylark rules.
--
MOS_MIGRATED_REVID=98115878
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
features.
Features on the rule level modify features that are enabled at the package
level. Note that this behavior is different from how the current command line /
package level interaction is, but we probably want to change the command line
behavior.
Alternative implementations considered:
a) using package-level features as default value for the rule attribute; this
would make it hard for future transitions; adding a completely new feature
to a package should not require updating all rules that have overrides
b) putting all positive features and all negative features from command-line,
package, and rule attribute into a positive and negative set, and subtract
the negative from the positive set; this is how the command-line features
worked previously, but it makes it impossible to enable a features that
is disabled at the package level just for one rule.
RELNOTES: Add 'features' attribute on the rule level.
--
MOS_MIGRATED_REVID=92448449
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reflection, and saves ~15% of initialization time in []RuleClassProvider.create().
Before change:
Over 14 samples,
average = 976
median = 969.9
After change:
Over 14 samples,
average = 811.5
median = 813.9
--
MOS_MIGRATED_REVID=89036261
|
|
|
|
|
|
|
|
| |
Anyone who needs this kind of functionality in the future can redefine
it through user-defined constraints.
--
MOS_MIGRATED_REVID=88871811
|
|
--
MOE_MIGRATED_REVID=85702957
|