Skip to content

Releases: aherrmann/rules_zig

v0.6.0

02 Nov 12:25
ae9a098
Compare
Choose a tag to compare

Using Bzlmod with Bazel >=6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_zig", version = "0.6.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 = "rules_zig",
    sha256 = "793ff4c3df5c4c96cf574007bd3e374978b8f589ce7f9425e1951453acb172c5",
    strip_prefix = "rules_zig-0.6.0",
    url = "https://github.com/aherrmann/rules_zig/releases/download/v0.6.0/rules_zig-0.6.0.tar.gz",
)

###################
# rules_zig setup #
###################
# Fetches the rules_zig dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@rules_zig//zig:repositories.bzl", "rules_zig_dependencies", "zig_register_toolchains")

rules_zig_dependencies()

zig_register_toolchains(
    name = "zig",
    zig_versions = [
        "0.13.0",
        "0.12.1",
        "0.12.0",
        "0.11.0",
    ],
)

Highlights

  • Minimum supported Bazel version raised to 7.1.0

What's Changed

  • chore(deps): update dependency rules_python to v0.34.0 by @renovate in #343
  • chore(deps): update dependency io_bazel_rules_go to v0.49.0 by @renovate in #344
  • chore(deps): update dependency cgrindel_bazel_starlib to v0.21.0 by @renovate in #345
  • chore: update Zig download URL by @github-actions in #347
  • chore(deps): update dependency bazel_gazelle to v0.38.0 by @renovate in #348
  • chore(deps): update dependency gazelle to v0.38.0 by @renovate in #349
  • chore(deps): update dependency aspect_bazel_lib to v2.7.9 by @renovate in #346
  • chore(deps): update io_buildbuddy_buildbuddy_toolchain digest to 287d604 by @renovate in #350
  • chore(deps): update dependency rules_python to v0.35.0 by @renovate in #352
  • chore(deps): update dependency buildifier_prebuilt to v7 by @renovate in #353
  • chore(deps): update dependency aspect_bazel_lib to v2.8.0 by @renovate in #351
  • chore(deps): update dependency rules_python to v0.35.0 by @renovate in #354
  • chore(deps): update dependency aspect_bazel_lib to v2.8.1 by @renovate in #355
  • chore(deps): update dependency rules_bazel_integration_test to v0.25.0 by @renovate in #356
  • chore(deps): update dependency rules_bazel_integration_test to v0.25.0 by @renovate in #357
  • chore(deps): update dependency buildifier_prebuilt to v7.3.1 by @renovate in #358
  • chore(deps): update dependency io_bazel_rules_go to v0.50.0 by @renovate in #359
  • chore(deps): update dependency io_bazel_rules_go to v0.50.1 by @renovate in #360
  • chore: update Zig HEAD version test by @aherrmann in #365
  • chore(deps): update dependency io_bazel_stardoc to v0.7.1 by @renovate in #363
  • chore(deps): update dependency rules_cc to v0.0.10 by @renovate in #361
  • chore(deps): update dependency stardoc to v0.7.1 by @renovate in #364
  • chore: configure BuildBuddy credentials by @aherrmann in #366
  • chore(deps): update dependency aspect_bazel_lib to v2.9.0 by @renovate in #362
  • chore: fix duplicated aspect_bazel_lib dependency by @aherrmann in #367
  • chore(deps): update dependency bazel_gazelle to v0.39.0 by @renovate in #368
  • chore(deps): update dependency gazelle to v0.39.0 by @renovate in #369
  • chore(deps): update dependency rules_python to v0.36.0 by @renovate in #370
  • chore(deps): update dependency rules_python to v0.36.0 by @renovate in #371
  • chore(deps): update dependency aspect_bazel_lib to v2.9.1 by @renovate in #372
  • chore(deps): update dependency bazel_gazelle to v0.39.1 by @renovate in #373
  • chore(deps): update dependency gazelle to v0.39.1 by @renovate in #374
  • chore: Bump minimal Bazel version to 7.1.0 by @aherrmann in #376
  • chore(deps): update dependency rules_cc to v0.0.13 by @renovate in #375
  • chore(deps): update dependency protobuf to v27.5 by @renovate in #377
  • chore(deps): update dependency protobuf to v28 by @renovate in #378
  • chore(deps): update dependency aspect_bazel_lib to v2.9.2 by @renovate in #379
  • chore(deps): update io_buildbuddy_buildbuddy_toolchain digest to 702567f by @renovate in #381
  • chore(deps): update dependency aspect_bazel_lib to v2.9.3 by @renovate in #383
  • chore: update Zig HEAD version test by @aherrmann in #385
  • chore(deps): update dependency protobuf to v28.3 by @renovate in #384
  • chore(deps): update dependency rules_bazel_integration_test to v0.26.0 by @renovate in #382
  • chore(deps): update dependency rules_python to v0.37.2 by @renovate in #380
  • chore: pass token secrets from release workflow by @aherrmann in #386

