The output directories for the target under test may differ when the target is under a config transition (config_settings is passed to analysistest.make). Since analysis tests may assert about the command-line of generated actions, and those command-lines may contain paths to output files, this is useful information to expose.
* Add sets.is_set() to test whether an arbitrary object is a set.
Since using sets requires special API, it can be useful to determine
whether an object is a set so special handling can be used.
For example, if a method wants to be able to take a list or a set.
* add empty CHANGELOG.md to try to reuse bazel release.sh
* checkpoint a new distribution method
* Update CHANGELOG.
* checkpoint relnew
* get the tarball working
* fix visibilyt
* whitespace
* punctuation typos
* buildify
* linty fresh
- Update to newer version of stardoc.
- Make lib/selects.bzl stardoc compatible. There must be a block description before Args:
Docs now generate with
bazel build --incompatible_remap_main_repo docs:*
See https://github.com/bazelbuild/bazel/issues/7130 for reasons.
* Make sets.bzl point to new_sets.bzl instead of old_sets.bzl
new_sets.bzl and old_sets.bzl should be removed in the following skylib release.
Fixes #155.
* update and rename test suites
In this commit:
- change unittest.bzl to declare a named output
file instead of relying on the deprecated [1]
default output name (ctx.outputs.executable).
- define a new toolchain_type and toolchain rules
for cmd.exe and for Bash (basically Windows and
non-Windows)
- register the new toolchains in workspace.bzl
- let unittest.make-created test rules require the
new toolchain_type
- write the test output script as a Windows batch
script or as a Shell script, depending on the
selected toolchain
This PR enables the Bazel team to break the Bash
dependency (for test execution) on Windows, and
can run Starlark unittests with the new,
Windows-native test wrapper (still under
development).
See https://github.com/bazelbuild/bazel/issues/5508
In future Bazel releases ctx.file_action will be removed.
ctx.action.write should be used instead.
With this change tests pass even if --incompatible_new_actions_api
is used.
Bazel issue:
https://github.com/bazelbuild/bazel/issues/5825
The fail() and print() primitives take strings without newlines in them
because the formatted output will already contain newlines. Therefore,
remove them, which have been annoying me to no end when using rules_go
with a HEAD-built Bazel binary.
While doing this, also switch to using .format() consistently for all
strings, merge two related debug messages into the same print() call,
and fix grammar.
Most notably, this renames/moves a few important identifiers:
//:skylark_library.bzl -> //:bzl_library.bzl
skylark_library -> bzl_library
SkylarkLibraryInfo -> StarlarkLibraryInfo
When creating a skylark_library A anywhere downstream, if a bzl file in A loads() any of the bzl libraries in this package, then the bzl files in this package will have to be in deps as a skylark_library. The current public filegroup cannot be used as a dependency of skylark_libraries.
Buildifier 0.12.0 includes initial support for reformatting .bzl files.
- Reformat all the bzl files.
- Expand the travis check to check the .bzl files also.
Even though it's not great to use type checks, they are frequently useful for
checking input types of macros.
Because there is no standard way of checking types, at least 2 types of checks
are used:
- `type(foo) == type([])`
- `type(foo) == "list"`
The first option is not very readable and the second option seem to be relying
on an Bazel implementation detail. Encapsulating type checks into this library
enables consistent and easy to understand type checking without explicitly
relying on implementation details.
* Fix up the skylint warning about depset usage.
* Remove the reassignment of max_bazel_version.
This was flagged by skylint, the reality is _is_at_most() does the parsing
so it shouldn't be parsed before sent on the way.
* Fix up the skylint warning about depset usage.
* Fixup the skylint warning about re-exports.
Just move to the explicit re-export form.
* Fix the fail() call to use the right variable.
skylint flagged this variable as undefined, but it it seems like this
was never right and should have been "key" all along.
* Fixup docstring formatting for skylint.
This version is hash-based (implemented on top of a dictionary) and doesn't suffer the performance problems of the current version. It will eventually replace the old one after a deprecation period.