From 88e7e47ed20ca7b2f9509dfe09089b812d7d94eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 21 Nov 2022 06:08:22 +0200 Subject: [PATCH] zig_include_root: fixes - do not pass where it's unnecessary - remove trailing slash. That conflicts with ziglang/zig/pull/13596 --- toolchain/BUILD.sdk.bazel | 1 - toolchain/defs.bzl | 12 ++++++------ toolchain/private/cc_toolchains.bzl | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/toolchain/BUILD.sdk.bazel b/toolchain/BUILD.sdk.bazel index 56d245a..3bd6655 100644 --- a/toolchain/BUILD.sdk.bazel +++ b/toolchain/BUILD.sdk.bazel @@ -18,5 +18,4 @@ exports_files([ declare_cc_toolchains( os = {os}, zig_sdk_path = {zig_sdk_path}, - zig_include_root = {zig_include_root}, ) diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl index 8e380fc..d481f18 100644 --- a/toolchain/defs.bzl +++ b/toolchain/defs.bzl @@ -75,11 +75,11 @@ def toolchains( host_platform_sha256 = host_platform_sha256, host_platform_ext = host_platform_ext, host_platform_include_root = { - "linux-aarch64": "lib/zig/", - "linux-x86_64": "lib/", - "macos-aarch64": "lib/", - "macos-x86_64": "lib/zig/", - "windows-x86_64": "lib/", + "linux-aarch64": "lib/zig", + "linux-x86_64": "lib", + "macos-aarch64": "lib", + "macos-x86_64": "lib/zig", + "windows-x86_64": "lib", }, ) @@ -330,6 +330,6 @@ def declare_files(os, zig_include_root): for target_config in target_structs(): for d in _DEFAULT_INCLUDE_DIRECTORIES + target_config.includes: - d = zig_include_root + d + d = zig_include_root + ("\\" if os == "windows" else "/") + d if d not in lazy_filegroups: lazy_filegroups[d] = filegroup(name = d, srcs = native.glob([d + "/**"])) diff --git a/toolchain/private/cc_toolchains.bzl b/toolchain/private/cc_toolchains.bzl index 7de5017..fa5ec82 100644 --- a/toolchain/private/cc_toolchains.bzl +++ b/toolchain/private/cc_toolchains.bzl @@ -11,7 +11,7 @@ DEFAULT_TOOL_PATHS = { "strip": "/usr/bin/false", }.items() -def declare_cc_toolchains(os, zig_sdk_path, zig_include_root): +def declare_cc_toolchains(os, zig_sdk_path): for target_config in target_structs(): gotarget = target_config.gotarget zigtarget = target_config.zigtarget