Full Changelog: v0.5.0...v0.6.0

v0.5.0

07 Jul 16:48
8aa2b00
Compare
Choose a tag to compare

Using Bzlmod with Bazel >=6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_zig", version = "0.5.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 = "rules_zig",
    sha256 = "481f3d191129fe9680f431865949536bb1dff20fc77f4a54d0a4bbe72823435f",
    strip_prefix = "rules_zig-0.5.0",
    url = "https://github.com/aherrmann/rules_zig/releases/download/v0.5.0/rules_zig-0.5.0.tar.gz",
)

###################
# rules_zig setup #
###################
# Fetches the rules_zig dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@rules_zig//zig:repositories.bzl", "rules_zig_dependencies", "zig_register_toolchains")

rules_zig_dependencies()

zig_register_toolchains(
    name = "zig",
    zig_versions = [
        "0.13.0",
        "0.12.1",
        "0.12.0",
        "0.11.0",
    ],
)

Highlights

  • Adds support for Zig 0.12.1 and 0.13.0.
  • Adds support for arbitrary Zig version downloads, see example in tests.

What's Changed

  • chore(deps): update dependency bazel_skylib to v1.6.0 by @renovate in #279
  • chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.6.0 by @renovate in #280
  • chore(deps): update dependency bazel_skylib to v1.6.1 by @renovate in #281
  • chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.6.1 by @renovate in #282
  • chore(deps): update dependency platforms to v0.0.10 by @renovate in #283
  • chore: create devcontainer.json by @aherrmann in #284
  • chore: don't hard-code platforms and versions by @aherrmann in #278
  • chore: update the BCR presubmit configuration by @aherrmann in #286
  • chore!: remove the deprecated zig_package rule by @aherrmann in #287
  • refactor: Track Zig versions in JSON file by @aherrmann in #288
  • chore(deps): update dependency aspect_bazel_lib to v2.7.2 by @renovate in #289
  • chore!: drop Bazel 6 support by @aherrmann in #291
  • feat: support user defined version index (incl. pre-release) by @aherrmann in #290
  • chore: update .bazelrc configuratio by @aherrmann in #292
  • chore: enable Bazel version 8 pre-release by @aherrmann in #293
  • chore(deps): update dependency io_bazel_rules_go to v0.47.1 by @renovate in #294
  • chore(deps): update dependency aspect_bazel_lib to v2.7.3 by @renovate in #295
  • fix: load shared libraries from runfiles by @aherrmann in #297
  • chore!: pin the default glibc version to 2.17 by @aherrmann in #299
  • chore!: enable remote execution on CI for Linux by @aherrmann in #296
  • chore(deps): update io_buildbuddy_buildbuddy_toolchain digest to dfb7aad by @renovate in #301
  • chore(deps): update dependency rules_python to v0.32.0 by @renovate in #302
  • chore(deps): update dependency rules_python to v0.32.0 by @renovate in #304
  • chore(deps): update dependency rules_python to v0.32.1 by @renovate in #305
  • chore: enable remote execution in integration tests by @aherrmann in #303
  • chore(deps): update dependency rules_python to v0.32.2 by @renovate in #306
  • chore(deps): update dependency rules_python to v0.32.2 by @renovate in #307
  • chore(deps): update io_buildbuddy_buildbuddy_toolchain digest to dfb7aad by @renovate in #308
  • chore(deps): update dependency io_bazel_rules_go to v0.48.0 by @renovate in #310
  • chore(deps): update dependency bazel to v8.0.0-pre.20240516.1 by @renovate in #309
  • chore(deps): update dependency gazelle to v0.37.0 by @renovate in #313
  • chore(deps): update dependency aspect_bazel_lib to v2.7.6 by @renovate in #311
  • chore(deps): update dependency bazel_gazelle to v0.37.0 by @renovate in #312
  • chore(deps): update dependency aspect_bazel_lib to v2.7.7 by @renovate in #314
  • chore(deps): update dependency bazel_skylib to v1.7.0 by @renovate in #315
  • chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.7.0 by @renovate in #316
  • chore(deps): update dependency bazel_skylib to v1.7.0 by @renovate in #317
  • chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.7.0 by @renovate in #318
  • chore(deps): update dependency bazel to v8.0.0-pre.20240523.3 by @renovate in #319
  • chore(deps): update dependency bazel_skylib to v1.7.1 by @renovate in #320
  • chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.7.1 by @renovate in #321
  • chore(deps): update dependency bazel to v8.0.0-pre.20240530.1 by @renovate in #322
  • chore(deps): update dependency rules_python to v0.33.0 by @renovate in #323
  • chore(deps): update dependency rules_python to v0.33.0 by @renovate in #324
  • chore(deps): update dependency rules_python to v0.33.1 by @renovate in #325
  • chore(deps): update dependency rules_python to v0.33.1 by @renovate in #326
  • chore(deps): update dependency bazel to v8.0.0-pre.20240603.2 by @renovate in #327
  • chore(deps): update dependency rules_python to v0.33.2 by @renovate in #329
  • chore(deps): update dependency rules_python to v0.33.2 by @renovate in #330
  • chore(deps): update dependency io_bazel_rules_go to v0.48.1 by @renovate in #331
  • chore(deps): update dependency io_bazel_stardoc to v0.7.0 by @renovate in #332
  • chore(deps): update dependency stardoc to v0.7.0 by @renovate in #333
  • chore(deps): update dependency bazel to v8.0.0-pre.20240607.2 by @renovate in #334
  • chore(deps): update dependency rules_bazel_integration_test to v0.24.1 by @renovate in #336
  • chore(deps): update dependency rules_bazel_integration_test to v0.24.1 by @renovate in #337
  • chore(deps): update dependency aspect_bazel_lib to v2.7.8 by @renovate in #335
  • chore(deps): update dependency rules_python to v0.34.0 by @renovate in #338
  • chore: refactor CI workflow by @aherrmann in #339
  • chore: fix generated files update test by @aherrmann in #341
  • chore: update Zig versions up to 0.13.0 by @github-actions in #340

