| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
| |
It's now allowed to return anything from a rule implementation function.
If a ctx object is returned it becomes featureless and cannot be used from
anywhere else (i.e. from an implementation function of another rule).
Fixes #2319
--
PiperOrigin-RevId: 151015919
MOS_MIGRATED_REVID=151015919
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, ClassObjects' SkylarkCallable struct fields worked
as expected (with values of the struct taking precedence), but
calling methods annotated with SkylarkCallable did not work at
all; methods were treated as if they were not present in the struct.
This adds some tests for the various ways of looking up fields
and methods, and rearranges the logic in FuncallExpression to
allow for callable methods on SkylarkClassObject's descendants.
--
PiperOrigin-RevId: 150876181
MOS_MIGRATED_REVID=150876181
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 150051360
MOS_MIGRATED_REVID=150051360
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 149560999
MOS_MIGRATED_REVID=149560999
|
|
|
|
|
|
|
|
| |
In particular, display the type that was passed as argument.
--
PiperOrigin-RevId: 148995695
MOS_MIGRATED_REVID=148995695
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** 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: 148469323
MOS_MIGRATED_REVID=148469323
|
|
|
|
|
|
|
|
|
|
| |
Updated class doc, added examples to depsets.md.
Constructor/method doc updates will be a follow-up CL.
--
PiperOrigin-RevId: 148463032
MOS_MIGRATED_REVID=148463032
|
|
|
|
|
|
|
|
|
| |
This enables both native and Skylark rules to declare attributes which
have labels/Targets as keys, and have string values.
--
PiperOrigin-RevId: 148365033
MOS_MIGRATED_REVID=148365033
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 148281228
MOS_MIGRATED_REVID=148281228
|
|
|
|
|
|
|
|
|
|
| |
We currently have no need to discern between strings quoted with ' or ". While it could be
nice for something one day (and may have been in the past), it's yagni now. Removing the
distinction simplifies string concatenation.
--
PiperOrigin-RevId: 148273400
MOS_MIGRATED_REVID=148273400
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 148244816
MOS_MIGRATED_REVID=148244816
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 148092963
MOS_MIGRATED_REVID=148092963
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 148042501
MOS_MIGRATED_REVID=148042501
|
|
|
|
|
|
|
|
| |
This was a bug, f(*4) was silently handled as f().
--
PiperOrigin-RevId: 148017021
MOS_MIGRATED_REVID=148017021
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 147908180
MOS_MIGRATED_REVID=147908180
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 147892584
MOS_MIGRATED_REVID=147892584
|
|
|
|
|
|
|
|
|
|
| |
Dict keys can in theory belong to different types, it's not allowed anymore to
compare such objects by < in Skylark, so the Printer class shouldn't do it
either.
--
PiperOrigin-RevId: 147827109
MOS_MIGRATED_REVID=147827109
|
|
|
|
|
|
|
|
|
| |
The reasons for these being public are outdated. Hide them so that no one gets
too attached.
--
PiperOrigin-RevId: 147739764
MOS_MIGRATED_REVID=147739764
|
|
|
|
|
|
|
|
| |
Inlining the function makes the code more readable.
--
PiperOrigin-RevId: 147711468
MOS_MIGRATED_REVID=147711468
|
|
|
|
|
|
|
|
|
|
| |
RELNOTES[INC]: It's not allowed anymore to compare objects of different types
(i.e. a string to an integer) and objects for which comparison rules are not
defined (i.e. a dict to another dict) using order operators.
--
PiperOrigin-RevId: 147710942
MOS_MIGRATED_REVID=147710942
|
|
|
|
|
|
|
|
|
| |
This improves consistency in the documentation (string and list already
have their own page).
--
PiperOrigin-RevId: 147599068
MOS_MIGRATED_REVID=147599068
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 147517743
MOS_MIGRATED_REVID=147517743
|
|
|
|
|
|
|
|
|
|
|
| |
This has no visible effect on Bazel (eval is used just for internal
expressions that don't fail), and is therefore not tested.
It will be tested when we add tests to the standalone Skylark interpreter.
--
PiperOrigin-RevId: 147495990
MOS_MIGRATED_REVID=147495990
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently label-type attributes are detected in many places across the
codebase by simply reference-comparing against each of the label types.
This CL aims to generalize most of these cases, moving the encoding of
this logic into a single place (Type/BuildType itself). Not all of these
cases can be made general without further refactoring, and some perhaps
shouldn't be - serialization and Skylark rule context, for example, need
to do exotic things based on the type. But most sites can avoid having to
enumerate all the types they work with explicitly.
This causes LABEL_DICT_UNARY to start being treated like the other label
types, which means that CcToolchainSuiteRule and JavaRuntimeSuiteRule
need to include a set of allowed file types (none, in their case).
Skylark will continue treating it as a dictionary from String to Label
in its rule context, however, to avoid visible behavior changes.
--
PiperOrigin-RevId: 147471542
MOS_MIGRATED_REVID=147471542
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 147456653
MOS_MIGRATED_REVID=147456653
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks Skylark aspects running over rules with LABEL_DICT_UNARY attributes.
*** Original change description ***
Refactoring: Types report what class of labels they contain.
Currently label-type attributes are detected in many places across the
codebase by simply reference-comparing against each of the label types.
This CL aims to generalize most of these cases, moving the encoding of
this logic into a single place (Type/BuildType itself). Not all of these
cases can be made general without further refactoring, and some perhaps
shouldn't be - serialization and Skylark rule context, for example, need
to do...
--
PiperOrigin-RevId: 147385072
MOS_MIGRATED_REVID=147385072
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently label-type attributes are detected in many places across the
codebase by simply reference-comparing against each of the label types.
This CL aims to generalize most of these cases, moving the encoding of
this logic into a single place (Type/BuildType itself). Not all of these
cases can be made general without further refactoring, and some perhaps
shouldn't be - serialization and Skylark rule context, for example, need
to do exotic things based on the type. But most sites can avoid having to
enumerate all the types they work with explicitly.
This causes LABEL_DICT_UNARY to start being treated like the other label
types, which means that CcToolchainSuiteRule and JavaRuntimeSuiteRule
need to include a set of allowed file types (none, in their case).
--
PiperOrigin-RevId: 147175424
MOS_MIGRATED_REVID=147175424
|
|
|
|
|
|
|
|
| |
[2] * 3 should return [2, 2, 2] and not [2, 2, 2, 2].
--
PiperOrigin-RevId: 147017581
MOS_MIGRATED_REVID=147017581
|
|
|
|
|
|
|
|
|
| |
Closes #2484.
--
Reviewed-on: https://github.com/bazelbuild/bazel/pull/2484
PiperOrigin-RevId: 146687145
MOS_MIGRATED_REVID=146687145
|
|
|
|
|
|
|
|
|
| |
Aside from making error messaging clearer, this stops Bazel from
crashing on select({None: ...}) (a pretty anti-social error message).
--
PiperOrigin-RevId: 146173043
MOS_MIGRATED_REVID=146173043
|
|
|
|
|
|
|
|
|
|
| |
RELNOTES[INC]:
Depsets (former sets) are converted to strings as "depset(...)" instead of
"set(...)".
--
PiperOrigin-RevId: 145990995
MOS_MIGRATED_REVID=145990995
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 145859025
MOS_MIGRATED_REVID=145859025
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 145792618
MOS_MIGRATED_REVID=145792618
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is not intended to be a user-visible semantic change, aside from error messages.
This is to help avoid unintentional flattening of depsets, and to narrow down the number of call sites where this can occur, to help us print warning/deprecation messages.
EvalUtils#toIterable will now return an ImmutableList in place of SkylarkNestedSet. This should be ok since the caller shouldn't be relying on the result being a Skylark-safe type. Code that takes Iterable because it accepts either a list or set, can instead be changed to take Object and use EvalUtils#toIterableStrict for validation.
Note that NestedSet still implements Iterable, so native code can still easily and accidentally flatten sets.
--
PiperOrigin-RevId: 145044023
MOS_MIGRATED_REVID=145044023
|
|
|
|
|
|
|
|
|
|
| |
The old names are deprecated but still supported for now. A flag for enforcing the deprecation will come in a later change.
RELNOTES[INC]: The traversal orders for depsets have been renamed. The old names are deprecated and will be removed in the future. New names: "stable" -> "default", "compile" -> "postorder", "link" -> "topological", "naive_link" -> "preorder".
--
PiperOrigin-RevId: 145004718
MOS_MIGRATED_REVID=145004718
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 144890965
MOS_MIGRATED_REVID=144890965
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
RELNOTES[INC]:
Tuples that end with a trailing comma must now be inside parens,
e.g. (1,) instead of 1,
--
PiperOrigin-RevId: 144690953
MOS_MIGRATED_REVID=144690953
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 144608820
MOS_MIGRATED_REVID=144608820
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the preferred way to test for membership in, or iterate over, depsets (aka nested sets, aka plain old set()). The old way of doing membership tests or iterations over the raw depset itself is deprecated and may be removed in the future.
Note that membership testing in a depset was always an O(n) operation, perhaps contrary to the user's expectation, so using to_list() does not make things asymptotically worse. It just makes things more explicit.
RELNOTES: To iterate over or test for membership in a set, prefer using the new to_list() method. E.g., "for x in myset.to_list():", or "print(x in myset.to_list())". Iteration/membership-test on the raw set itself is deprecated.
--
PiperOrigin-RevId: 144452510
MOS_MIGRATED_REVID=144452510
|
|
|
|
|
|
|
|
| |
Moved some tests, fixed formatting, changed to use assertThat().
--
PiperOrigin-RevId: 144356402
MOS_MIGRATED_REVID=144356402
|
|
|
|
|
|
| |
--
PiperOrigin-RevId: 144194956
MOS_MIGRATED_REVID=144194956
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
== Before this change ==
Previously, if a and b are sets, then a + b created a new set c whose direct and transitive elements were all those of a, and with b appended as an additional transitive element. If on the other hand b is a list instead of a set, then its contents were appended as additional direct elements of c. In both cases, you can think of c as a copy of a that also knows about b.
This copying of a's elements into c can lead to accumulation when you do it repeatedly, e.g. x += y in a loop. Each union can take O(n) time so you get O(n^2) time overall. Nested set union is supposed to be O(1) time per operation and O(n) time overall.
It also leads to surprising iteration orders. If you do a + b + c + d (left-associative), where each one is a set, then when you do a post-order traversal you get the elements of b, c, d, and a, in that order. This is because b, c, and d each get appended as transitive children of the copies of a.
== After this change ==
If a and b are sets, then a + b returns a new set c with a and b as its two transitive children. If b is a list, then c has a as its only transitive child and b's elements as its only direct elements. This is straightforward, O(1), and avoids the problem with the confusing order.
It is implemented by removing the items/transitiveItems fields and just relying on NestedSetBuilder.
RELNOTES[INC]: (Skylark) Set union is now O(1). As a side-effect, the iteration order of sets produced by union has changed. "print(set([1]) + set([2]) + set([3]))" will now give back the order 1, 2, 3 instead of 2, 3, 1.
--
PiperOrigin-RevId: 143972165
MOS_MIGRATED_REVID=143972165
|
|
|
|
|
|
|
|
| |
In case of conflict, show the location of the original rule.
--
PiperOrigin-RevId: 143541281
MOS_MIGRATED_REVID=143541281
|
|
|
|
|
|
|
|
| |
--
Change-Id: I9ec3209a69ba5a51943b334f278ba93d67d4f9f4
Reviewed-on: https://cr.bazel.build/8090
PiperOrigin-RevId: 143470915
MOS_MIGRATED_REVID=143470915
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
strip(), lstrip(), and rstrip() now accept a None argument as a synonym for
the no-arg version. The characters that are considered as whitespace (to be
removed by default in the no-arg form) are now the same as in Python 3.6.
RELNOTES[INC]: The string methods strip(), lstrip(), and rstrip() now
by default remove the same whitespace characters as Python 3 does, and accept
None as an argument.
--
PiperOrigin-RevId: 143388250
MOS_MIGRATED_REVID=143388250
|