[llvm] [bazel] Use copy_file rule for zlib-ng (PR #152752)

Keith Smiley via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 09:17:57 PDT 2025


https://github.com/keith created https://github.com/llvm/llvm-project/pull/152752

This avoids cp usage for potential windows / PATH-less builds


>From e4a3c51bced7f6aeab63d689ffc91fa4c5c8dc4f Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Fri, 8 Aug 2025 15:44:57 +0000
Subject: [PATCH] [bazel] Use copy_file rule for zlib-ng

This avoids cp usage for potential windows / PATH-less builds
---
 utils/bazel/third_party_build/zlib-ng.BUILD | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/utils/bazel/third_party_build/zlib-ng.BUILD b/utils/bazel/third_party_build/zlib-ng.BUILD
index 055261acb0f69..2a107208a4817 100644
--- a/utils/bazel/third_party_build/zlib-ng.BUILD
+++ b/utils/bazel/third_party_build/zlib-ng.BUILD
@@ -2,7 +2,7 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
-load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
 
 package(
     default_visibility = ["//visibility:public"],
@@ -20,12 +20,12 @@ config_setting(
     flag_values = {":llvm_enable_zlib": "true"},
 )
 
-genrule(
+copy_file(
     # The input template is identical to the CMake output.
     name = "zconf_gen",
-    srcs = ["zconf.h.in"],
-    outs = ["zconf.h"],
-    cmd = "cp $(SRCS) $(OUTS)",
+    src = "zconf.h.in",
+    out = "zconf.h",
+    allow_symlink = True,
 )
 
 cc_library(



More information about the llvm-commits mailing list