Full Changelog: v0.4.0...v0.5.0

v0.4.0

23 Apr 21:18
80de8b6
Compare
Choose a tag to compare

Using Bzlmod with Bazel >=6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_zig", version = "0.4.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 = "rules_zig",
    sha256 = "b4e95afef292b8fe00cd2a4272176e1cb466138dc7ab370a4ed752c653420b25",
    strip_prefix = "rules_zig-0.4.0",
    url = "https://github.com/aherrmann/rules_zig/releases/download/v0.4.0/rules_zig-0.4.0.tar.gz",
)

###################
# rules_zig setup #
###################
# Fetches the rules_zig dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@rules_zig//zig:repositories.bzl", "rules_zig_dependencies", "zig_register_toolchains")

rules_zig_dependencies()

zig_register_toolchains(
    name = "zig",
    zig_versions = [
        "0.12.0",
        "0.11.0",
    ],
)

Highlights

  • Support for Zig SDK versions 0.12.0 and 0.11.0.
  • Support for builds involving multiple Zig SDK versions via transition on the --@zig_toolchains//:version flag.

Breaking Changes

  • The zig module extension no longer accepts a name attr.

What's Changed

  • chore: refactor ZigModuleInfo by @aherrmann in #233
  • chore(deps): update dependency rules_multirun to v0.7.0 by @renovate in #235
  • [chore] track Zig SDK version by @aherrmann in #236
  • chore(deps): update dependency aspect_bazel_lib to v2.4.2 by @renovate in #234
  • chore(deps): update dependency aspect_bazel_lib to v2.5.0 by @renovate in #237
  • chore(deps): update dependency rules_multirun to v0.8.1 by @renovate in #238
  • chore(deps): update dependency aspect_bazel_lib to v2.5.1 by @renovate in #239
  • chore(deps): update softprops/action-gh-release action to v2 by @renovate in #241
  • chore(deps): update dependency bazel to v7.1.0 by @renovate in #242
  • chore(deps): update dependency aspect_bazel_lib to v2.5.3 by @renovate in #240
  • chore(deps): update dependency platforms to v0.0.9 by @renovate in #244
  • chore(deps): update dependency bazel to v7.1.1 by @renovate in #243
  • chore(deps): update dependency rules_multirun to v0.9.0 by @renovate in #245
  • chore: use json.encode instead of struct method. by @aherrmann in #246
  • chore(deps): update dependency cgrindel_bazel_starlib to v0.20.2 by @renovate in #247
  • chore(deps): update dependency aspect_bazel_lib to v2.6.0 by @renovate in #248
  • chore(deps): update dependency aspect_bazel_lib to v2.6.1 by @renovate in #249
  • chore(deps): update dependency gazelle to v0.36.0 by @renovate in #251
  • chore(deps): update dependency bazel_gazelle to v0.36.0 by @renovate in #250
  • chore(deps): update dependency aspect_bazel_lib to v2.7.0 by @renovate in #252
  • feat: external and persisted Zig cache by @aherrmann in #253
  • docs: generate stardocs for module extensions by @aherrmann in #256
  • feat!: support multiple Zig SDK versions by @aherrmann in #258
  • feat: support Zig version transion by @aherrmann in #260
  • feat: sort specified Zig SDK versions by semantic version by @aherrmann in #261
  • feat: implicit default Zig SDK version by @aherrmann in #262
  • feat: root module can specify default Zig version by @aherrmann in #263
  • docs: update zig module extension documentation by @aherrmann in #264
  • chore: trigger CI on base branch change by @aherrmann in #265
  • test: Zig version tests use version build flag by @aherrmann in #266
  • feat: generate config settings for version ranges by @aherrmann in #268
  • chore(deps): update dependency aspect_bazel_lib to v2.7.1 by @renovate in #269
  • test: add unit tests for zig module extension by @aherrmann in #270
  • chore(deps): update dependency io_bazel_rules_go to v0.47.0 by @renovate in #272
  • feat: support Zig versions 0.11.0 and 0.12.0 by @github-actions in #271
  • fix: dynamic linking on MacOS with Zig 0.12.0 by @aherrmann in #275
  • test: re-enable Zig docs generation for Zig 0.12.0 on MaCOS by @aherrmann in #276

