Commit Graph

271 Commits

Author SHA1 Message Date
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
aiuto e59b620b39
Fix execute bit on empty_test.sh (#206)
* make the tarball 555

* Split the bins out from the rest of the package and combine the
packages.

This solution is horrible. The better solution is
- We need something like pkgfilegroup in rules_pkg, so we can specify
  exectuable mode next to the file.
- But we do not want rules_pkg to appear in the rules/BUILD file
  because that would make a runtime dependency.

So we need to
- rewrite rules/BUILD when going into the package.
- or provide magic mapping of files names to mode bits
- or something entirely different.
2019-10-09 12:43:21 -04:00
c-parsons cff8af42e9
Remove genfiles_dir retrieval method (#203)
genfiles_dir has been the same as bin_dir for several Bazel releases, and is
being fully removed in upcoming Bazel release.
2019-10-08 15:46:35 -04:00
aiuto 47c6eb15c6
Fix to 1.0.1 - add missing .bzl files (#201) 2019-10-08 15:05:48 -04:00
Samuel Freilich 376680d276 Expose target_under_test's bin and genfiles path (#202)
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.
2019-10-08 12:39:11 -04:00
aiuto 0e9da0dd08
fix distribution so that we get the right dependencies load (#200) 2019-10-07 17:48:55 -04:00
aiuto e5cf5398cd
Update version and changelog in prep for 1.0.0 release (#196)
* -Update changelog to get ready for release 1.0
-Change README to point to releases page for WORKSPACE setup. Otherwise
 the readme shipped in the archive can never be in sync with the readme
 that has the correct sha256.

* update incompatible changes

* -Update changelog to get ready for release 1.0
-Change README to point to releases page for WORKSPACE setup. Otherwise
 the readme shipped in the archive can never be in sync with the readme
 that has the correct sha256.

* fix wording of changelog

* remove false file
2019-10-04 14:55:59 -04:00
Samuel Freilich f1475299af Avoid some repetition in _make_analysis_test (#197) 2019-10-04 11:19:43 -04:00
Gabe Giosia 720f59405d Pass `fragments` through to analysis tests rule constructors. (#190)
Passing fragments through to the rule allows rules to access language specific features.
2019-10-02 14:14:17 -04:00
aiuto d8387f7bd0
load rules thorugh maybe so we can simultaneous updates (#195)
* load rules thorugh maybe so we can simultaneous updates

* buildify

* Add keyword to |maybe| calls to pacify buildifier's new strictness.
2019-10-02 11:15:53 -04:00
TechSY730 3154dbbc41 Add types.is_set() to test whether an arbitrary object is a set as defined by new_sets.bzl. (#181)
* 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.
2019-09-17 10:21:44 -04:00
László Csomor 58068fe0cc
Delete maprule. Fix Buildifier lint errors. (#192)
* Delete maprule. Fix Buildifier lint errors.

Delete maprule and its tests: I wrote this rule,
and I no longer plan to release it. Alternative
rules exist that serve users' needs better.

Fix also Buildifier lint errors that were making
BuildKite red: https://buildkite.com/bazel/bazel-skylib/builds/659#ab98ac31-6e1c-415e-b8a8-5f8868340c7d
2019-09-17 14:03:22 +02:00
easy 90ea6feaf3 Update "Getting Started" instructions to 0.9.0 release. (#172) 2019-08-23 15:08:42 -04:00
Greg 3f7b196d2a Update selects documentation. (#170) 2019-08-23 14:52:24 -04:00
aiuto ab87410a8b
Use rules_pkg to make the skylib tarball for a release. (#185)
* 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
2019-08-23 14:37:16 -04:00
aiuto c5bd012f31 add aiuto as code owner. direct changes to distribution/ to them (#187) 2019-08-23 11:57:39 -04:00
c-parsons 6214b31619 Scope buildkite badge to the master branch (#186) 2019-08-22 07:50:41 -04:00
c-parsons 143c602a13
Add jin to codeowners (#175) 2019-08-21 15:24:42 -04:00
Florian Weikert f130d7c388 Comply with the standards of the Bazel federation (#182)
* Comply with the standards of the Bazel federation

This commit allows bazel_skylib to be a member of the Bazel federation, since it adds the required bzl files related to setup and dependencies.
Moreover, it also changes the WORKSPACE to fetch all dependencies through the federation.

* Add copyright and docstring to bzl files
2019-08-13 21:28:45 +02:00
Thomas Van Lenten d2cf1cc2bc
`print`->`fail` and suppress the warning in another case. (#177) 2019-07-22 13:25:00 -04:00
kwasimensah a6c72f2b39 Make config_setting_group visibility aware (#168) 2019-07-16 11:45:12 -04:00
aiuto 2b38b2f8bd
fix formatting problem (#169) 2019-07-12 14:55:22 -04:00
Julie 10851c2c5b Give BuildSettingInfo's value field a description (#167) 2019-07-03 14:42:40 -04:00
Julie 21ee269a55 Create new stardoc target for common_settings.bzl (#166) 2019-07-03 12:46:14 -04:00
aiuto c102f5d414 Get docs working again. (#165)
- 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.
2019-07-02 12:35:55 -04:00
Julie b113ed5d05 Create common build settings (#154)
Create common simple build settings for people to use so they don't recreate these rules over and over again. 

This fulfills part of the SBC design doc: https://docs.google.com/document/d/1vc8v-kXjvgZOdQdnxPTaV0rrLxtP2XwnD2tAZlYJOqw/edit#bookmark=id.iiumwic0jphr
2019-06-14 15:22:54 -04:00
Greg 6a6a509f36 selects.bzl: Add config_setting_group for config_setting AND/OR-chaining (#89)
* Add config_setting_group for config_setting AND/OR-chaining

Implements https://github.com/bazelbuild/proposals/blob/master/designs/2018-11-09-config-setting-chaining.md.

* buildifier lint fixes

* Add tests

* Add test stub for both match_any and match_all

* Simplify the implementation and make it more correct. :)

* Fix styling issues
2019-06-05 17:39:51 -04:00