| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 184649483
|
|
|
|
|
|
|
|
| |
Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own.
This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually.
PiperOrigin-RevId: 175033526
|
|
|
|
|
|
|
| |
No need to contruct a list for each function call
RELNOTES: None
PiperOrigin-RevId: 173144689
|
|
|
|
|
|
|
| |
Follow-up of unknown commit.
RELNOTES: None
PiperOrigin-RevId: 172922507
|
|
|
|
|
|
|
|
|
| |
All callers that do not use Environment.Builder#setSemantics should call #useDefaultSemantics. A follow-up CL will enforce this requirement.
Motivation: It's more important that we are strict about semantics than about the other builder args. It's too easy for a mistake in semantics to go unnoticed.
RELNOTES: None
PiperOrigin-RevId: 172912829
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 172801656
|
|
|
|
|
|
|
| |
Also remove the use of the @UsesOnlyCoreTypes annotation on SkylarkSemanticsOptions. It was only there to help mark that the options class was safe to put in Skyframe.
RELNOTES: None
PiperOrigin-RevId: 171248504
|
|
|
|
|
|
|
| |
Mainly this just means using getters instead of fields to access option values.
RELNOTES: None
PiperOrigin-RevId: 171101597
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 170343759
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 166857589
|
|
|
|
|
|
|
|
|
| |
Also throw IllegalArgumentException instead of AssertionError.
A follow-up CL will look to eliminate the SkylarkMutable#checkMutable(Location, Environment) override in favor of checkMutable(Location, Mutability). This will make it easier to manipulate Skylark values in specialized contexts aside from normal evaluation.
RELNOTES: None
PiperOrigin-RevId: 163978262
|
|
|
|
|
|
|
| |
Add value-class methods to SkylarkFileDependency and SkylarkImportLookupValue. Remove Java serialization hack from Extension.
RELNOTES: None
PiperOrigin-RevId: 162383283
|
|
|
|
|
|
|
| |
Also refactor FAIL_FAST_HANDLER to throw something more specific than IllegalArgumentException. This bug was masked because the test assertion that would've caught it considered IllegalArgumentException to be an expected error, the same as EvalException.
RELNOTES: None
PiperOrigin-RevId: 161809957
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 161560683
|
|
|
|
|
|
|
| |
It's now easier to customize Printer if in different situations objects should
be printed differently. Also its API is cleaner now. Names of methods of SkylarkValue objects now reflect names of Skylark functions: SkylarkValue#repr and SkylarkPrintableValue#str.
PiperOrigin-RevId: 160635154
|
|
|
|
|
|
|
| |
This can be used to canonically compare ASTs for equality, e.g. in tests.
RELNOTES: None
PiperOrigin-RevId: 160283160
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the flag is activated, variables in list comprehensions do not leak anymore.
Even if a variable was defined before the loop, it's not accessible after the loop.
This change allows us to detect any breakage and ensures that no user is accessing
loop variables after the loop.
This will make possible for us to change the behavior and follow Python 3 semantics
in the future.
RELNOTES: None.
PiperOrigin-RevId: 158895514
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 155507750
|
|
|
|
|
|
|
|
|
| |
Make fields visibility/accessors more idiomatic. Prefer accessors that give a full map of the bindings and inherited bindings, rather than just the keys.
Also increase visibility of some accessors on Mutability.
RELNOTES: None
PiperOrigin-RevId: 155393780
|
|
|
|
|
|
|
|
|
| |
This helps readability, particularly since we also have "isImmutable" for SkylarkValues and in EvalUtils. I considered changing those to isFrozen as well, but we can leave it as-is since the terminology of freezing doesn't necessarily apply to non-Freezable things.
Also rephrased some javadoc.
RELNOTES: None
PiperOrigin-RevId: 155090987
|
|
|
|
|
|
|
|
|
|
|
| |
This is the second of two CLs for making command line options able to affect the Skylark interpreter. For the main kinds of evaluation contexts -- package loading, .bzl loading, rule analysis, aspect analysis, and computed defaults -- the SkylarkSemanticsOptions object is retrieved from Skyframe and passed along to the Environment builder. For other contexts such as tests, default values of builtin functions, and standalone Skylark, flags are currently not processed.
In the future, we may want to split into separate files the options that affect "pure" Skylark vs the options that affect Bazel-flavored Skylark. One possibility is to subclass SkylarkSemanticsOptions into SkylarkBazelSemanticsOptions, and go through an indirection in SkylarkUtils.
We could also pass SkylarkSemanticsOptions to the parser, to support --incompatible_* changes that alter Skylark's syntax. I don't think that's needed at the moment.
RELNOTES: None
PiperOrigin-RevId: 154628391
|
|
|
|
|
|
|
|
|
| |
This matters when the same rule (or other exportable) is bound to multiple
variables, since the identifier of the first variable will become its name.
--
PiperOrigin-RevId: 144881310
MOS_MIGRATED_REVID=144881310
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 143381556
MOS_MIGRATED_REVID=143381556
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 143373605
MOS_MIGRATED_REVID=143373605
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Broke //src/test/shell/bazel:external_skylark_load_test
See http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=linux-x86_64/370/console, for example.
*** Original change description ***
Remove callerLabel from Environment.
It is a Bazel-specific information.
--
MOS_MIGRATED_REVID=140742037
|
|
|
|
|
|
|
| |
It is a Bazel-specific information.
--
MOS_MIGRATED_REVID=140719791
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=140371603
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=140037282
|
|
|
|
|
|
|
| |
Next step will be to move Environment.Phase to SkylarkUtils.BazelInfo
--
MOS_MIGRATED_REVID=139902745
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=138757881
|
|
|
|
|
|
|
|
|
| |
Other fields will follow (is_skylark, phase, callerLabel).
The goal is to make Environment (and more generally Skylark) less dependent
on Bazel.
--
MOS_MIGRATED_REVID=137386248
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=137272887
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=137266170
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The only visible difference for users is that a few more functions are
available in BUILD files. That's fine, this difference was not even
documented.
RELNOTES:
A few functions are added to BUILD files for consistency (hash, dir,
hasattr, getattr) with .bzl files, although they are not very useful.
--
MOS_MIGRATED_REVID=136151633
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=135816105
|
|
|
|
|
|
|
| |
It was unused in Bazel.
--
MOS_MIGRATED_REVID=135483937
|
|
|
|
|
|
|
|
|
| |
RELNOTES: Global varaiables HOST_CFG and DATA_CFG are deprecated in favor of strings "host"
and "data.
Argument `cfg = "host"` or `cfg = "data"` is mandatory if `executable = True` is provided for a label.
--
MOS_MIGRATED_REVID=133285197
|
|
|
|
|
|
|
| |
This allow us to skip the import validation in non-build usages.
--
MOS_MIGRATED_REVID=130936612
|
|
|
|
|
|
|
| |
RELNOTES[INC]: Skylark: It is an error to shadow a global variable with a local variable after the global has already been accessed in the function.
--
MOS_MIGRATED_REVID=130014492
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks release.
***
*** Original change description ***
Fix Environment.Continuation's tracking of global variables
RELNOTES[INC]: Skylark: It is an error to shadow a global variable with a local variable after the global has already been accessed in the function.
--
MOS_MIGRATED_REVID=129910501
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=129869968
|
|
|
|
|
|
|
| |
RELNOTES[INC]: Skylark: It is an error to shadow a global variable with a local variable after the global has already been accessed in the function.
--
MOS_MIGRATED_REVID=129365195
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=129313959
|
|
|
|
|
|
|
|
| |
The goal is to remove parse and eval functions from Environment, as well as
isSkylark boolean.
--
MOS_MIGRATED_REVID=129202204
|
|
|
|
|
|
|
| |
Code typically doesn't use the message, so avoid creating it if we don't need to.
--
MOS_MIGRATED_REVID=128837352
|
|
|
|
|
|
|
|
|
|
| |
this is a noticeable hotspot in profiles of the loading phase.
(Every caller of lookup() or importSymbol() catches this and either
converts it to a non-exceptional condition or throws a new exception
which will have its own stack trace.)
--
MOS_MIGRATED_REVID=125320351
|
|
|
|
|
|
|
|
|
|
|
| |
commit 3fedf9e618cbce3dbdd00559b2de0bb8e2d43171 introduced the distinction between the loading phase and the workspace phase.
This check broke the use of native.existing_rule(s) in skylark remote repository, added a regression test for it.
Fixes #1277
--
MOS_MIGRATED_REVID=122988569
|
|
|
|
|
|
|
|
|
| |
RuleClass is deserialized as part of a Skylark rule, the Environment is currently not present, but it is needed to detect changes to the rule.
Also precompute and store the Environment's hash code, and do a drive-by clean-up of a bunch of warnings in the Environment code.
--
MOS_MIGRATED_REVID=122838588
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
via the Skylark and delete the constant. Also, change the isLoadingPhase in the
Skylark environment an enum Phase in order to:
- Decide whether testRules are enabled or not and,
- Check that the toolsRepository is set when in the LOADING phase.
Finally, a few tests that were using ConfiguredRuleClassProvider directly
had to be updated to set a tools repository, otherwise createGlobals() fails.
--
MOS_MIGRATED_REVID=121022804
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
6f15335 Make labels in .bzl files in remote repos resolve relative [...]
introduced a Frame#setLabel which is documented to create a new Frame
but instead modifies the existing one. This results in the global
environment being modified in-place.
I've been seeing some strange errors about not finding various packages
in the wrong repositories which seems to be fixed by this change.
--
Change-Id: I9b8521e50f45cfd385b20491315904ff0e24dcf6
Reviewed-on: https://bazel-review.googlesource.com/#/c/3300
MOS_MIGRATED_REVID=119529142
|