Full Changelog: v0.3.0...v0.4.0

v0.3.0

17 Feb 21:35
6068fea
Compare
Choose a tag to compare

Using Bzlmod with Bazel >=6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_zig", version = "0.3.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 = "rules_zig",
    sha256 = "74edce4778a885eeea159c11c335ed412a913c24b9d701e590a42c34aa48b3c8",
    strip_prefix = "rules_zig-0.3.0",
    url = "https://github.com/aherrmann/rules_zig/releases/download/v0.3.0/rules_zig-0.3.0.tar.gz",
)

###################
# rules_zig setup #
###################
# Fetches the rules_zig dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@rules_zig//zig:repositories.bzl", "rules_zig_dependencies", "zig_register_toolchains")

rules_zig_dependencies()

zig_register_toolchains(
    name = "zig",
    zig_version = "0.11.0",
)

What's Changed

  • chore(deps): update dependency io_bazel_rules_go to v0.44.2 by @renovate in #186
  • chore(deps): update dependency rules_bazel_integration_test to v0.21.0 by @renovate in #188
  • chore(deps): update dependency rules_bazel_integration_test to v0.21.0 by @renovate in #189
  • chore(deps): update dependency rules_python to v0.28.0 by @renovate in #190
  • chore(deps): update dependency rules_python to v0.28.0 by @renovate in #191
  • chore(deps): update dependency aspect_bazel_lib to v2.2.0 by @renovate in #187
  • chore(deps): update dependency aspect_bazel_lib to v2.3.0 by @renovate in #192
  • chore(deps): update dependency io_bazel_rules_go to v0.45.0 by @renovate in #193
  • chore(deps): update dependency rules_bazel_integration_test to v0.22.0 by @renovate in #194
  • chore(deps): update actions/cache action to v4 by @renovate in #195
  • chore(deps): update dependency bazel to v7.0.1 by @renovate in #196
  • chore(deps): update dependency io_bazel_rules_go to v0.45.1 by @renovate in #197
  • chore(deps): update dependency rules_bazel_integration_test to v0.23.0 by @renovate in #198
  • chore(deps): update dependency rules_bazel_integration_test to v0.23.0 by @renovate in #199
  • chore(deps): update dependency rules_python to v0.29.0 by @renovate in #200
  • chore(deps): update dependency rules_python to v0.29.0 by @renovate in #201
  • chore(deps): update dependency bazel to v7.0.2 by @renovate in #202
  • chore(deps): update andstor/file-existence-action action to v3 by @renovate in #203
  • feat: add env and env_inherit attributes by @aherrmann in #204
  • chore: reproducible update_deleted_packages by @aherrmann in #205
  • feat: minimal runfiles library (no manifest, no repo-mapping) by @aherrmann in #206
  • feat: implement runfiles repo-mapping (only from main repo so far) by @aherrmann in #208
  • chore(deps): update dependency rules_zig to v0.2.0 by @renovate in #209
  • feat: support source relative repo mapping by @aherrmann in #210
  • feat: implicit bazel_builtin package dependency by @aherrmann in #211
  • feat: remove zig_runfiles in favor of bazel_builtin by @aherrmann in #212
  • chore(deps): update dependency aspect_bazel_lib to v2.4.1 by @renovate in #213
  • feat: support manifest based runfiles lookup by @aherrmann in #214
  • feat: non-allocating variant of rlocation by @aherrmann in #215
  • chore(deps): update dependency io_bazel_rules_go to v0.46.0 by @renovate in #216
  • feat: expose runfiles environment variables by @aherrmann in #217
  • feat: validate rlocation path by @aherrmann in #218
  • chore: explicit error unions by @aherrmann in #219
  • chore(deps): update dependency rules_python by @renovate in #220
  • chore(deps): update dependency rules_python to v0.31.0 by @renovate in #222
  • feat: support zig documentation generation by @aherrmann in #223
  • fix: resolve zig-autodoc-guide correctly by @aherrmann in #224
  • docs: runfiles library user guide by @aherrmann in #225
  • feat: use libc without cc-toolchain by @aherrmann in #226
  • feat: introduce Runfiles.withSourceRepo by @aherrmann in #227
  • chore: rename zig_package to zig_module by @aherrmann in #228
  • chore: BCR presubmit - set Bazel versions by @aherrmann in #229

