| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
* Skylark serialization was previously dropping location in error, which this fixes.
* Deletes a lot of codecs with fidelity issues (DynamicCodec has full fidelity).
* Deletes EnumRuntimeCodec which can now be replaced with the superior EnumCodec.
* This should eventually allow us to delete Serializable from all Blaze. The remaining blocker is NoSuchPackageExceptionCodec.
PiperOrigin-RevId: 191603929
|
|
|
|
|
|
|
|
| |
ObjectCodec into a MEMOIZE_AFTER MemoizingCodec. I think that this is safe, because all the codecs that are being wrapped this way weren't memoizing anything internally that I could see.
In order to @AutoCodec the WithValue type, which is generic and can have null elements in lists, add functionality to @AutoCodec to deal with generic type static instantiators, matching generic type arguments (although I'm not sure why that wasn't already working), and null elements in lists.
PiperOrigin-RevId: 187740461
|
|
|
|
|
|
|
|
|
|
| |
I'm assuming most of the time folks are only assigning one variable, which
doesn't require an ImmutableSet.Builder and the garbage it comes with.
Also took the liberty of removing some unused InterruptedException
declarations.
PiperOrigin-RevId: 187068400
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 166704851
|
|
|
|
|
|
|
| |
This is a simple refactoring, no change in behavior.
RELNOTES: None.
PiperOrigin-RevId: 165572028
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Made abstract collection classes in SkylarkMutable more systematic. Added javadoc. Added a BaseMutableList class to factor out List stubs from SkylarkList. Alphabetized the methods to make it easier to verify that all overrides are covered.
- Simplified MutableList constructors. Added MutableList#copyOf factory, and deprecated public access to the existing constructor to be more in line with Guava collections. Made Tuple#create private.
- Made mutation methods for MutableList take in mutabilities rather than environments. For symmetry with the other mutators, pushed SkylarkList#set down to MutableList and moved the evaluation of its index to the caller.
- Made SkylarkList#getSlice an abstract method that's implemented symmetrically in Tuple and MutableList -- instead of the bizarre thing it was doing before, where its return type was a List that sometimes got passed through SkylarkType.convertToSkylark in the caller.
- Removed final modifier on methods where it wasn't obviously appropriate. Removed redundant super() calls. Renamed type variables to always be one letter, and to not reuse the instance's own type variable name from within static methods.
RELNOTES: None
PiperOrigin-RevId: 164257778
|
|
|
|
|
|
|
| |
Also fix minor bug where a[b] += c would evaluate b twice.
RELNOTES: None
PiperOrigin-RevId: 163103618
|
|
|
|
|
|
|
|
|
|
|
|
| |
In other words, we now forbid these:
[] = []
() = ()
_, [] = f()
RELNOTES[INC]:
lvalues must have define at least one variable (i.e. we forbid `[] = f()`).
PiperOrigin-RevId: 160981283
|
|
|
|
|
|
|
| |
This can be used to canonically compare ASTs for equality, e.g. in tests.
RELNOTES: None
PiperOrigin-RevId: 160283160
|
|
|
|
|
|
|
| |
RELNOTES:
Iterating on a `depset` object is deprecated. If you need an iterable,
call the `.to_list()` method first.
PiperOrigin-RevId: 159672887
|
|
|
|
|
|
|
|
|
|
| |
* Cleanup ForClause and IfClause to be static classes
* Add missing/non-visible accessors and constructors
* Make use of final modifiers more consistent
* Make LValue an ASTNode.
RELNOTES: None
PiperOrigin-RevId: 156050683
|
|
|
|
|
| |
Usage: --incompatible_list_plus_equals=true (the default value is false).
PiperOrigin-RevId: 155084916
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Roll-forward of commit 01120026dc313ee7ad9ea95069a29252eb19173b with fix.
*** Original change description ***
Automated [] rollback of commit 01120026dc313ee7ad9ea95069a29252eb19173b.
--
PiperOrigin-RevId: 148897534
MOS_MIGRATED_REVID=148897534
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 148888469
MOS_MIGRATED_REVID=148888469
|
|
|
|
|
|
|
|
|
| |
This simplifies implementation of attr.* functions and helps make
declared provider implementation simpler.
--
PiperOrigin-RevId: 148867326
MOS_MIGRATED_REVID=148867326
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 148092963
MOS_MIGRATED_REVID=148092963
|
|
|
|
|
|
|
|
|
| |
The code has been untouched and unused for over a year (it's very likely
broken) and we have other priorities for now.
--
PiperOrigin-RevId: 145087310
MOS_MIGRATED_REVID=145087310
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=138757881
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=138700111
|
|
|
|
|
|
|
| |
function calls.
--
MOS_MIGRATED_REVID=133262955
|
|
|
|
|
|
|
| |
function calls.
--
MOS_MIGRATED_REVID=133259901
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=131056178
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=114860576
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks many targets, see []
*** Original change description ***
Reinstate mutable SkylarkDict
Add <String, Object> annotation to optionMap invocation in SkylarkAttr,
to make JDK 1.7 happy.
Give the visible name "aspect" to class SkylarkAspect.
--
MOS_MIGRATED_REVID=113543873
|
|
|
|
|
|
|
|
|
|
| |
Add <String, Object> annotation to optionMap invocation in SkylarkAttr,
to make JDK 1.7 happy.
Give the visible name "aspect" to class SkylarkAspect.
--
MOS_MIGRATED_REVID=113394826
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Break Java 1.7 builds of Bazel.
See http://ci.bazel.io/job/Bazel/JAVA_VERSION=1.7,PLATFORM_NAME=linux-x86_64/327/console
Test:
git clone ... && git revert c0a8c58 && export JAVA_VERSION=1.7 && export BAZEL_COMPILE_TARGET=compile && bash -c "source scripts/ci/build.sh; bazel_build"
*** Original change description ***
Make Skylark dicts mutable
Represent Skylark dict using a new subclass SkylarkDict<K, V> of Map<K, V>.
Back it with a TreeMap to provide a deterministic iteration order.
Also make SkylarkList generic in its element type <E>.
Have Artifact implement Comparable<Object> so it can be used as TreeMap key.
--
MOS_MIGRATED_REVID=113359718
|
|
|
|
|
|
|
|
|
|
| |
Represent Skylark dict using a new subclass SkylarkDict<K, V> of Map<K, V>.
Back it with a TreeMap to provide a deterministic iteration order.
Also make SkylarkList generic in its element type <E>.
Have Artifact implement Comparable<Object> so it can be used as TreeMap key.
--
MOS_MIGRATED_REVID=113277489
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
e.g. a['key'] = value
is handled through a proper lvalue, instead of using syntactic sugar.
Benefits include:
- better error messages (reference to the '+' operator was cryptic)
- more robust, e.g. it is compatible with the += operator
- can be used in a tuple, e.g. a[1], a[2] = 3, 4
- it is a step towards mutable dict
--
MOS_MIGRATED_REVID=111597545
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=110836326
|
|
|
|
|
|
|
| |
Reduces garbage.
--
MOS_MIGRATED_REVID=109914243
|
|
|
|
|
|
|
| |
Mostly reuses the interpreters argument checking and helper functions.
--
MOS_MIGRATED_REVID=107395974
|
|
|
|
|
|
|
|
| |
Add EvalExceptions for cases in which the interpreter would throw them
during evaluation of the function definition.
--
MOS_MIGRATED_REVID=107376021
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make Environment-s freezable: Introduce a class Mutability
as a revokable capability to mutate objects in an Environment.
For now, only Environment-s carry this capability.
Make sure that every Mutability is revoked in the same function that create...
This reinstates a change that previously rolled-back because it broke the
serializability of SkylarkLookupValue. Bad news: serializing it succeeds for the
wrong reason, because a SkylarkEnvironment was stored as a result (now an
Environment.Extension) that was Serializable but inherited its bindings from an Environment (now an Environment.BaseExtension) which wasn't Serializable.
Apparently, Java doesn't try to serialize the bindings then (or at least doesn't
error out when it fails), because these bindings map variable names to pretty
arbitrary objects, and a lot of those we find in practice aren't Serializable.
Thus the current code passes the same tests as the previous code, but obviously
the serialization is just as ineffective as it used to be.
--
MOS_MIGRATED_REVID=102776694
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks serialization of SkyValues.
--
MOS_MIGRATED_REVID=102457225
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make Environment-s freezable: Introduce a class Mutability
as a revokable capability to mutate objects in an Environment.
For now, only Environment-s carry this capability.
Make sure that every Mutability is revoked in the same function that creates it,
so no Environment is left open for modification after being created and exported;
exceptions for tests, the shell and initialization contexts.
Unify Environment, SkylarkEnvironment and EvaluationContext into Environment.
Have a notion of Frame for the bindings + parent + mutability.
Replace the updateAndPropagate mechanism by a dynamicFrame.
Simplify ValidationEnvironment, that is now always deduced from the Environment.
--
MOS_MIGRATED_REVID=102363438
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=101518833
|
|
|
|
|
|
|
| |
methods.
--
MOS_MIGRATED_REVID=98922811
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=96211360
|
|
|
|
|
|
|
|
| |
Refactor the implementation of format.
Add %r. Improve some error messages.
--
MOS_MIGRATED_REVID=96154542
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move printing code from EvalUtils to Printer.
Rename functions in Printer:
printValue becomes str or print,
prettyPrintValue becomes repr or write,
formatString becomes format,
makeFormattable becomes strFormattable,
prettyPrintValues becomes listString.
write being self-sufficient is made the reference,
and print is the one that is a wrapper around write,
rather than the other way around, avoiding mutual recursion.
--
MOS_MIGRATED_REVID=95897834
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=93881507
|
|
|
|
|
|
|
|
| |
There are still some static checks (check existence of variable/function,
readonly variables, etc.). More cleanup will come later.
--
MOS_MIGRATED_REVID=90979748
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the new EvaluationContext infrastructure to simplify Skylark tests
(said infrastructure is originally based on code from these tests).
Merge AbstractEvaluationTestCase and AbstractParserTestCase into
a non-abstract class EvaluationTestCase that uses EvaluationContext.
Cleanup the EventCollectionApparatus it uses.
Refactor all Skylark tests to use this new infrastructure.
Fix EvaluationTest and MethodLibraryTest to actually and correctly
run tests in both modes.
Fix small bugs in the main code base discovered by actually running the
code in both modes, and make error messages identical when possible.
--
MOS_MIGRATED_REVID=90828053
|
|
|
|
|
|
|
|
|
|
| |
This happens in for loops, list comprehensions and simple assigment.
e.g.
a, b = expr
[a for a, b in expr]
--
MOS_MIGRATED_REVID=89123977
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=89020190
|
|
This CL is just moving code from AssignmentStatement to a new class. The goal
is to share code dealing with LValues.
LValues can be found here:
- lvalue = 2
- [for lvalue in exp]
- {a: b for lvalue in exp]
- for lvalue in exp: pass
The LValue itself can have different forms:
- a
- a, b
- a[0]
- a, (b, c)
- [a[0], (b, c)]
- a[1:5]
Although we may not handle everything, we need to make sure that the same
things can be used in variable assignment and in for loops.
--
MOS_MIGRATED_REVID=89015483
|