depot/pkgs/by-name/en/envoy/0001-nixpkgs-use-system-Python.patch
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

85 lines
3.3 KiB
Diff

From 47406ebaf0260e5b66a92baac3717936c8386b69 Mon Sep 17 00:00:00 2001
From: Paul Meyer <49727155+katexochen@users.noreply.github.com>
Date: Mon, 22 Apr 2024 11:52:59 +0200
Subject: [PATCH] nixpkgs: use system Python
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
---
bazel/python_dependencies.bzl | 11 ++++-------
bazel/repositories_extra.bzl | 17 +----------------
2 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/bazel/python_dependencies.bzl b/bazel/python_dependencies.bzl
index 9f2b336b1a..53a2c93c59 100644
--- a/bazel/python_dependencies.bzl
+++ b/bazel/python_dependencies.bzl
@@ -1,28 +1,25 @@
load("@com_google_protobuf//bazel:system_python.bzl", "system_python")
-load("@envoy_toolshed//:packages.bzl", "load_packages")
-load("@python3_12//:defs.bzl", "interpreter")
load("@rules_python//python:pip.bzl", "pip_parse")
def envoy_python_dependencies():
- # TODO(phlax): rename base_pip3 -> pip3 and remove this
- load_packages()
+ pip_parse(
+ name = "pip3",
+ requirements_lock = "@envoy_toolshed//:requirements.txt",
+ )
pip_parse(
name = "base_pip3",
- python_interpreter_target = interpreter,
requirements_lock = "@envoy//tools/base:requirements.txt",
extra_pip_args = ["--require-hashes"],
)
pip_parse(
name = "dev_pip3",
- python_interpreter_target = interpreter,
requirements_lock = "@envoy//tools/dev:requirements.txt",
extra_pip_args = ["--require-hashes"],
)
pip_parse(
name = "fuzzing_pip3",
- python_interpreter_target = interpreter,
requirements_lock = "@rules_fuzzing//fuzzing:requirements.txt",
extra_pip_args = ["--require-hashes"],
)
diff --git a/bazel/repositories_extra.bzl b/bazel/repositories_extra.bzl
index b92dd461ba..cef32b3140 100644
--- a/bazel/repositories_extra.bzl
+++ b/bazel/repositories_extra.bzl
@@ -2,19 +2,11 @@ load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
load("@bazel_features//:deps.bzl", "bazel_features_deps")
load("@emsdk//:deps.bzl", emsdk_deps = "deps")
load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime/remote:crates.bzl", "crate_repositories")
-load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
+load("@rules_python//python:repositories.bzl", "py_repositories")
load("//bazel/external/cargo:crates.bzl", "raze_fetch_remote_crates")
-def _python_minor_version(python_version):
- return "_".join(python_version.split(".")[:-1])
-
-# Python version for `rules_python`
-PYTHON_VERSION = "3.12.3"
-PYTHON_MINOR_VERSION = _python_minor_version(PYTHON_VERSION)
-
# Envoy deps that rely on a first stage of dependency loading in envoy_dependencies().
def envoy_dependencies_extra(
- python_version = PYTHON_VERSION,
ignore_root_user_error = False):
bazel_features_deps()
emsdk_deps()
@@ -22,11 +14,4 @@ def envoy_dependencies_extra(
crate_repositories()
py_repositories()
- # Registers underscored Python minor version - eg `python3_10`
- python_register_toolchains(
- name = "python%s" % _python_minor_version(python_version),
- python_version = python_version,
- ignore_root_user_error = ignore_root_user_error,
- )
-
aspect_bazel_lib_dependencies()