From 65ee12380e284c1ca8a3a1921c2682876896a87c Mon Sep 17 00:00:00 2001 From: Sandy Zhang Date: Wed, 1 May 2024 11:41:02 -0700 Subject: [PATCH] Add system_python to protobuf_deps.bzl. These are needed to get python headers for Python C++ and Python UPB from local system python PiperOrigin-RevId: 629786458 --- WORKSPACE | 7 ------- protobuf_deps.bzl | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 63785c3f4b..0e620deda3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -164,13 +164,6 @@ http_archive( patch_cmds = ["find google -type f -name BUILD.bazel -delete"], ) -load("//python/dist:system_python.bzl", "system_python") - -system_python( - name = "system_python", - minimum_python_version = "3.7", -) - load("@system_python//:pip.bzl", "pip_parse") pip_parse( diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 558540cc7f..2b4d8c69b5 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -2,6 +2,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("//python/dist:python_downloads.bzl", "python_nuget_package", "python_source_archive") +load("//python/dist:system_python.bzl", "system_python") PROTOBUF_MAVEN_ARTIFACTS = [ "com.google.caliper:caliper:1.0-beta-3", @@ -102,6 +103,12 @@ def protobuf_deps(): url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz", ) + if not native.existing_rule("system_python"): + system_python( + name = "system_python", + minimum_python_version = "3.7", + ) + if not native.existing_rule("rules_jvm_external"): _github_archive( name = "rules_jvm_external",