| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
Also rename it to a separate function since boolean args are vague.
RELNOTES: None
PiperOrigin-RevId: 192201308
|
|
|
|
|
|
|
|
|
|
|
| |
Args#add(value, *, arg, format)
Args#add_all(value, *, arg, map_each, format_each, before_each, omit_if_empty, uniquify)
Args#add_joined(value, *, arg, join_with, map_each, format_each, format_joined, omit_if_empty, uniquify)
The old Args#add remains backwards compatible, but we add a flag to disable this compatibility mode.
RELNOTES: None
PiperOrigin-RevId: 191804482
|
|
|
|
|
|
|
| |
This is useful for contexts like ctx.actions.args()'s methods, where %d and %r aren't appropriate placeholders.
RELNOTES: None
PiperOrigin-RevId: 191629195
|
|
|
|
|
|
|
|
|
| |
provider keys.
This change only affects printing a rule target directly -- it intentionally does not affect the behavior of str(target), as we want to avoid skylark code being able to parse potentially-private provider keys.
RELNOTES: In skylark, print(target) now shows the provider keys of a target, as debug information.
PiperOrigin-RevId: 186046226
|
|
|
|
|
|
|
|
| |
These libs are exposed externally, implying that the vfs is also exposed externally.
We break out PathFragment from vfs to still use this in their interface. This class is a much smaller dependency than the entire vfs.
PiperOrigin-RevId: 174729373
|
|
|
|
|
|
|
|
| |
RELNOTES[INC]: The flag --incompatible_descriptive_string_representations is no
longer available, old style string representations of objects are not supported
anymore.
PiperOrigin-RevId: 171952621
|
|
|
|
|
|
|
| |
Mainly this just means using getters instead of fields to access option values.
RELNOTES: None
PiperOrigin-RevId: 171101597
|
|
|
|
|
| |
RELNOTES: None
PiperOrigin-RevId: 165489091
|
|
|
|
|
|
|
|
| |
Don't call the `toString` method on unknown objects as it potentially
breaks hermeticity and determinism. Use a generic string like
"<unknown object package.ClassName>" instead.
PiperOrigin-RevId: 161970449
|
|
|
|
|
|
| |
*** Reason for rollback ***
PiperOrigin-RevId: 161567104
|
|
|
|
|
|
|
|
| |
Don't call the `toString` method on unknown objects as it potentially
breaks hermeticity and determinism. Use a generic string like
"<unknown object package.ClassName>" instead.
PiperOrigin-RevId: 161544828
|
|
|
|
|
|
|
|
|
| |
Skylark's Printer.BasePrinter doesn't guarantee it will call `.toString` on
objects of unknown types, and in the future that won't be the case anymore.
In order to keep their current string representations objects should implement
the SkylarkValue interface by providing an explicit implementation of `repr`.
PiperOrigin-RevId: 161526182
|
|
|
|
|
|
|
|
|
|
|
| |
If --incompatible_descriptive_string_representations is passed, labels are converted
to strings using `repr` differently: `Label("//package:name")` instead of
`"//package:name"`
This CL doesn't affect representations of other object types but provides the
necessary infrastructure for it.
PiperOrigin-RevId: 160955284
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
--
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=135816105
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SkylarkList now implements the List interfaces, except that its mutating methods
throw an UnsupportedOperationException, just like ImmutableList does.
To actually mutate a SkylarkList, you need to pass a Location and a suitable
Environment object with a matching Mutability while it is still active.
Introduce SkylarkMutable and SkylarkMutable.MutableCollection to better handle
mutable data structures.
Remove some functions in EvalUtils made obsolete by this and previous changes regarding Skylark lists.
--
MOS_MIGRATED_REVID=112768457
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Skylark into their own package. This allows, e.g., classes in the syntax package to access classes in the cmdline package without creating circular dependencies.
While we're here:
- Removed a couple of unused BUILD deps flagged in [].
- Updated SkylarkRuleImplementationFunctionsTest to remove non-ASCII characters and
clarify the intent of the test.
--
MOS_MIGRATED_REVID=110360763
|
|
|
|
|
|
|
| |
no).
--
MOS_MIGRATED_REVID=104655508
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Some rules write the toString representation of lists of files to disk and then read it back again. This breaks that.
--
MOS_MIGRATED_REVID=104524336
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=104197461
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
| |
Make SkylarkList no longer read-only to match Python and the BUILD language.
Instead, subject it to a Mutability object inherited from the Environment.
--
MOS_MIGRATED_REVID=103332973
|
|
|
|
|
|
|
|
|
|
|
| |
Clarify the criterion for being a valid Skylark value;
stop claiming immutability is "the" criterion when Skylark now has mutable values;
stop relying on a reflection with a magic list (this also fixes the SkylarkShell build).
Clarify the criterion for determining immutable types when making a SkylarkNestedSet.
Clarify and use the criterion for being a valid Skylark dict key.
--
MOS_MIGRATED_REVID=103313934
|
|
|
|
|
|
|
| |
This will be used to remove Blaze-specific data types, FilesetEntry, Label and GlobList from the .syntax package.
--
MOS_MIGRATED_REVID=103281375
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=102986851
|
|
|
|
|
|
|
|
| |
Move away global constants and global namespaces out of Environment
and into a new file Runtime.
--
MOS_MIGRATED_REVID=101940218
|
|
|
|
|
|
|
|
|
|
| |
Rename some methods to avoid clashes.
Add function formattable to create lazily-formatted objects,
remove now unused strFormattable and reprFormattable.
Also some whitespace cleanup.
--
MOS_MIGRATED_REVID=101459565
|
|
|
|
|
|
|
|
|
| |
- Objects of different types can now be compared.
- Printer now prints dictionaries in a deterministic order, even when the keys have different types.
- testEval() in EvaluationTestCases evaluates both expressions instead of comparing expression strings. Consequently, if a statement describes a collection, its order does no longer matter when doing the comparison.
--
MOS_MIGRATED_REVID=99829458
|
|
|
|
|
|
|
| |
quotation marks
--
MOS_MIGRATED_REVID=97320494
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Breaks 'blaze query'
*** Original change description ***
Skylark: write labels readably
Write a label as Label("//x:x") instead of merely "//x:x", so it can be read
and evaluated back, as per the Python convention. However, the OutputFormatter
for BUILD files still needs to output "//x:x".
--
MOS_MIGRATED_REVID=97156166
|
|
|
|
|
|
|
|
|
| |
Write a label as Label("//x:x") instead of merely "//x:x", so it can be read
and evaluated back, as per the Python convention. However, the OutputFormatter
for BUILD files still needs to output "//x:x".
--
MOS_MIGRATED_REVID=96209979
|
|
|
|
|
|
|
|
| |
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
|
|
Create a Printer class into which to eventually move all printing infrastructure
currently in EvalUtils. For now, only move string escaping there.
Fix the forgotten case of backslash.
Allow any style of Python quotes, while we're at it,
but keep using simple double-quote as the default.
--
MOS_MIGRATED_REVID=95328052
|