Full Changelog: v0.2.0...v0.3.0

v0.2.0

02 Jan 13:29
Compare
Choose a tag to compare

Using Bzlmod with Bazel >=6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_zig", version = "0.2.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 = "rules_zig",
    sha256 = "df01689593b39960cf67a9ca964e986b76e5d16b7548c45f84f0b5ad221050a7",
    strip_prefix = "rules_zig-0.2.0",
    url = "https://github.com/aherrmann/rules_zig/releases/download/v0.2.0/rules_zig-0.2.0.tar.gz",
)

###################
# rules_zig setup #
###################
# Fetches the rules_zig dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@rules_zig//zig:repositories.bzl", "rules_zig_dependencies", "zig_register_toolchains")

rules_zig_dependencies()

zig_register_toolchains(
    name = "zig",
    zig_version = "0.11.0",
)

What's Changed

  • chore(deps): update dependency rules_python to v0.27.1 by @renovate in #145
  • chore(deps): update dependency rules_python to v0.27.1 by @renovate in #147
  • chore(deps): update dependency aspect_bazel_lib to v2.0.2 by @renovate in #149
  • chore(deps): update dependency aspect_bazel_lib to v2.0.3 by @renovate in #150
  • chore(deps): update dependency aspect_bazel_lib to v2.0.3 by @renovate in #151
  • fix: Zig update - don't require requests by @aherrmann in #152
  • chore(deps): update dependency buildifier_prebuilt to v6.4.0 by @renovate in #153
  • chore(deps): update dependency buildifier_prebuilt to v6.4.0 by @renovate in #154
  • chore(deps): update dependency cgrindel_bazel_starlib to v0.19.0 by @renovate in #155
  • chore(deps): update dependency io_bazel_rules_go to v0.44.0 by @renovate in #156
  • chore(deps): update dependency bazel_gazelle to v0.35.0 by @renovate in #157
  • chore(deps): update dependency gazelle to v0.35.0 by @renovate in #158
  • chore(deps): update dependency aspect_bazel_lib to v2.1.0 by @renovate in #159
  • chore(deps): update dependency aspect_bazel_lib to v2.1.0 by @renovate in #160
  • feat: Support linking against static libraries by @aherrmann in #163
  • test: static library linking behavior by @aherrmann in #166
  • feat: Support C header imports by @aherrmann in #167
  • feat: Enable libc/libc++ linking to expose system headers by @aherrmann in #168
  • feat: Support ABI selection and transition by @aherrmann in #169
  • chore(deps): update dependency io_bazel_rules_go to v0.44.1 by @renovate in #170
  • fix: correctly forward defines on cc_library cdeps by @aherrmann in #171
  • fix: construct isystem arguments correctly by @aherrmann in #175
  • chore: Update to Bazel version 7.0.0 by @aherrmann in #177
  • feat: Support custom dynamic linker by @aherrmann in #176
  • feat: Support linking against shared libraries by @aherrmann in #165
  • fix: collect cdeps data dependencies by @aherrmann in #183
  • feat: support location and make variable expansion by @aherrmann in #184
  • chore(deps): update dependency aspect_bazel_lib to v2.1.0 by @renovate in #185

