Skip to content

Releases: bazelbuild/bazel-skylib

1.2.0

11 Feb 17:21
c4dfec1
Compare
Choose a tag to compare

Release 1.2.0

Note: the 1.2.x releases of Skylib will be the last ones to support Bazel 4.2. Starting with release 1.3, Skylib will require Bazel 5 or newer.

New Features

  • The unittest toolchain has better support for special characters in failure messages (#320)
  • Use portable Bash shebangs for BSD compatibility (#329)
  • Add loadingtest - tests which evaluate during the loading phase (#347)
  • Add doc parameter to analysistest.make, allowing analysis tests to be documented in a Stardoc-friendly way (#343, #352)

Contributors

Alexandre Rostovtsev, Geoffrey Martin-Noble, Kevin Kress, Samuel Freilich,
UebelAndre, Yesudeep Mangalapilly

WORKSPACE setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "bazel_skylib",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
    ],
    sha256 = "af87959afe497dc8dfd4c6cb66e1279cb98ccc84284619ebfec27d9c09a903de",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

Using the rules

See the source.

1.1.1 (initially tagged as 1.1.0)

27 Sep 17:33
b2ed616
Compare
Choose a tag to compare

Release 1.1.1 (initially tagged as 1.1.0)

New Features

  • Gazelle: support relative imports (#271) and imports from @bazel_tools
    (#273)
  • Add partial.is_instance() (#276)
  • Allow unittest.suite() to accept partial calls of test rules (#276)
  • Allow specifying additional aspects to target under test in
    analysistest.make() (#299)
  • Add Windows support for build_test (#302)

Incompatible Changes

  • structs.to_dict() ignores deprecated to_json()/to_proto() methods (#295)

Contributors

aiuto, alandonovan, Alex Eagle, Alexandre Rostovtsev, Andrew Z Allen, c-parsons,
Christopher Sauer, Daniel Wagner-Hall, David Sanderson, dmaclach, Laurent Le
Brun, Mansur, Olek Wojnar, Philipp Wollermann, River, Samuel Giddins, Thaler
Benedek

WORKSPACE setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "bazel_skylib",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
    ],
    sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

Using the rules

See the source.

1.0.3

27 Aug 14:23
2ec2e6d
Compare
Choose a tag to compare

New Features

  • copy_file: Add parameter to allow symlinks (#252)
  • Create Gazelle language for Starlark (#251)
  • Create a helper rule (select_file) for selecting a file from outputs of another rule (#233)

Significant Changes

  • Move Gazelle extension to //gazelle/bzl and change package name
  • Stop depending on rules_pkg through the federation. (#259)

Incompatible Changes

  • Remove links to maprules (#213)
  • Remove old_sets.bzl (#231)
    It has been deprecated for a while, the code is not really compatible with Bazel depset-related changes.

Contributors
Andrew Z Allen, Bocete, Bor Kae Hwang, irengrig, Jay Conrod, Jonathan B Coe, Marc Plano-Lesay, Robbert van Ginkel, Thomas Van Lenten, Yannic, and the Bazel team.

WORKSPACE setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "bazel_skylib",
    urls = [
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
    ],
    sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

Using the rules

See the source.

1.0.2

09 Oct 17:59
e59b620
Compare
Choose a tag to compare

New Features

  • Added types.is_set() to test whether an arbitrary object is a set as defined by sets.bzl.

Incompatible Changes

  • @bazel_skylib//:lib.bzl is removed. You now must specify specific modules via @bazel_skylib//lib:.bzl.
  • maprule.bzl is removed.
    Added types.is_set() to test whether an arbitrary object is a set as defined by sets.bzl.

WORKSPACE setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "bazel_skylib",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
    ],
    sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

Using the rules

See the source.

1.0.1

09 Oct 03:45
cff8af4
Compare
Choose a tag to compare
1.0.1 Pre-release
Pre-release

New Features

Patch release to 1.0.0 to provide toolchain for unittest library.

WORKSPACE setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "bazel_skylib",
    url = "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.1/bazel-skylib-1.0.1.tar.gz",
    sha256 = "f1c8360c01fcf276778d3519394805dc2a71a64274a3a0908bc9edff7b5aebc8",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

Using the rules

See the source.

1.0.0

04 Oct 19:11
e5cf539
Compare
Choose a tag to compare
1.0.0 Pre-release
Pre-release

WARNING - unittests do not work. Wait for 1.0.1

Incompatible Changes

  • @bazel_skylib//:lib.bzl is removed. You now must specify specific modules
    via @bazel_skylib//lib:.bzl.
  • maprule.bzl is removed.

New Features

  • Added types.is_set() to test whether an arbitrary object is a set as defined by sets.bzl.

WORKSPACE setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "bazel_skylib",
    url = "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.0/bazel-skylib-1.0.0.tar.gz",
    sha256 = "e72747100a8b6002992cc0bf678f6279e71a3fd4a88cab3371ace6c73432be30",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

Using the rules

See the source.

0.9.0

12 Jul 19:27
2b38b2f
Compare
Choose a tag to compare

Incompatible Changes

  • Make sets.bzl point to new_sets.bzl instead of old_sets.bzl new_sets.bzl and
    old_sets.bzl should be removed in a following skylib release.

New Features

  • common_settings.bzl: Standard data types for user defined build
    configuration. Common scalar build settings for rules to use so they don't
    recreate them locally. This fulfills part of the SBC design doc:
    https://docs.google.com/document/d/1vc8v-kXjvgZOdQdnxPTaV0rrLxtP2XwnD2tAZlYJOqw/edit#bookmark=id.iiumwic0jphr

  • selects.bzl: 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.

  • run_binary: runs an executable as an action

    • This rule is an alternative for genrule(): it canrun a binary with the
      desired arguments, environment, inputs, and outputs, as a single build
      action, without shelling out to Bash.
    • Fixes #149
  • New native_binary() and native_test() rules let you wrap a pre-built
    binary in a binary and test rule respectively.

    • native_binary() wraps a pre-built binary or script in a *_binary rule
      interface. Rules like genrule can tool-depend on it, and it can be
      executed with "bazel run". This rule can also augment the binary with
      runfiles.
    • native_test() is similar, but creates a testable rule instead of a
      binary rule.
    • Fixes #148
  • diff_test: test rule compares two files and passes if the files match.

  • maprule: move functionality to maprule_util.bzl.
    maprule_util.bzl will benefit planned new rules (namely a genrule alternative).

This release is tested with Bazel 0.28

WORKSPACE setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

maybe(
    http_archive,
    name = "bazel_skylib",
    url = "https://github.com/bazelbuild/bazel-skylib/releases/download/0.9.0/bazel_skylib-0.9.0.tar.gz",
    sha256 = "1dde365491125a3db70731e25658dfdd3bc5dbdfd11b840b3e987ecf043c7ca0",
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

0.8.0

20 Mar 18:50
3721d32
Compare
Choose a tag to compare

New Features

  • “Analysis Test” testing framework under unittest.bzl. See documentation for details. Some new feature highlights:
    • Support for verifying rule-under-test failure conditions
    • Support for verifying actions registered by a rule-under-test
    • Support for verifying rule behavior under non-default bazel flags
  • analysis_test rule to verify that targets under test pass Bazel’s analysis phase. This is similar to the existing build_test rule, except that actions of the underlying targets are not executed. See documentation.
  • write_file rule to write UTF-8 encoded text files. (Works for bash platforms and Windows)
  • copy_file rule to copy a file to another location. (Works for bash platforms and Windows)
  • dicts.add() now accepts kwargs to add to the resulting dict.

This release is tested with Bazel 0.23

Thanks to the following external contributors:

Please use the bazel-skylib.0.8.0.tar.gz release asset from your Bazel WORKSPACE.

SHA-256 digest: 2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e

Complete list of changes

0.7.0

08 Feb 21:23
Compare
Choose a tag to compare

Incompatible Changes

  • Made an incompatible change to unittest.bzl requiring minor migration effort:
    Test implementation functions for this framework now must return the result of unittest.end(env) instead of simply invoking this method. That is:
    def _your_test(ctx):
        env = unittest.begin(ctx)
        # Assert statements go here
        unittest.end(env)
    
    must become:
    def _your_test(ctx):
        env = unittest.begin(ctx)
        # Assert statements go here
        return unittest.end(env)
    

New Features

  • Added Windows support for unittest.bzl.

  • Added maprule rules (cmd_maprule and bash_maprule under //rules/maprule.bzl for Windows and bash support, respectively)

  • Added a build_test rule (build_test under //rules/build_test.bzl) to create test targets that verify that other targets build. Note that this rule does not currently work on Windows (though support for Windows shall come at a later time).

0.6.0

26 Nov 23:08
Compare
Choose a tag to compare
  • Renamed several instances of "Skylark". The old label and symbol names remain as aliases to these new locations and names temporarily. The aliases will go away on a future release.
    //:skylark_library.bzl renamed to //:bzl_library.bzl
    skylark_library renamed to bzl_library
    SkylarkLibraryInfo renamed to StarlarkLibraryInfo

  • //:lib.bzl has been deprecated. Depend directly on the bazel-skylib modules you need instead of depending on lib.bzl.

  • //:sets.bzl has been deprecated. Depend instead on //:new_sets.bzl, which was introduced in version 0.4.0 and has better performance than sets.bzl. sets.bzl will be removed in a future release.

  • Updated Starlark code to be compatible with Bazel version 0.19.2