Commit Graph

197 Commits

Author SHA1 Message Date
Alex Eagle df3c9e2735
diff_test: add ability for caller to specify a message printed on fai… (#307)
Useful for the use case of a pair of .test and .update targets for checked-in golden files
2021-08-18 11:23:43 -04:00
Philipp Wollermann 0c57e74606
Remove `$` from grep regexes (#311)
Due to grep having dropped support for handling line-ending matches in a cross-platform way, grepping for `...$` will now fail on Windows, as it no longer ignores the CR part of the CRLF line endings on Windows.

This should turn this project green again on Bazel CI.
2021-08-09 11:15:50 -04:00
dmaclach b053a5ae11
Update partial.bzl to generate better markdown (#309) 2021-07-26 15:26:28 -04:00
dmaclach 775f66fb28
Update partial_doc.md (#308)
Clean up the docs to make them look significantly better.

No semantics changes, just styling.
2021-07-14 21:55:10 -04:00
aiuto fd75066f15
update links to bazel docs (#306) 2021-06-16 13:00:06 -04:00
Alexandre Rostovtsev c6f6b5425b
Fix default branch name in README (#292)
See https://github.com/bazelbuild/bazel-skylib/branches and
https://github.com/bazelbuild/bazel-skylib/issues/281.
2021-05-13 10:22:43 -04:00
Alexandre Rostovtsev 7b859037a6
to_json/to_proto methods on structs are deprecated and will be removed (#295) 2021-05-03 12:27:40 -04:00
c-parsons 398f312289
lint warning fix (#115) 2021-03-31 16:06:00 -04:00
Olek Wojnar 82c1d0fa3e
Add shebang lines to tests directory shell scripts (#288) 2021-03-31 15:46:21 -04:00
Christopher Sauer b3ce9e70e5
Add write_file and copy_file docs to README (#291) 2021-03-31 15:34:15 -04:00
aiuto f80bc733d4
update owners (#289) 2021-01-29 13:38:17 -05:00
alandonovan e19d391ac9
Explain criteria for contributing (#286)
* Explain criteria for contributing

* Update README.md

* Update README.md
2020-12-17 17:20:24 -05:00
David Sanderson ed7f03cde6
Enable unittest.suite to accept partial calls of test rules (#276)
* Enable unittest.suite to accept partial calls of rules

This permits using `unittest.suite` with test rules that have nondefault
attributes, while retaining compatibility with current usage.

For instance, this permits setting a `timeout` on each test in a
`unittest.suite`.  Previously, all tests in a `unittest.suite` would
have the default timeout, with no good way to alter this.  This
made it hard to eliminate all the warnings produced from using the
`--test_verbose_timeout_warnings` bazel option.

While timeouts were the motivation, the solution here is not specific
to timeouts. It will permit arbitrary additional arguments to the test
rules in a `unittest.suite`.

Fixes #98

* Respond to review feedback.

* Document a breaking change in bazel that this code needs to be aware of.
2020-11-12 21:04:39 -05:00
Andrew Z Allen 182046f090
Handle "internal" directory visibility (#274)
Both "internal" and "private" directories should be treated the same way
and have visibility restrictions be placed upon them.
2020-10-21 23:52:14 -06:00
Andrew Z Allen b2ffc94b17
Gazelle now handles imports from `@bazel_tools` (#273)
`@bazel_tools` is tricky since it is effectively a part of the standard
library that can not have a `bzl_library` attached to it. As a simple
fix for this, `bzl_library` can have a srcs dependency on it so that it
includes the transitive closure of all of its dependencies.

`@bazel_tools` imports are rewritten into the `srcs` attribute since
they are `exports_files`ed from the @bazel_tools.

Co-authored-by: c-parsons <cparsons@google.com>
2020-10-19 12:49:17 -04:00
River a81c2c0efe
Regenerate new_sets.bzl docs. (#280)
Lists are not supported. The code comments were fixed to match this in 2d620ba1f8, but the docs were never updated.
2020-10-15 14:20:00 -04:00
Laurent Le Brun 528e424134
Remove laurentlb from CODEOWNERS (#279) 2020-09-25 22:55:01 +02:00
David Sanderson 56ec790c9b
Address latent buildifier issues. (#278)
In https://buildkite.com/bazel/bazel-skylib/builds/1240#annotation-buildifier
I noticed buildifier issues unrelated to my PR.
This PR attempts to address these latent buildifier issues.
2020-09-25 22:32:06 +02:00
Andrew Z Allen 2a89db4749
Fix CODEOWNERS (#275)
Previously permissions were granted to edit any file that existed in a directory
titled `gazelle`. Now grants have been given recursively.
2020-09-15 19:53:03 -04:00
Samuel Giddins 836f1b2f56
Add support for gazelle handling relative imports (#271) 2020-09-07 15:29:39 -06:00
aiuto 2ec2e6d715
update release notes for 1.0.3 (#270) 2020-08-27 10:01:44 -04:00
Ivo List bc97abb33e
Move bzl ext (#265)
* Move Gazelle extension to //gazelle/bzl and change package name

This fixes an issue with importing bazel-skylib into
google3. Currently, Glaze (internal Go build file generator) attempts
to generate a target (//gazelle:gazelle) that conflicts with one
that's already declared here.

I think the right solution is actually to move the package into a
subdirectory. In the future (bazelbuild/bazel-gazelle#5), Gazelle's Go
extension will generate target names similar to what Glaze does, so
the same conflict will happen in open source. I think it's also
logical to have a directory of packages in case more need to be added
in the future, and for the extension to have a package name matching
the language it works with.

This is an incompatible change, but the //gazelle directory isn't part
of a tagged release yet, so hopefully it won't break anyone.

* fix runfiles access in test

* Fix gazelle package names.

Co-authored-by: Jay Conrod <jayconrod@google.com>
2020-08-20 13:14:55 -04:00
c-parsons 68acaa5d6a
Improve inspect_output_dirs_test bin_dir comparison (#267)
This should fix some buildkite CI flows, ensuring success of
this test is no longer tied to the current compilation_mode.
It also improves the error message of the offending evaluation.
2020-08-20 13:06:59 -04:00
Ivo List dc080e9516
Prettify failure message of asserts.set_equals. (#263)
Before, when comparing large sets, the message dumped the whole set. Now it additionally prints missing and unexpected elements.
2020-08-11 14:52:32 +02:00
Jonathan B Coe 16de038c48
Add missing bzl_library for analysis_test.bzl (#262) 2020-08-10 14:35:04 -04:00
Julie d62d6f52d5
rm last usage of --experimental_build_setting_api (#260)
* rm last usage of --experimental_build_setting_api

* Update bazel_federation to new version to get new stardoc
2020-07-31 12:39:19 -04:00
aiuto 07922b040c
Stop depending on rules_pkg through the federation. (#259)
- while the federation code is in flux, this will mean less churn for skylib
- rules_pkg is only needed by developers for making a distribution, so this won't impact users.
- when we develop a new federation model, we can re-depend the right way.
2020-07-24 12:26:13 +02:00
Bocete 2a44ef8ec8
Add `new_sets` as a dep of `sets` bzl_library (#253)
Without this change, evaluating bzl with strict dependencies results in an error.

[`load(":new_sets.bzl", _sets = "sets")`](560d7b2359/lib/sets.bzl (L17)) results in `No such file or directory: 'third_party/bazel_skylib/lib/new_sets.bzl`
2020-07-22 08:51:32 +08:00
Yannic 8f3151fb4a
copy_file: Add parameter to allow symlinks (#252)
* copy_file: Add parameter to allow symlinks

This change adds a new parameter `allow_symlinks` to `copy_file` that
allows the action to create a symlink instead of doing an expensive
copy if the execution platform (host) allows it.

Updates #248

* Update docs

* Refactor `is_executable` into attribute

* Fix typo

* s/_impl/_copy_file_impl/
2020-07-10 14:08:02 -04:00
Andrew Z Allen d35e8d7bc6
Create Gazelle language for Starlark (#251) 2020-06-26 17:04:12 +02:00
Julie b10f2cb0fc
Remove --experimental_build_setting_api usage (#249)
* Remove --experimental_build_setting_api usage

Deprecating this flag so removing all usage.

* One more rm

* fix ,

* Revert  semantics flags change
2020-06-24 11:31:57 -04:00
Julie ec2170289f
Add myself to codeowners for rules (#256)
...so I can maintain the skylib build settings
2020-06-24 11:28:18 -04:00
Andrew Z Allen 3b666f525d
Address lint errors (#254) 2020-06-19 19:49:52 +02:00
Laurent Le Brun 560d7b2359
Add license and copyright notice (#245) 2020-04-15 12:57:49 +02:00
Robbert van Ginkel feb52960eb
Fix diff_test when filepath includes external (#241)
Resolves https://github.com/bazelbuild/bazel-skylib/issues/240.
2020-04-14 19:04:34 +02:00
Laurent Le Brun 9935e0f820
Depend on bzl_library, not on individual bzl files (#244) 2020-04-03 16:54:55 +02:00
Laurent Le Brun 2d0c651291 Update visibility of files (#243)
Stardoc needs access to a file (with exports_files) in order to
generate its documentation.
2020-04-02 22:20:57 +02:00
Greg dfcfe82500
Fix type parsing errors on "always true" conditions. (#239)
Specifically:

selects.config_setting_group(
    name = "always_true",
    match_any = ["//conditions:default"],
)

and

selects.config_setting_group(
    name = "always_true",
    match_all = ["//conditions:default"],
)

These should, as expected, always evaluate to True.
Their implementation had a bug that failed the build outright.
2020-03-25 14:05:24 -04:00
Thomas Van Lenten 2d620ba1f8
Fix the comment to match the code. (#238)
Looking at the impl, it only accepts sets.
2020-03-19 12:40:56 -04:00
irengrig 6970e21d29
Create a helper rule for selecting a file from outputs of another rul… (#233)
* Create a helper rule for selecting a file from outputs of another rule or a filegroup by subpath

* Add tests

* Address code review comments

* + formatting

Co-authored-by: c-parsons <cparsons@google.com>
2020-02-27 13:29:45 -05:00
Thomas Van Lenten add8e42934
Run buildifier over the directory. (#235)
Using the 1.0 release.

```
buildifier -r .
```
2020-02-18 13:17:37 -05:00
Thomas Van Lenten 0a934a997d
Fix buildifier issue failing on CI. (#234)
```
buildifier -lint=fix distribution/BUILD
```
2020-02-18 13:00:50 -05:00
Bor Kae Hwang 2d4c9528e0
Add absolute path tests for Windows (#230) 2020-02-06 11:54:31 -05:00
Laurent Le Brun 1c5ed0706a
Migrate code for the flag --incompatible_disable_depset_items (#232) 2020-02-03 16:45:44 +01:00
Laurent Le Brun e583e822a0
Remove old_sets.bzl (#231)
It has been deprecated for a while, the code is not really compatible with Bazel depset-related changes.
2020-02-03 16:39:21 +01:00
Laurent Le Brun 4b25373d12
Remove flag --incompatible_remap_main_repo (#227)
It's on by default since Bazel 2.0, and the flag is now going away.

https://github.com/bazelbuild/bazel/issues/7130
2020-01-16 10:34:47 +01:00
Marcel Hlopko 327d61b5ea Migrate for --incompatible_use_platforms_repo_for_constraints (#214) 2019-10-30 14:18:01 +01:00
c-parsons 9f63e1a8d4
make select_tests resilient to default configuration differences (#212) 2019-10-29 11:20:31 -04:00
Marc Plano-Lesay 930b3527b9 Remove links to maprules (#213)
This pair of rules was removed in 58068fe0cc, and the docs removed in 084758ff75 - the links were forgotten.
2019-10-29 08:42:47 -04:00
c-parsons 734652aa5e
Remove unnecesssary license BUILD comment (#209) 2019-10-28 12:20:43 -04:00