Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module(

bazel_dep(name = "aspect_bazel_lib", version = "2.14.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "platforms", version = "0.0.11")

zig = use_extension("//zig:extensions.bzl", "zig")
Expand Down Expand Up @@ -42,13 +43,12 @@ buildbuddy = use_extension(
)
use_repo(buildbuddy, "buildbuddy_toolchain")

bazel_dep(name = "rules_cc", version = "0.1.1", dev_dependency = True)
bazel_dep(name = "stardoc", version = "0.8.0", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "gazelle", version = "0.42.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.7.1", dev_dependency = True)
bazel_dep(
name = "buildifier_prebuilt",
version = "8.0.1",
version = "8.0.3",
dev_dependency = True,
)
bazel_dep(name = "rules_multirun", version = "0.11.0", dev_dependency = True)
Expand Down
1 change: 1 addition & 0 deletions e2e/workspace/runfiles-library/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ zig_test(

build_test(
name = "runfiles-docs-build-test",
tags = ["zig-docs"],
targets = ["@rules_zig//zig/runfiles:docs"],
)

Expand Down
6 changes: 3 additions & 3 deletions internal_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def rules_zig_internal_deps():

http_archive(
name = "buildifier_prebuilt",
sha256 = "5dbf72e4f93917edfb91f53958d6289736adb845b2b89dbfb9bfc199a492030c",
strip_prefix = "buildifier-prebuilt-8.0.1",
sha256 = "bf9101bd5d657046674167986a18d44c5612e417194dc55aff8ca174344de031",
strip_prefix = "buildifier-prebuilt-8.0.3",
urls = [
"http://github.com/keith/buildifier-prebuilt/archive/8.0.1.tar.gz",
"http://github.com/keith/buildifier-prebuilt/archive/8.0.3.tar.gz",
],
)

Expand Down
18 changes: 12 additions & 6 deletions zig/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ bzl_library(
name = "cc_linkopts",
srcs = ["cc_linkopts.bzl"],
visibility = ["//zig:__subpackages__"],
deps = [
"@rules_cc//cc/common",
],
)

bzl_library(
name = "zig_toolchain_header",
srcs = ["zig_toolchain_header.bzl"],
visibility = ["//zig:__subpackages__"],
deps = [
"@rules_cc//cc/common",
],
)

bzl_library(
Expand All @@ -129,12 +141,6 @@ bzl_library(
visibility = ["//zig:__subpackages__"],
)

bzl_library(
name = "zig_toolchain_header",
srcs = ["zig_toolchain_header.bzl"],
visibility = ["//zig:__subpackages__"],
)

# Execute `bazel run //util:update_filegroups` to update this target.
filegroup(
name = "all_files",
Expand Down
3 changes: 3 additions & 0 deletions zig/private/cc_linkopts.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Implementation of the cc_linkopts rule."""

load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")

DOC = """\
Configure C linker flags for targets that depend on this rule.

Expand Down
2 changes: 2 additions & 0 deletions zig/private/common/cdeps.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Handle C library dependencies."""

load("@bazel_skylib//lib:paths.bzl", "paths")
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")

def zig_cdeps(*, cdeps, solib_parents, os, direct_inputs, transitive_inputs, args, data):
"""Handle C library dependencies.
Expand Down
2 changes: 2 additions & 0 deletions zig/private/common/zig_build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ load(
"find_cpp_toolchain",
"use_cpp_toolchain",
)
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load(
"//zig/private/common:bazel_builtin.bzl",
"bazel_builtin_module",
Expand Down
1 change: 1 addition & 0 deletions zig/private/zig_configure.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Implementation of the zig_configure rule."""

load("@bazel_skylib//lib:paths.bzl", "paths")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load("//zig/private:settings.bzl", "MODE_VALUES", "THREADED_VALUES")

DOC = """\
Expand Down
3 changes: 3 additions & 0 deletions zig/private/zig_toolchain_header.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""Implementation of the zig_toolchain_header rule."""

load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")

DOC = """\
Expose the Zig header file `zig.h` required by generated C headers.

Expand Down
7 changes: 7 additions & 0 deletions zig/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ def _http_archive(name, **kwargs):
def rules_zig_dependencies():
"""Register dependencies required by rules_zig."""

_http_archive(
name = "rules_cc",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.1.1/rules_cc-0.1.1.tar.gz"],
sha256 = "712d77868b3152dd618c4d64faaddefcc5965f90f5de6e6dd1d5ddcd0be82d42",
strip_prefix = "rules_cc-0.1.1",
)

_http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
Expand Down
1 change: 1 addition & 0 deletions zig/tests/rules_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ See https://bazel.build/rules/testing#testing-rules

load("@bazel_skylib//lib:sets.bzl", "sets")
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load(
":util.bzl",
"assert_find_unique_surrounded_arguments",
Expand Down
1 change: 1 addition & 0 deletions zig/tests/target_platform_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
load("@bazel_skylib//lib:partial.bzl", "partial")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts", "unittest")
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load("//zig/private/providers:zig_target_info.bzl", "ZigTargetInfo")
load(
":util.bzl",
Expand Down
1 change: 1 addition & 0 deletions zig/tests/toolchain_header_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ load(
"asserts",
"unittest",
)
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load("//zig/private:zig_toolchain_header.bzl", "max_int_alignment")
load(":util.bzl", "canonical_label")

Expand Down