Full Changelog: v0.1.0...v0.2.0

v0.1.0

02 Dec 12:28
fddf118
Compare
Choose a tag to compare

Using Bzlmod with Bazel >=6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_zig", version = "0.1.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 = "rules_zig",
    sha256 = "6ccc0cf61ae1a1f3e61aa2c2721309692f6b8cd8e18206e8c0dcd6423dfd101d",
    strip_prefix = "rules_zig-0.1.0",
    url = "https://github.com/aherrmann/rules_zig/releases/download/v0.1.0/rules_zig-0.1.0.tar.gz",
)

###################
# rules_zig setup #
###################
# Fetches the rules_zig dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@rules_zig//zig:repositories.bzl", "rules_zig_dependencies", "zig_register_toolchains")

rules_zig_dependencies()

zig_register_toolchains(
    name = "zig",
    zig_version = "0.11.0",
)

What's Changed

  • feat: download and register Zig release 0.10.1 for Linux by @aherrmann in #3
  • feat: zig_binary rule for single Zig source file binary by @aherrmann in #5
  • feat: support multiple Zig sources in zig_binary rule by @aherrmann in #7
  • feat: add zig_package rule and support Zig packages deps in zig_binary rule by @aherrmann in #10
  • feat: add deps attribute to zig_package rule by @aherrmann in #12
  • feat: add zig_library rule by @aherrmann in #17
  • feat: add zig_test rule by @aherrmann in #20
  • chore: apply updates from bazel-contrib/rules-template by @aherrmann in #22
  • chore: apply pre-commit fixes to all files by @aherrmann in #24
  • test: define bazel-in-bazel integration tests by @aherrmann in #25
  • refactor: deduplicate the list of supported Bazel versions for integration tests by @aherrmann in #28
  • ci: test that generated files are up-to-date by @aherrmann in #29
  • test: add integration tests for the zig_test rule by @aherrmann in #30
  • feat: download and register Zig release 0.10.1 for MacOS (amd64) by @aherrmann in #31
  • feat: support Zig build modes by @aherrmann in #35
  • ci: optimize the CI configuration by @aherrmann in #36
  • feat: add the zig_configure* rule family to support transitioning on the Zig build mode by @aherrmann in #41
  • ci: disable MacOS CI (temporarily) by @aherrmann in #42
  • feat: add a build setting to control target binary threaded-ness by @aherrmann in #45
  • feat: add a linker_script attribute to the Zig build rules by @aherrmann in #47
  • feat: support cross-compilation via Bazel's platforms & toolchains by @aherrmann in #50
  • feat: support target platform transitions in the zig_configure* rule family by @aherrmann in #53
  • docs: fill in the README with a minimal description by @aherrmann in #60
  • chore: fill in the LICENSE template by @aherrmann in #61
  • docs: expand the API documentation by @aherrmann in #62
  • docs: add a motivation section to the README by @aherrmann in #67
  • chore: configure release automation by @aherrmann in #68
  • chore: cherry-pick bazel-contrib/rules-template updates by @aherrmann in #69
  • feat: add bzlmod support by @aherrmann in #73
  • fix: update filename in release prep script by @aherrmann in #74
  • feat: add support for MacOS by @aherrmann in #75
  • fix: avoid output_base path in build outputs by @aherrmann in #78
  • feat: support C source files in Zig rules by @aherrmann in #91
  • fix: root source file in progress message by @aherrmann in #92
  • feat: extra_srcs attribute to support @embedFile by @aherrmann in #94
  • feat: support the x86_32-linux target platform by @aherrmann in #95
  • feat: support the ppc-linux target platform by @aherrmann in #96
  • chore: factor out common rule implementation by @aherrmann in #97
  • feat: add data attributes to Zig rules by @aherrmann in #98
  • feat: support cross-compilation to Windows by @aherrmann in #99
  • feat: add the zig_shared_library rule to generate shared objects or dynamic libraries by @Titousensei in #103
  • feat: support more Zig SDK versions by @aherrmann in #106
  • chore: automatically update Zig versions by @aherrmann in #107
  • chore: update Zig versions to 0.11.0 by @github-actions in #108
  • fix: typos in reproducibility tests by @aherrmann in #109
  • chore(deps): update rules_multirun digest to f37bc7a by @renovate in #110
  • chore(deps): update dependency platforms to v0.0.8 by @renovate in #111
  • chore: extend renovate bot configuration by @aherrmann in #113
  • chore: rules_multirun tagged release 0.6.1 by @aherrmann in #114
  • chore(deps): update dependency rules_multirun to v0.6.1 by @renovate in #116
  • chore(deps): update dependency aspect_bazel_lib to v1.39.0 by @renovate in #117
  • chore(deps): update dependency bazel_gazelle to v0.34.0 by @renovate in #119
  • chore: update rules_bazel_integration_testing 0.18.0 by @aherrmann in #115
  • chore: GitHub action to join all tests by @aherrmann in #121
  • chore(deps): update dependency bazel to v6.4.0 by @renovate in #118
  • chore(deps): update dependency bazel_skylib to v1.5.0 by @renovate in #122
  • chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.5.0 by @renovate in #123
  • chore: drop Bazel version 5.x by @aherrmann in #125
  • chore(deps): update dependency cgrindel_bazel_starlib to v0.18.1 by @renovate in #127
  • chore: configure remote cache by @aherrmann in #124
  • chore(deps): update dependency buildifier_prebuilt to v6.3.3 by @renovate in #126
  • chore(deps): update dependency gazelle to v0.34.0 by @renovate in #128
  • chore(deps): update dependency io_bazel_rules_go to v0.43.0 by @renovate in #129
  • fix: formatting by @aherrmann in #135
  • chore(deps): update dependency rules_python to v0.27.0 by @renovate in #132
  • chore(deps): update dependency rules_bazel_integration_test to v0.20.0 by @renovate in #131
  • chore(deps): update actions/checkout action to v4 by @renovate in #133
  • chore(deps): update dependency aspect_bazel_lib to v2 by @renovate in #134
  • chore(deps): update dependency io_bazel_stardoc to v0.6.2 by @renovate in #130
  • chore: enable bzlmod by default by @aherrmann in #136
  • chore: factor out common Bazel config and use in e2e by @aherrmann in #137
  • fix: malformed .bazelrc import by @aherrmann in #138
  • chore: update Bazel versions 7.0.0rc4 by @aherrmann in #120
  • fix: generate static archives with a lib prefix by @aherrmann in #141
  • docs: Install instructions and status in README by @aherrmann in #142
  • chore: configure release automation by @aherrmann in #143
  • chore: fix release wo...
Read more