| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
| |
RELNOTES:
The `/` operator is deprecated in favor of `//` (floor integer division).
Try the `--incompatible_disallow_slash_operator` flag to ensure your code
is forward-compatible.
PiperOrigin-RevId: 192430310
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 192337555
|
|
|
|
|
|
|
|
|
| |
parity with @SkylarkSignature.
This is necessary for several builtin functions that still use @SkylarkSignature, such as string format. These will be migrated in a future CL.
RELNOTES: None.
PiperOrigin-RevId: 192200282
|
|
|
|
|
|
|
| |
This involves enforcing additional compiletime restrictions on Param ordering and semantics.
RELNOTES: None.
PiperOrigin-RevId: 191927206
|
|
|
|
| |
PiperOrigin-RevId: 191717115
|
|
|
|
|
|
|
|
|
| |
@SkylarkSignature
Most notably, this involves introduction of a new function abstraction, BuiltinMethod, which can wrap a {objc, SkylarkCallable} pair into a BaseFunction for later calling. (This is required due to the current layer of indirection on the end "native" module)
RELNOTES: None.
PiperOrigin-RevId: 191642467
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 191641410
|
|
|
|
|
|
|
| |
This is useful for contexts like ctx.actions.args()'s methods, where %d and %r aren't appropriate placeholders.
RELNOTES: None
PiperOrigin-RevId: 191629195
|
|
|
|
|
|
|
| |
of @SkylarkSignature.
RELNOTES: None.
PiperOrigin-RevId: 191112273
|
|
|
|
|
|
|
| |
documented=false.
RELNOTES: None.
PiperOrigin-RevId: 191112140
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 190823566
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 190785580
|
|
|
|
|
|
|
| |
Also add tests for leading "+" in int(<string>) form.
RELNOTES: None
PiperOrigin-RevId: 190507678
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Roll-forward with fix (equality and hashcode for relevant classes). Also add a bit more debugging info in case of failure.
PiperOrigin-RevId: 190492934
|
|
|
|
|
|
|
|
|
|
| |
- fix negatives + prefixes
- fix boundary cases (min int value)
The only remaining relevant differences from Python are that we disallow int() with zero args, we don't allow whitespace in strings, and we take Python 3's view on prohibiting leading 0s when base is 0.
RELNOTES: None
PiperOrigin-RevId: 190216646
|
|
|
|
|
|
|
| |
vardef().
RELNOTES: None.
PiperOrigin-RevId: 190196933
|
|
|
|
|
|
|
|
|
|
|
| |
specifically get a semantics object
This is slightly redundant with useEnvironment, yes (as one can easily obtain the semantics object with Environment), but we intend on restricting useEnvironment so that structField=true methods cannot specify useEnvironment, but *can* specify useSkylarkSemantics.
In general, we can also ween off non structField methods to use useSkylarkSemantics instead of useEnvironment in cases where this is feasible.
RELNOTES: None.
PiperOrigin-RevId: 190082547
|
|
|
|
| |
PiperOrigin-RevId: 190069001
|
|
|
|
|
|
|
|
| |
RELNOTES[INC]: The --incompatible_disallow_uncalled_set_constructor flag is no
longer available, the `set` constructor` is completely removed from Skylark.
Use `depset` instead.
PiperOrigin-RevId: 190053331
|
|
|
|
|
|
|
|
|
| |
@SkylarkSignature more closely.
Also clarify the method representation in these error messages is for the attempted method *call*, not the actual method signature.
RELNOTES: None.
PiperOrigin-RevId: 189935148
|
|
|
|
|
|
|
|
|
| |
Clarify that the IMMUTABLE Mutability should only be used for deeply immutable things, not tuples. Created a new SHALLOW_IMMUTABLE Mutability for them.
Note that the new shallow-freezing functionality marks things as deeply IMMUTABLE without traversing its contents. I.e., it lies, and it is up to the caller to ensure this doesn't cause problems.
RELNOTES: NONE
PiperOrigin-RevId: 189767422
|
|
|
|
| |
PiperOrigin-RevId: 189419493
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function call.
This is the 2nd attempt at this commit. The first attempt (https://github.com/bazelbuild/bazel/commit/f1013485d41efd8503f9d4f937e17d1b4bc91ed3) was rolled back because it introduced the following two bugs:
(1) The side effects of Environment#enterScope are relevant: it creates and stores a new Continuation that has a reference to the set currently referenced by 'knownGlobalVariables', and then overwrites the value of the variable. When there are e.g. nested function calls, 'knownGlobalVariables' will be wrong in the Environment used to stage the inner call (see the added test for an example).
(2) The finally block in UserDefinedFunction#call assumes the env.enterScope was called. Because of the EvalException (incorrectly) thrown due to (1), this is no longer true.
I restructured the code such that (2) isn't possible and I also added a unit test that would have caught the two bugs.
In my first attempt, I was doing too much - I was also trying to save the CPU-costs in the env.update call (dispatches to the just-created lexical frame, and calls LexicalFrame#put, which does an unnecessary mutability sanity check, etc) and in doing so completely missed the above bugs. Sorry.
RELNOTES: None
PiperOrigin-RevId: 188411737
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 188201686
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was previously assumed that safety wasn't needed because
1) all builtins should be registered in static initializer blocks, and
2) all retrievals should occur during Skylark evaluation, after static initialization completes.
It turns out these assumptions aren't actually true (Who would've thunk it!). SkylarkActionFactory has been observed to be initialized as late as analysis time, and retrievals occur as early as constructing a PackageFactory (when scanning the native module). The failure mode is particularly ugly: Random Skylark method lookups will fail non-deterministically.
This change guards against this by making the builtins registry implement a form of freezing. Before freezing, reads and writes are allowed and are synchronized. After freezing, only reads are allowed and they are unsynchronized for performance. BlazeRuntime is responsible for flipping the bit, and for ensuring classes like SkylarkActionFactory run their initialization by that point. Unit tests don't need to worry, since they just stay unfrozen and synchronized throughout.
RELNOTES: None
PiperOrigin-RevId: 188080136
|
|
|
|
|
|
|
| |
a nice consequence, this lets us reduce GC churn since we no longer need to create a frame instance for the lexical frame at a callsite of either a function when the environment is frozen or a builtin function (since builtins cannot modify bindings in their lexical frame).
RELNOTES: None
PiperOrigin-RevId: 187495787
|
|
|
|
|
|
| |
RELNOTES:
Removed flag `--incompatible_load_argument_is_label`.
PiperOrigin-RevId: 187479614
|
|
|
|
| |
PiperOrigin-RevId: 187397314
|
|
|
|
|
|
|
|
|
|
| |
These subclasses should be using @SkylarkCallable(structField = true) instead
This is a bit of a memory win, as there is now no need to store field information twice.
There are still a couple of stragglers that are more difficult, namely ToolchainInfo and DefaultInfo. Their APIs will likely need some more extensive revamping before proceeding.
RELNOTES: None.
PiperOrigin-RevId: 187364392
|
|
|
|
|
|
| |
More information: https://github.com/junit-team/junit5/issues/531
PiperOrigin-RevId: 186900384
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 186693205
|
|
|
|
|
|
| |
to select a codec.
PiperOrigin-RevId: 186378153
|
|
|
|
|
|
| |
RELNOTES:
Removed flags `--incompatible_checked_arithmetic`, `--incompatible_dict_literal_has_no_duplicates`, `--incompatible_disallow_keyword_only_args`, and ` --incompatible_comprehension_variables_do_not_leak`.
PiperOrigin-RevId: 185977740
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 185838543
|
|
|
|
|
|
|
| |
Added a little javadoc and tests.
RELNOTES: None
PiperOrigin-RevId: 185569985
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 185353994
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 184649483
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 184498836
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 184016150
|
|
|
|
|
|
|
|
| |
SkylarkAspectLoadingKey.
Also add a @VisibleForSerialization annotation to @AutoCodec, since we're going to need to increase serialization visibility a lot here, and clean up some unnecessary modifiers.
PiperOrigin-RevId: 182389162
|
|
|
|
|
|
|
|
|
| |
The bug also permitted For statements in BUILD files so long as they were contained within an If statement (i.e. not at the top level).
Also add minor guidance to error messages.
RELNOTES: None
PiperOrigin-RevId: 182236172
|
|
|
|
|
|
| |
* Moves SingletonCodec to third_party.
PiperOrigin-RevId: 182143153
|
|
|
|
|
|
|
| |
If two values compared equal (e.g., MethodLibrary#bool and SkylarkAttr#bool), we were dropping one of them in favor of the other.
RELNOTES: None
PiperOrigin-RevId: 182057611
|
|
|
|
|
|
|
| |
The said test fails if the --incompatible_disallow_dict_plus flag is flipped by
default (e.g. in a .bazelrc file)
PiperOrigin-RevId: 180553910
|
|
|
|
|
|
|
| |
The terminology "field" is preferred over "key" for the components of a struct or struct-like object.
RELNOTES: None
PiperOrigin-RevId: 180269374
|
|
|
|
| |
PiperOrigin-RevId: 179748374
|
|
|
|
|
|
|
|
| |
RELNOTES[INC]: The flag --incompatible_list_plus_equals_inplace is removed, its
default behavior is preserved. += on lists now always mutates the left hand
side.
PiperOrigin-RevId: 178359047
|
|
|
|
|
|
|
|
|
|
|
| |
This covers all builtins in classes that use SkylarkSignatureProcessor#configureSkylarkFunctions. Generally this means things you define with @SkylarkSignature.
It is now an error to call configureSkylarkFunctions multiple times for the same class. It should only be called in static initializers.
Runtime's static knowledge of builtins has been factored into Runtime.BuiltinRegistry.
RELNOTES: None
PiperOrigin-RevId: 178295926
|
|
|
|
|
|
|
| |
RELNOTES:
Using `+`, `|` or `.union` on depsets is now deprecated. Please use the new
constructor instead (see https://docs.bazel.build/versions/master/skylark/depsets.html).
PiperOrigin-RevId: 178262338
|
|
|
|
|
| |
RELNOTES: None.
PiperOrigin-RevId: 177487913
|