Releases: tweag/rules_nixpkgs
Releases · tweag/rules_nixpkgs
v0.12.0
Using Bzlmod with Bazel 6
- Enable with
common --enable_bzlmod
in.bazelrc
. - Add to your
MODULE.bazel
file:
For the core module
bazel_dep(name = "rules_nixpkgs_core", version = "0.12.0")
For the nodejs module
bazel_dep(name = "rules_nixpkgs_nodejs", version = "0.12.0")
Using WORKSPACE
Paste this snippet into your WORKSPACE.bazel
file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "1adb04dc0416915fef427757f4272c4f7dacefeceeefc50f683aec7f7e9b787a",
strip_prefix = "rules_nixpkgs-0.12.0",
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.12.0/rules_nixpkgs-0.12.0.tar.gz"],
)
load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies")
rules_nixpkgs_dependencies()
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package", "nixpkgs_cc_configure")
load("@io_tweag_rules_nixpkgs//nixpkgs:toolchains/go.bzl", "nixpkgs_go_configure") # optional
0.12.0 - 2024-07-12
Added
- Make the C++ -std flag configurable. See #557.
- Add module extension for nodejs toolchain. See #505.
- Add bzlmod version of example to the guide. See #556.
Changed
Fixed
- Make
rules_nixpkgs_java
depend onremote_java_tools
properly. See #497. - Catch case in which find_children is called on an empty dir by @numine777 in #526
- Make
nixpkgs_java_configure
work with Bazel 7. See #499. - Fix
java_test
failure with JDK 17+. See #553. - Fix CPU detection on Darwin with Bazel 7. See #554.
- Fix cc toolchain on Darwin using nixpkgs >= 23.11. See #543.
v0.11.1
0.11.1 - 2024-03-29
Using Bzlmod with Bazel 6
- Enable with
common --enable_bzlmod
in.bazelrc
. - Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_nixpkgs_core", version = "0.11.1")
Using WORKSPACE
Paste this snippet into your WORKSPACE.bazel
file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "2a555348d7f8593fca2bf3fc6ce53c5d62929de81b6c292e23f16c557c0ae45a",
strip_prefix = "rules_nixpkgs-0.11.1",
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.11.1/rules_nixpkgs-0.11.1.tar.gz"],
)
load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies")
rules_nixpkgs_dependencies()
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package", "nixpkgs_cc_configure")
load("@io_tweag_rules_nixpkgs//nixpkgs:toolchains/go.bzl", "nixpkgs_go_configure") # optional
v0.11.0
0.11.0 - 2024-03-27
Added
- support for Go 1.21 and newer. See #417.
- support for
rules_go
0.42.0 and newer. See #422. nixpkgs_flake_package
now works even when the experimental featuresnix-command
andflakes
are disabled. See #465.sigtool
andcodesign
for thecc
toolchain on macOS. See #489.
Changed
nixpkgs_flake_package
now only copies the directory containing thenix_flake_file
, including any subdirectories, to the nix store.nixpkgs_flake_package
would previously copy the entire containing Git repository to the nix store ifnix_flake_file
was contained in a Git repository. This is achieved via nix'path:
syntax. This is a breaking change fornix_flake_file
s inside a subdirectory of a Git repository that references a path outside its subdirectory. See #450.
Fixed
- Build failure when using
-fsanitize=address
with thecc
toolchain. See #437. - The Go toolchain now disables the
GOEXPERIMENT
CoverageRedesign
following the example ofrules_go
and. See #440. - NixOS dynamic loader issue for Java tools like
ijar
andsinglejar
. See #451. nixpkgs_cc_configuren
with Bazel 7 was causing asyntax error at '%': expected expression
" because of a missingtemplate tsubstitution forconly_flags
. See #466.- Build failures with linker errors caused by a missing
-F${SystemConfiguration}/Library/Frameworks
cc
command line option. See #475. - Processes getting killed on macOS during linking caused by using some tools form
darwin.cctools
instead ofstdenv.cc
. See #479.
Removed
- Python 2 support has been removed. See #486.
v0.10.0
Using Bzlmod with Bazel 6
- Enable with
common --enable_bzlmod
in.bazelrc
. - Add to your
MODULE.bazel
file:
bazel_dep(name = "rules_nixpkgs_core", version = "0.10.0")
Using WORKSPACE
Paste this snippet into your WORKSPACE.bazel
file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "980edfceef2e59e1122d9be6c52413bc298435f0a3d452532b8a48d7562ffd67",
strip_prefix = "rules_nixpkgs-0.10.0",
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.10.0/rules_nixpkgs-0.10.0.tar.gz"],
)
load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies")
rules_nixpkgs_dependencies()
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package", "nixpkgs_cc_configure")
load("@io_tweag_rules_nixpkgs//nixpkgs:toolchains/go.bzl", "nixpkgs_go_configure") # optional
0.10.0 - 2023-10-18
Added
- nixpkgs_nodejs_configure to import a NodeJS toolchain. See #222.
- nixpkgs_nodejs_configure_platforms for platform transparent npm_install. See [#309].
- nixkpgs_python_configure generates an interpreter target. See #255.
- nixpkgs_go_configure gained an attribute_path attribute. See #288.
- nixpkgs_cc_configure gained the ability to configure CXX_FLAGS. See #298.
- nixpkgs_local_repository now accepts a flake.lock file to generate a nixpkgs repository. See #338.
- nixpkgs_python_repository can import Nix provided Python packages, e.g. through poetry. See #343.
- nixpkgs_http_repository can download a nixpkgs repository over HTTP. See #356.
- nixpkgs_flake_package can add a Nix package from a flake. See #380.
- rules_nixpkgs gained the ability to copy generated Nix store paths to a remote store for remote execution support. See #404.
- rules_nixpkgs_core gained bzlmod module extensions nix_repo and nix_pkg to import nixpkgs repositories and packages in MODULE.bazel files directly. See #423.
Changed
- nixpkgs_cc_configure now supports cross compilation toolchains. See #241 and #401.
- rules_nixpkgs_dependencies takes a toolchains parameter to specify which rules_nixpkgs components to imoprt. See #257
- nixpkgs_cc_configure now works without an explicit nix_file or nix_file_content attribute. See #334.
- nixpkgs_python_configure now exposes the requirements.json file. See #407.
Fixed
- A performance issue with nixpkgs_package on MacOS due to slow file copies was resolved. See #256.
- A performance issue with nixpkgs_package due to repeated rule restarts was resolved. See #263.
- Compatibility issues with Bazel 6 for nixpkgs_configure_java were resolved. See #273.
- C++ build errors on MacOS due to -Welaborated-enum-base were fixed. See #382.
- Hard to read error reporting was improved. See #389.
- The http_archive type attribute is now forwarded to rules_nixpkgs component imports. See #411.
- Configuration issues when cross-compiling from Linux to MacOS were fixed. See #413.
Breaking changes
- rules_nixpkgs_go: Custom derivations passed to
nixpkgs_go_configure
(vianix-file
,nix-file-content
orattribute_path
) must now contain aversion
attribute. See #385.
What's Changed
- Use stat to retain file permissions when copying files by @lamcw in #259
- Misc doc improvements for default BUILD file for nixpkgs_package by @googleson78 in #260
- Add an interpreter target to python toolchain by @benradf in #261
- Avoid restarting nixpkgs_package by @lamcw in #263
- Update bzlmod dependencies and enhance separation of components by @avdv in #257
- Convert to flake by @avdv in #265
- flake.lock: Update by @github-actions in #266
- Add nodejs toolchain by @betaboon in #222
- flake.lock: Update by @github-actions in #267
- Bump nix version for testing to 2.7 by @tshaynik in #270
- flake.lock: Update by @github-actions in #274
- Skip writing to the remote cache without API key by @avdv in #276
- Bump actions/checkout from 3.0.2 to 3.1.0 by @dependabot in #268
- Skip writing to the remote cache with no API key - no. 2 by @avdv in #277
- Bump cachix/install-nix-action from 17 to 18 by @dependabot in #271
- Replace Buildkite CI badge with Github badge by @avdv in #279
- Add NodeJS docs to top-level readme by @aherrmann in #283
- Bump DeterminateSystems/update-flake-lock from 14 to 15 by @dependabot in #284
- examples: mkShell -> mkShellNoCC by @evertedsphere in #286
- readme: load http_archive explicitly by @evertedsphere in #287
- toolchains/go: allow specifying go package by attribute_path by @evertedsphere in #288
- flake.lock: Update by @github-actions in #275
- flake.lock: Update by @github-actions in #290
- Bump actions/checkout from 3.1.0 to 3.2.0 by @dependabot in #293
- Configure bazelisk to use Bazel 5.x by @avdv in #297
- flake.lock: Update by @github-actions in #292
- cc: make CXX_FLAG configurable by @evertedsphere in #298
- Split the docs generation into a separate module by @z8v in #296
- Fix java toolchain config to allow for use with Bazel 6 by @tshaynik in #273
- flake.lock: Update by @github-actions in #300
- Bump actions/checkout from 3.2.0 to 3.3.0 by @dependabot in #302
- Fix Python container example by @aherrmann in #301
- Bump DeterminateSystems/update-flake-lock from 15 to 16 by @dependabot in #307
- Remove any docs references from core by @z8v in #304
- flake.lock: Update by @github-actions in #308
- Use OpenSSL in nix rust toolchain example by @benradf in #305
- Upgrade nixpkgs to nixos-22.11 by @avdv in #311
- Update platforms to 0.0.6 by @mrkkrp in #312
- Update the Rust toolchain example by @mrkkrp in #314
- Pass the workspace name as an attribute by @aherrmann in #315
- Update to Bazel version 6 and nixpkgs 22.11 by @aherrmann in #313
- Add example for nodejs toolchain with npm_install repository rule by @kczulko in #309
- Bump cachix/install-nix-action from 18 to 19 by @dependabot in #317
- Use libtool from nixpkgs by @uri-canva in #321
- Separate core tests and test with bzlmod enabled by @aherrmann in #319
- flake.lock: Update by @github-actions in #316
- Separate toolchains/java tests and run with bzlmod enabled by @aherrmann in #320
- Separate testing module and bzlmod tests for toolchains/posix by @aherrmann in #323
- Separate testing module and bzlmod tests for toolchains/cc by @aherrmann in https://gith...
Release 0.9.0
0.9.0 - 2022-07-18
Added
- Support registering a Java toolchain for Bazel 5
See #185 nixpkgs_cc_configure
gained a flag to disable automatic registration of the toolchain it creates.
See #179- Rust toolchain and example
See #178 - python-container example
See #226 - Allow to specify platform constraints in
nixpkgs_cc_configure
See #164 - add
fail_not_supported to
nixpkgs_go_configure`
See #167 - add exec/target constraints parameters to python toolchain macro
See #169 - Support codesigning on MacOs
See #224
Changed
-
Split into separate components in preparation for bzlmod
See #182 -
Detect whether compiler is Clang at nix eval time
See #216Note: If you have previously passed a custom
cc
toolchain tonixpkgs_cc_configure
you need to provide a booleanisClang
attribute now, e.g.:pkgs.buildEnv { name = "bazel-nixpkgs-cc"; paths = [ cumstom-cc ]; pathsToLink = [ "/bin" ]; passthru = { isClang = custom-cc.isClang; }; }
Fixed
- Avoid error when include dirs list is empty
See #234 - Ensure nixpkgs will work with Bazel build from source
See #231 - Fix call to
repository_ctx.file
usingnix_file_content
withnixpkgs_local_repository
See #210 - Fix python example build on macOS
See #189 nixpkgs_local_repository
strips executable bit of nix files
See #160
WORKSPACE setup
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "b01f170580f646ee3cde1ea4c117d00e561afaf3c59eda604cf09194a824ff10",
strip_prefix = "rules_nixpkgs-0.9.0",
urls = ["curl -L https://github.com/tweag/rules_nixpkgs/archive/refs/tags/v0.9.0.tar.gz"],
)
load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies")
rules_nixpkgs_dependencies()
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package")
Release 0.8.0
0.8.0 - 2021-02-11
Added
- Bazel Skylib is now included as a dependency on
rules_nixpkgs_dependencies
.
See #125. nixpkgs_python_configure
now exposes thequiet
attribute for the
underlyingnispkgs_package
.
See #131.- The default
BUILD
file ofnixpkgs_package
now finds more kinds of C/C++
header files in theinclude
target.
See #137.
Changed
- The implementation of
nixpkgs_cc_configure
has been replaced by a more
hermetic version that no longer uses Bazel's builtin autodection toolchain
under the hood. The previous behavior is now available under the name
nixpkgs_cc_configure_deprecated
, if required.
See #128. - The values in the
nixopts
attribute tonixpkgs_package
are now subject to
location expansion. Any instance of$(location LABEL)
in thenixopts
attribute will be expanded to the file path of the file referenced by
LABEL
. To pass a plain$
to Nix it must be escaped as$$
.
See #132.
Deprecated
- The old implementation of
nixpkgs_cc_configure
, now available under the
namenixpkgs_cc_configure_deprecated
, has been marked as deprecated in
favor ofnixpkgs_cc_configure
and will be replaced by it in future.
See #128.
Fixed
- Incorrect label contruction for Nix file dependencies.
See #124.
WORKSPACE setup
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "7aee35c95251c1751e765f7da09c3bb096d41e6d6dca3c72544781a5573be4aa",
strip_prefix = "rules_nixpkgs-0.8.0",
urls = ["https://github.com/tweag/rules_nixpkgs/archive/refs/tags/v0.8.0.tar.gz"],
)
load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies")
rules_nixpkgs_dependencies()
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package")
Release 0.7.0
Added
- Define
rules_nixpkgs_dependencies
in//nixpkgs:repositories.bzl
. - Define
nixpkgs_go_configure
in//nixpkgs:toolchains/go.bzl
nixpkgs_package
now has aquiet
attribute.
Changed
- The constraint value for targets to detect whether Nix is available
on the current platform is now called
@//nixpkgs/constraints:support_nix
. The associated constraint
setting is@//nixpkgs/constraints:nix
. The old constraint
@//nixpkgs/constraints:nixpkgs
constraint setting is still
available. But it is highly recommended to migrate to the new
constraint setting, and update platform definitions accordingly.
This is a breaking change for users ofnixpkgs_python_configure
. - Show Nix output by default, like in releases prior to v0.6.
Fixed
nixpkgs_local_repository
now correctly invalidates the cache when
Nix source files change. See
#123.
Release 0.6.0
0.6.0 - 2019-11-14
Added
- Check
nix_file_deps
and fail on undeclared dependencies (breaking change).
See #76 and #86. - Define a
nixpkgs
platform constraint. See #97. - Define
nixpkgs_python_configure
. See #97. - Define
nixpkgs_sh_posix_configure
to generaterules_sh
POSIX
toolchain. See #95.
Changed
- Hide Nix output, following Bazel best practices for a quiet build.
- Disable implicit
nixpkgs
configuration loading (breaking change).
See #83.
Fixed
- Improve distributed caching by not leaking user specific Bazel cache
directory, see #67.
WORKSPACE setup
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "f5af641e16fcff5b24f1a9ba5d93cab5ad26500271df59ede344f1a56fc3b17d",
strip_prefix = "rules_nixpkgs-0.6.0",
urls = ["https://github.com/tweag/rules_nixpkgs/archive/v0.6.0.tar.gz"],
)
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_git_repository", "nixpkgs_package")
v0.5.2
Releasing rules_nixpkgs 0.5.2