Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Bump python -> 3.11.1 #25359

Merged
merged 5 commits into from
May 16, 2023
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: 4 additions & 0 deletions api/tools/generate_listeners_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
"""Tests for generate_listeners."""

import os
import sys

# Workaround for https://github.com/bazelbuild/rules_python/issues/1221
sys.path += [os.path.dirname(__file__)]
phlax marked this conversation as resolved.
Show resolved Hide resolved

import generate_listeners

Expand Down
3 changes: 3 additions & 0 deletions api/tools/tap2pcap_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import subprocess as sp
import sys

# Workaround for https://github.com/bazelbuild/rules_python/issues/1221
sys.path += [os.path.dirname(__file__)]

import tap2pcap

# Validate that the tapped trace when run through tap2cap | tshark matches
Expand Down
2 changes: 1 addition & 1 deletion bazel/python_dependencies.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_python//python:pip.bzl", "pip_parse")
load("@python3_10//:defs.bzl", "interpreter")
load("@python3_11//:defs.bzl", "interpreter")

def envoy_python_dependencies():
pip_parse(
Expand Down
8 changes: 6 additions & 2 deletions bazel/repositories_extra.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ load("@proxy_wasm_cpp_host//bazel/cargo/wasmtime:crates.bzl", "wasmtime_fetch_re
load("//bazel/external/cargo:crates.bzl", "raze_fetch_remote_crates")
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")

def _python_minor_version(python_version):
return "_".join(python_version.split(".")[:-1])

# Python version for `rules_python`
PYTHON_VERSION = "3.10.9"
PYTHON_VERSION = "3.11.1"
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(
Expand All @@ -17,7 +21,7 @@ def envoy_dependencies_extra(

# Registers underscored Python minor version - eg `python3_10`
python_register_toolchains(
name = "python%s" % ("_".join(python_version.split(".")[:-1])),
name = "python%s" % _python_minor_version(python_version),
python_version = python_version,
ignore_root_user_error = ignore_root_user_error,
)
Expand Down
2 changes: 2 additions & 0 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_name = "Fuzzing Rules for Bazel",
project_desc = "Bazel rules for fuzz tests",
project_url = "https://github.com/bazelbuild/rules_fuzzing",
# Patch contains workaround for https://github.com/bazelbuild/rules_python/issues/1221
version = "0.3.2",
sha256 = "f85dc70bb9672af0e350686461fe6fdd0d61e10e75645f9e44fedf549b21e369",
strip_prefix = "rules_fuzzing-{version}",
Expand Down Expand Up @@ -1026,6 +1027,7 @@ REPOSITORY_LOCATIONS_SPEC = dict(
project_desc = "Google’s open source high-performance JavaScript and WebAssembly engine, written in C++",
project_url = "https://v8.dev",
# NOTE: Update together with com_googlesource_chromium_base_trace_event_common.
# Patch contains workaround for https://github.com/bazelbuild/rules_python/issues/1221
version = "10.7.193.13",
# Static snapshot created using https://storage.googleapis.com/envoyproxy-wee8/wee8-fetch-deps.sh.
sha256 = "2170df76ce5d7ecd7fb8d131370d210152f200273cba126f06d8b88fb53c9fbc",
Expand Down
18 changes: 17 additions & 1 deletion bazel/rules_fuzzing.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,20 @@ index e5e9dc4..a3bb1b8 100644
+ tar -czhf "{output}" -C "$STAGING_DIR" .
""".format(
base_name = ctx.attr.base_name,
binary_path = binary_info.binary_file.path,
binary_path = binary_info.binary_file.path,
diff --git a/fuzzing/tools/validate_dict.py b/fuzzing/tools/validate_dict.py
index d561e68..24e3adc 100644
--- a/fuzzing/tools/validate_dict.py
+++ b/fuzzing/tools/validate_dict.py
@@ -19,6 +19,11 @@ Validates and merges a set of fuzzing dictionary files into a single output.

from absl import app
from absl import flags
+
+import os
+import sys
+sys.path += [os.path.dirname(__file__)]
+
from dict_validation import validate_line
from sys import stderr

13 changes: 13 additions & 0 deletions bazel/v8.patch
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,16 @@ index ce3f569fd5..dc8a4c4f6a 100644
} // extern "C"
+
+#endif
diff --git a/third_party/inspector_protocol/code_generator.py b/third_party/inspector_protocol/code_generator.py
index c3768b8..d4a1dda 100644
--- a/third_party/inspector_protocol/code_generator.py
+++ b/third_party/inspector_protocol/code_generator.py
@@ -16,6 +16,8 @@ try:
except ImportError:
import simplejson as json

+sys.path += [os.path.dirname(__file__)]
+
import pdl

try:
3 changes: 2 additions & 1 deletion tools/gsutil/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("//bazel:envoy_build_system.bzl", "envoy_package")
load("//bazel:repositories_extra.bzl", "PYTHON_MINOR_VERSION")
load("@base_pip3//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary", "py_library")

Expand All @@ -11,7 +12,7 @@ envoy_package()
# TODO(phlax): figure a way to keep this updated (eg requirements.txt)
py_library(
name = "crcmod",
data = ["crcmod/_crcfunext.cpython-310-x86_64-linux-gnu.so"],
data = ["crcmod/_crcfunext.cpython-%s-x86_64-linux-gnu.so" % PYTHON_MINOR_VERSION.replace("_", "")],
)

py_binary(
Expand Down
Binary file not shown.
Binary file not shown.
11 changes: 6 additions & 5 deletions tools/gsutil/vendor_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fi
ARCH=x86_64
HOST_UID="$(id -u)"
HOST_GID="$(id -g)"
PYTHON_VERSION=3.11

docker run --rm \
-v "$PWD/tools/gsutil/crcmod:/output" \
Expand All @@ -24,10 +25,10 @@ docker run --rm \
&& apt-get -qq install -y ca-certificates software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get -qq update -y \
&& apt-get -qq install -y build-essential curl python3.10 python3.10-dev \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 \
&& apt-get -qq install -y build-essential curl python${PYTHON_VERSION} python${PYTHON_VERSION}-dev \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 \
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
&& update-alternatives --install /usr/bin/${ARCH}-linux-gnu-gcc ${ARCH}-linux-gnu-gcc /usr/bin/${ARCH}-linux-gnu-gcc-9 1 \
&& pip install crcmod \
&& chown -R ${HOST_UID}:${HOST_GID} /usr/local/lib/python3.10/dist-packages/crcmod/ \
&& cp -a /usr/local/lib/python3.10/dist-packages/crcmod/*.so /output/"
&& chown -R ${HOST_UID}:${HOST_GID} /usr/local/lib/python${PYTHON_VERSION}/dist-packages/crcmod/ \
&& cp -a /usr/local/lib/python${PYTHON_VERSION}/dist-packages/crcmod/*.so /output/"