diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml
index 3b9dee71..ac1a4b09 100755
--- a/.azure-pipelines/azure-pipelines-linux.yml
+++ b/.azure-pipelines/azure-pipelines-linux.yml
@@ -8,16 +8,28 @@ jobs:
vmImage: ubuntu-latest
strategy:
matrix:
- linux_64_:
- CONFIG: linux_64_
+ linux_64_libgrpc1.54libprotobuf3.21:
+ CONFIG: linux_64_libgrpc1.54libprotobuf3.21
UPLOAD_PACKAGES: 'True'
DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64
- linux_aarch64_:
- CONFIG: linux_aarch64_
+ linux_64_libgrpc1.55libprotobuf4.23.2:
+ CONFIG: linux_64_libgrpc1.55libprotobuf4.23.2
UPLOAD_PACKAGES: 'True'
DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64
- linux_ppc64le_:
- CONFIG: linux_ppc64le_
+ linux_aarch64_libgrpc1.54libprotobuf3.21:
+ CONFIG: linux_aarch64_libgrpc1.54libprotobuf3.21
+ UPLOAD_PACKAGES: 'True'
+ DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64
+ linux_aarch64_libgrpc1.55libprotobuf4.23.2:
+ CONFIG: linux_aarch64_libgrpc1.55libprotobuf4.23.2
+ UPLOAD_PACKAGES: 'True'
+ DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64
+ linux_ppc64le_libgrpc1.54libprotobuf3.21:
+ CONFIG: linux_ppc64le_libgrpc1.54libprotobuf3.21
+ UPLOAD_PACKAGES: 'True'
+ DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64
+ linux_ppc64le_libgrpc1.55libprotobuf4.23.2:
+ CONFIG: linux_ppc64le_libgrpc1.55libprotobuf4.23.2
UPLOAD_PACKAGES: 'True'
DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64
timeoutInMinutes: 360
diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml
index 8032e967..0e09e5da 100755
--- a/.azure-pipelines/azure-pipelines-osx.yml
+++ b/.azure-pipelines/azure-pipelines-osx.yml
@@ -8,11 +8,17 @@ jobs:
vmImage: macOS-11
strategy:
matrix:
- osx_64_:
- CONFIG: osx_64_
+ osx_64_libgrpc1.54libprotobuf3.21:
+ CONFIG: osx_64_libgrpc1.54libprotobuf3.21
UPLOAD_PACKAGES: 'True'
- osx_arm64_:
- CONFIG: osx_arm64_
+ osx_64_libgrpc1.55libprotobuf4.23.2:
+ CONFIG: osx_64_libgrpc1.55libprotobuf4.23.2
+ UPLOAD_PACKAGES: 'True'
+ osx_arm64_libgrpc1.54libprotobuf3.21:
+ CONFIG: osx_arm64_libgrpc1.54libprotobuf3.21
+ UPLOAD_PACKAGES: 'True'
+ osx_arm64_libgrpc1.55libprotobuf4.23.2:
+ CONFIG: osx_arm64_libgrpc1.55libprotobuf4.23.2
UPLOAD_PACKAGES: 'True'
timeoutInMinutes: 360
diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_libgrpc1.54libprotobuf3.21.yaml
similarity index 100%
rename from .ci_support/linux_64_.yaml
rename to .ci_support/linux_64_libgrpc1.54libprotobuf3.21.yaml
diff --git a/.ci_support/linux_64_libgrpc1.55libprotobuf4.23.2.yaml b/.ci_support/linux_64_libgrpc1.55libprotobuf4.23.2.yaml
new file mode 100644
index 00000000..2ca26e20
--- /dev/null
+++ b/.ci_support/linux_64_libgrpc1.55libprotobuf4.23.2.yaml
@@ -0,0 +1,29 @@
+c_compiler:
+- gcc
+c_compiler_version:
+- '12'
+cdt_name:
+- cos6
+channel_sources:
+- conda-forge
+channel_targets:
+- conda-forge main
+cxx_compiler:
+- gxx
+cxx_compiler_version:
+- '12'
+docker_image:
+- quay.io/condaforge/linux-anvil-cos7-x86_64
+libabseil:
+- '20230125'
+libgrpc:
+- '1.55'
+libprotobuf:
+- 4.23.2
+target_platform:
+- linux-64
+zip_keys:
+- - c_compiler_version
+ - cxx_compiler_version
+- - libgrpc
+ - libprotobuf
diff --git a/.ci_support/linux_aarch64_.yaml b/.ci_support/linux_aarch64_libgrpc1.54libprotobuf3.21.yaml
similarity index 100%
rename from .ci_support/linux_aarch64_.yaml
rename to .ci_support/linux_aarch64_libgrpc1.54libprotobuf3.21.yaml
diff --git a/.ci_support/linux_aarch64_libgrpc1.55libprotobuf4.23.2.yaml b/.ci_support/linux_aarch64_libgrpc1.55libprotobuf4.23.2.yaml
new file mode 100644
index 00000000..862c32ef
--- /dev/null
+++ b/.ci_support/linux_aarch64_libgrpc1.55libprotobuf4.23.2.yaml
@@ -0,0 +1,33 @@
+BUILD:
+- aarch64-conda_cos7-linux-gnu
+c_compiler:
+- gcc
+c_compiler_version:
+- '12'
+cdt_arch:
+- aarch64
+cdt_name:
+- cos7
+channel_sources:
+- conda-forge
+channel_targets:
+- conda-forge main
+cxx_compiler:
+- gxx
+cxx_compiler_version:
+- '12'
+docker_image:
+- quay.io/condaforge/linux-anvil-cos7-x86_64
+libabseil:
+- '20230125'
+libgrpc:
+- '1.55'
+libprotobuf:
+- 4.23.2
+target_platform:
+- linux-aarch64
+zip_keys:
+- - c_compiler_version
+ - cxx_compiler_version
+- - libgrpc
+ - libprotobuf
diff --git a/.ci_support/linux_ppc64le_.yaml b/.ci_support/linux_ppc64le_libgrpc1.54libprotobuf3.21.yaml
similarity index 100%
rename from .ci_support/linux_ppc64le_.yaml
rename to .ci_support/linux_ppc64le_libgrpc1.54libprotobuf3.21.yaml
diff --git a/.ci_support/linux_ppc64le_libgrpc1.55libprotobuf4.23.2.yaml b/.ci_support/linux_ppc64le_libgrpc1.55libprotobuf4.23.2.yaml
new file mode 100644
index 00000000..d2ae2386
--- /dev/null
+++ b/.ci_support/linux_ppc64le_libgrpc1.55libprotobuf4.23.2.yaml
@@ -0,0 +1,29 @@
+c_compiler:
+- gcc
+c_compiler_version:
+- '12'
+cdt_name:
+- cos7
+channel_sources:
+- conda-forge
+channel_targets:
+- conda-forge main
+cxx_compiler:
+- gxx
+cxx_compiler_version:
+- '12'
+docker_image:
+- quay.io/condaforge/linux-anvil-cos7-x86_64
+libabseil:
+- '20230125'
+libgrpc:
+- '1.55'
+libprotobuf:
+- 4.23.2
+target_platform:
+- linux-ppc64le
+zip_keys:
+- - c_compiler_version
+ - cxx_compiler_version
+- - libgrpc
+ - libprotobuf
diff --git a/.ci_support/migrations/protobuf423.yaml b/.ci_support/migrations/protobuf423.yaml
new file mode 100644
index 00000000..d3a462bc
--- /dev/null
+++ b/.ci_support/migrations/protobuf423.yaml
@@ -0,0 +1,11 @@
+__migrator:
+ build_number: 1
+ kind: version
+ migration_number: 2
+libgrpc:
+- '1.54'
+- '1.55'
+libprotobuf:
+- '3.21'
+- '4.23.2'
+migrator_ts: 1684932016.2362208
diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_libgrpc1.54libprotobuf3.21.yaml
similarity index 100%
rename from .ci_support/osx_64_.yaml
rename to .ci_support/osx_64_libgrpc1.54libprotobuf3.21.yaml
diff --git a/.ci_support/osx_64_libgrpc1.55libprotobuf4.23.2.yaml b/.ci_support/osx_64_libgrpc1.55libprotobuf4.23.2.yaml
new file mode 100644
index 00000000..118fe2a3
--- /dev/null
+++ b/.ci_support/osx_64_libgrpc1.55libprotobuf4.23.2.yaml
@@ -0,0 +1,29 @@
+MACOSX_DEPLOYMENT_TARGET:
+- '10.12'
+c_compiler:
+- clang
+c_compiler_version:
+- '15'
+channel_sources:
+- conda-forge
+channel_targets:
+- conda-forge main
+cxx_compiler:
+- clangxx
+cxx_compiler_version:
+- '15'
+libabseil:
+- '20230125'
+libgrpc:
+- '1.55'
+libprotobuf:
+- 4.23.2
+macos_machine:
+- x86_64-apple-darwin13.4.0
+target_platform:
+- osx-64
+zip_keys:
+- - c_compiler_version
+ - cxx_compiler_version
+- - libgrpc
+ - libprotobuf
diff --git a/.ci_support/osx_arm64_.yaml b/.ci_support/osx_arm64_libgrpc1.54libprotobuf3.21.yaml
similarity index 100%
rename from .ci_support/osx_arm64_.yaml
rename to .ci_support/osx_arm64_libgrpc1.54libprotobuf3.21.yaml
diff --git a/.ci_support/osx_arm64_libgrpc1.55libprotobuf4.23.2.yaml b/.ci_support/osx_arm64_libgrpc1.55libprotobuf4.23.2.yaml
new file mode 100644
index 00000000..e8fff8c9
--- /dev/null
+++ b/.ci_support/osx_arm64_libgrpc1.55libprotobuf4.23.2.yaml
@@ -0,0 +1,29 @@
+MACOSX_DEPLOYMENT_TARGET:
+- '11.0'
+c_compiler:
+- clang
+c_compiler_version:
+- '15'
+channel_sources:
+- conda-forge
+channel_targets:
+- conda-forge main
+cxx_compiler:
+- clangxx
+cxx_compiler_version:
+- '15'
+libabseil:
+- '20230125'
+libgrpc:
+- '1.55'
+libprotobuf:
+- 4.23.2
+macos_machine:
+- arm64-apple-darwin20.0.0
+target_platform:
+- osx-arm64
+zip_keys:
+- - c_compiler_version
+ - cxx_compiler_version
+- - libgrpc
+ - libprotobuf
diff --git a/README.md b/README.md
index 1ab6f551..f4acff1a 100644
--- a/README.md
+++ b/README.md
@@ -29,38 +29,73 @@ Current build status
Variant | Status |
- linux_64 |
+ linux_64_libgrpc1.54libprotobuf3.21 |
-
+
|
- linux_aarch64 |
+ linux_64_libgrpc1.55libprotobuf4.23.2 |
-
+
|
- linux_ppc64le |
+ linux_aarch64_libgrpc1.54libprotobuf3.21 |
-
+
|
- osx_64 |
+ linux_aarch64_libgrpc1.55libprotobuf4.23.2 |
-
+
|
- osx_arm64 |
+ linux_ppc64le_libgrpc1.54libprotobuf3.21 |
-
+
+
+ |
+
+ linux_ppc64le_libgrpc1.55libprotobuf4.23.2 |
+
+
+
+
+ |
+
+ osx_64_libgrpc1.54libprotobuf3.21 |
+
+
+
+
+ |
+
+ osx_64_libgrpc1.55libprotobuf4.23.2 |
+
+
+
+
+ |
+
+ osx_arm64_libgrpc1.54libprotobuf3.21 |
+
+
+
+
+ |
+
+ osx_arm64_libgrpc1.55libprotobuf4.23.2 |
+
+
+
|
diff --git a/recipe/bld.bat b/recipe/bld.bat
index 38de1f33..b633ddc0 100644
--- a/recipe/bld.bat
+++ b/recipe/bld.bat
@@ -63,6 +63,8 @@ set ANT_HOME=
set AZURE_EXTENSION_DIR=
set AZURE_HTTP_USER_AGENT=
+set "BAZEL_BUILD_OPTS=--cxxopt=/std:c++17"
+
bash -lx ./compile.sh
if errorlevel 1 exit 1
diff --git a/recipe/build.sh b/recipe/build.sh
index e7b6c819..357861fb 100644
--- a/recipe/build.sh
+++ b/recipe/build.sh
@@ -18,10 +18,15 @@ fi
# For debugging purposes, you can add
# --logging=6 --subcommands --verbose_failures
# This is though too much log output for Travis CI.
-export LIBPROTOBUF_VERSION=$(conda list -p $PREFIX libprotobuf | grep -v '^#' | tr -s ' ' | cut -f 2 -d ' ')
-export BAZEL_BUILD_OPTS="--crosstool_top=//bazel_toolchain:toolchain --define=PROTOBUF_INCLUDE_PATH=${PREFIX}/include --cpu=${TARGET_CPU}"
+# Extract minor.patch from libprotobuf version, that is the protoc version
+# The protobuf-java needs to be manually bumped if necessary
+# See https://protobuf.dev/support/version-support/
+export PROTOC_VERSION=$(conda list -p $PREFIX libprotobuf | grep -v '^#' | tr -s ' ' | cut -f 2 -d ' ' | sed -E 's/^[0-9]+\.([0-9]+\.[0-9]+)$/\1/')
+export PROTOBUF_JAVA_MAJOR_VERSION="3"
+export BAZEL_BUILD_OPTS="--crosstool_top=//bazel_toolchain:toolchain --define=PROTOBUF_INCLUDE_PATH=${PREFIX}/include --cpu=${TARGET_CPU} --cxxopt=-std=c++17"
export EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk"
-sed -ie "s:LIBPROTOBUF_VERSION:${LIBPROTOBUF_VERSION}:" WORKSPACE
+sed -ie "s:PROTOC_VERSION:${PROTOC_VERSION}:" WORKSPACE
+sed -ie "s:PROTOBUF_JAVA_MAJOR_VERSION:${PROTOBUF_JAVA_MAJOR_VERSION}:" WORKSPACE
sed -ie "s:\${INSTALL_NAME_TOOL}:${INSTALL_NAME_TOOL:-install_name_tool}:" src/BUILD
sed -ie "s:\${PREFIX}:${PREFIX}:" src/BUILD
sed -ie "s:\${BUILD_PREFIX}:${BUILD_PREFIX}:" third_party/grpc/BUILD
diff --git a/recipe/meta.yaml b/recipe/meta.yaml
index 85ee6af1..8426519c 100644
--- a/recipe/meta.yaml
+++ b/recipe/meta.yaml
@@ -10,15 +10,22 @@ source:
patches:
- patches/0001-allow-args-to-be-passed-to-bazel_build.patch
- patches/0002-Build-with-native-dependencies.patch # [unix]
- - patches/0003-Parametrize-LIBPROTOBUF_VERSION.patch # [unix]
+ # This patch ensures that the relevant version of protobuf-java matches libprotobuf.
+ # Note that "relevant" here means minor.patch, where minor is based on the last two
+ # digits of the calendar year. The major version may be different per language, see
+ # https://protobuf.dev/support/version-support/
+ # If the java major version changes, it needs to be bumped manually in build.sh.
+ - patches/0003-Match-version-of-protobuf-java-with-libprotobuf.patch # [unix]
- patches/0004-Use-conda-packages-for-build-tools.patch # [build_platform != target_platform]
- patches/0005-grpc-java-plugin-from-build.patch # [unix]
- patches/0006-bazel-bin-loader-path.patch # [osx]
- patches/0007-Adjust-cross-bazel-resultpath.patch # [build_platform != target_platform]
- patches/0008-win-Disable-VS-activation-and-make-build-verbose.patch
+ # backport https://github.com/bazelbuild/bazel/pull/18608 (squashed; as of 2023-06-24)
+ - patches/0009-Update-windows-VS-detection-code-to-account-for-new-.patch
build:
- number: 0
+ number: 1
ignore_prefix_files: true
binary_relocation: false
@@ -28,13 +35,9 @@ requirements:
- {{ compiler('cxx') }}
- sed # [unix]
- openjdk >=8,<17 # [unix]
- # 2022/05/14
- # Keep libabseil here so that the pinning is maintained between
- # build and host
- - libabseil # [unix]
- - libgrpc # [unix]
+ # we need $BUILD_PREFIX/bin/{grpc_cpp_plugin,grpc_java_plugin,protoc}
- grpc_java_plugin # [unix]
- # - grpc_java_plugin {{ libgrpc }} # [unix]
+ - libgrpc # [unix]
- libprotobuf # [unix]
- ijar {{ version }} # [build_platform != target_platform]
- singlejar {{ version }} # [build_platform != target_platform]
@@ -43,12 +46,9 @@ requirements:
- unzip # [linux]
- python * # [win]
host:
- # note: libabseil's ABI depends on C++ version used to compile it,
- # and we must match that C++ version to compile bazel; the shared
- # libabseil builds currently (20220623.0) use C++17
- - libabseil # [unix]
- - libgrpc # [unix]
- - libprotobuf # [unix]
+ - libabseil # [unix]
+ - libgrpc # [unix]
+ - libprotobuf # [unix]
- openjdk >=8,<17 # [win]
- posix # [win]
run:
diff --git a/recipe/patches/0001-allow-args-to-be-passed-to-bazel_build.patch b/recipe/patches/0001-allow-args-to-be-passed-to-bazel_build.patch
index 0c5c0679..ef361dbe 100644
--- a/recipe/patches/0001-allow-args-to-be-passed-to-bazel_build.patch
+++ b/recipe/patches/0001-allow-args-to-be-passed-to-bazel_build.patch
@@ -1,7 +1,7 @@
-From 7ec5a6635447c9e871f2c4297af01115cdc15433 Mon Sep 17 00:00:00 2001
+From a748e3755fd61edbaa916c75699ef94add0b4862 Mon Sep 17 00:00:00 2001
From: Jonathan Helmus
Date: Fri, 16 Mar 2018 12:10:51 -0500
-Subject: [PATCH 1/8] allow args to be passed to bazel_build
+Subject: [PATCH 1/9] allow args to be passed to bazel_build
Allow arguments to be passed to bazel_build via the BAZEL_BUILD_OPTS
environment variable.
@@ -22,6 +22,3 @@ index d91583d277..ce49a1266e 100755
--action_env=PATH \
--host_platform=@local_config_platform//:host \
--platforms=@local_config_platform//:host \
---
-2.38.1.windows.1
-
diff --git a/recipe/patches/0002-Build-with-native-dependencies.patch b/recipe/patches/0002-Build-with-native-dependencies.patch
index d58858e7..a782aaf4 100644
--- a/recipe/patches/0002-Build-with-native-dependencies.patch
+++ b/recipe/patches/0002-Build-with-native-dependencies.patch
@@ -1,7 +1,7 @@
-From b2da2beb3f1cf00a57fe2c2d0299209bb13c1d21 Mon Sep 17 00:00:00 2001
+From 46256ac9ad1d615e0cb8d98819028873456eeab1 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn"
Date: Sun, 21 Mar 2021 21:26:54 +0100
-Subject: [PATCH 2/8] Build with native dependencies
+Subject: [PATCH 2/9] Build with native dependencies
---
WORKSPACE | 37 +-
@@ -16,7 +16,7 @@ Subject: [PATCH 2/8] Build with native dependencies
create mode 100644 third_party/systemlibs/protobuf_deps.bzl
diff --git a/WORKSPACE b/WORKSPACE
-index 0d78fcf027..2cf3d945e0 100644
+index ff47163e72..97e0b73b16 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -90,12 +90,43 @@ bind(
@@ -123,7 +123,7 @@ index 397089d9a5..e6662acc9f 100644
filegroup(
diff --git a/third_party/systemlibs/protobuf.BUILD b/third_party/systemlibs/protobuf.BUILD
new file mode 100644
-index 0000000000..3e42a1bf31
+index 0000000000..b9caa879db
--- /dev/null
+++ b/third_party/systemlibs/protobuf.BUILD
@@ -0,0 +1,141 @@
@@ -191,13 +191,13 @@ index 0000000000..3e42a1bf31
+
+cc_library(
+ name = "protobuf",
-+ linkopts = ["-lprotobuf"],
++ linkopts = ["-lprotobuf", "-labsl_cord", "-labsl_cord_internal", "-labsl_cordz_functions", "-labsl_cordz_handle", "-labsl_cordz_info", "-labsl_cordz_sample_token", "-labsl_log_entry", "-labsl_log_flags", "-labsl_log_globals", "-labsl_log_initialize", "-labsl_log_internal_check_op", "-labsl_log_internal_conditions", "-labsl_log_internal_format", "-labsl_log_internal_globals", "-labsl_log_internal_log_sink_set", "-labsl_log_internal_message", "-labsl_log_internal_nullguard", "-labsl_log_internal_proto", "-labsl_log_severity", "-labsl_log_sink"],
+ visibility = ["//visibility:public"],
+)
+
+cc_library(
+ name = "protobuf_headers",
-+ linkopts = ["-lprotobuf"],
++ linkopts = ["-lprotobuf", "-labsl_cord", "-labsl_cord_internal", "-labsl_cordz_functions", "-labsl_cordz_handle", "-labsl_cordz_info", "-labsl_cordz_sample_token", "-labsl_log_entry", "-labsl_log_flags", "-labsl_log_globals", "-labsl_log_initialize", "-labsl_log_internal_check_op", "-labsl_log_internal_conditions", "-labsl_log_internal_format", "-labsl_log_internal_globals", "-labsl_log_internal_log_sink_set", "-labsl_log_internal_message", "-labsl_log_internal_nullguard", "-labsl_log_internal_proto", "-labsl_log_severity", "-labsl_log_sink"],
+ visibility = ["//visibility:public"],
+)
+
@@ -718,6 +718,3 @@ index 0000000000..aafd89b0aa
@@ -0,0 +1,2 @@
+def protobuf_deps():
+ pass
---
-2.38.1.windows.1
-
diff --git a/recipe/patches/0003-Parametrize-LIBPROTOBUF_VERSION.patch b/recipe/patches/0003-Match-version-of-protobuf-java-with-libprotobuf.patch
similarity index 61%
rename from recipe/patches/0003-Parametrize-LIBPROTOBUF_VERSION.patch
rename to recipe/patches/0003-Match-version-of-protobuf-java-with-libprotobuf.patch
index ebb89923..17344336 100644
--- a/recipe/patches/0003-Parametrize-LIBPROTOBUF_VERSION.patch
+++ b/recipe/patches/0003-Match-version-of-protobuf-java-with-libprotobuf.patch
@@ -1,14 +1,14 @@
-From ebdf5276ca7a53ba79a754dc451a29c58634169b Mon Sep 17 00:00:00 2001
+From 76025bc65b87b316c1f46ec87747449981392657 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn"
Date: Thu, 28 Oct 2021 11:28:13 +0200
-Subject: [PATCH 3/8] Parametrize LIBPROTOBUF_VERSION
+Subject: [PATCH 3/9] Match version of protobuf-java with libprotobuf
---
WORKSPACE | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/WORKSPACE b/WORKSPACE
-index 2cf3d945e0..0720d49d99 100644
+index 97e0b73b16..5ac6d6710d 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -119,8 +119,8 @@ load("@rules_jvm_external//:defs.bzl", "maven_install")
@@ -17,11 +17,8 @@ index 2cf3d945e0..0720d49d99 100644
artifacts = [
- "com.google.protobuf:protobuf-java:3.15.6",
- "com.google.protobuf:protobuf-java-util:3.15.6",
-+ "com.google.protobuf:protobuf-java:LIBPROTOBUF_VERSION",
-+ "com.google.protobuf:protobuf-java-util:LIBPROTOBUF_VERSION",
++ "com.google.protobuf:protobuf-java:PROTOBUF_JAVA_MAJOR_VERSION.PROTOC_VERSION",
++ "com.google.protobuf:protobuf-java-util:PROTOBUF_JAVA_MAJOR_VERSION.PROTOC_VERSION",
],
repositories = [
"https://repo1.maven.org/maven2",
---
-2.38.1.windows.1
-
diff --git a/recipe/patches/0004-Use-conda-packages-for-build-tools.patch b/recipe/patches/0004-Use-conda-packages-for-build-tools.patch
index 9c132e7e..c22196d5 100644
--- a/recipe/patches/0004-Use-conda-packages-for-build-tools.patch
+++ b/recipe/patches/0004-Use-conda-packages-for-build-tools.patch
@@ -1,7 +1,7 @@
-From 134179022bd7e204499a2dadc4183890e477c1fd Mon Sep 17 00:00:00 2001
+From a8152a67f7d8a01baf2cbd05367c7fc792df36c3 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn"
Date: Sat, 12 Feb 2022 22:04:35 +0100
-Subject: [PATCH 4/8] Use conda packages for build tools
+Subject: [PATCH 4/9] Use conda packages for build tools
---
src/tools/singlejar/BUILD | 44 +++++++++------------------------------
@@ -127,6 +127,3 @@ index 0b8ce85dab..3fc4fee98b 100644
)
alias(
---
-2.38.1.windows.1
-
diff --git a/recipe/patches/0005-grpc-java-plugin-from-build.patch b/recipe/patches/0005-grpc-java-plugin-from-build.patch
index 3d8e3361..d8228aba 100644
--- a/recipe/patches/0005-grpc-java-plugin-from-build.patch
+++ b/recipe/patches/0005-grpc-java-plugin-from-build.patch
@@ -1,7 +1,7 @@
-From 919747b3c859f096e8d6298010bcad8069ca6baf Mon Sep 17 00:00:00 2001
+From 26f301459417fa0a809c78a49a58493e4184153d Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn"
Date: Sat, 12 Feb 2022 22:05:55 +0100
-Subject: [PATCH 5/8] grpc-java-plugin from build
+Subject: [PATCH 5/9] grpc-java-plugin from build
---
third_party/grpc-java/BUILD | 14 +++++---------
@@ -31,6 +31,3 @@ index 34cb26c0d1..37b3b077f5 100644
+ executable = 1,
+ visibility = ["//visibility:public"],
)
---
-2.38.1.windows.1
-
diff --git a/recipe/patches/0006-bazel-bin-loader-path.patch b/recipe/patches/0006-bazel-bin-loader-path.patch
index a0134510..f6dbce36 100644
--- a/recipe/patches/0006-bazel-bin-loader-path.patch
+++ b/recipe/patches/0006-bazel-bin-loader-path.patch
@@ -1,14 +1,14 @@
-From def525b7191e1e73458bed2398bf834bbe97e3a4 Mon Sep 17 00:00:00 2001
+From f3c75d9e682f75b2e5d4a679a95394703fc7c538 Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn"
Date: Sat, 12 Feb 2022 22:08:16 +0100
-Subject: [PATCH 6/8] bazel bin loader path
+Subject: [PATCH 6/9] bazel bin loader path
---
src/BUILD | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
diff --git a/src/BUILD b/src/BUILD
-index 4bf0179a24..6125979dae 100644
+index b8e62240ae..703b7cb704 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -364,16 +364,41 @@ genrule(
@@ -55,6 +55,3 @@ index 4bf0179a24..6125979dae 100644
executable = 1,
output_to_bindir = 1,
visibility = [
---
-2.38.1.windows.1
-
diff --git a/recipe/patches/0007-Adjust-cross-bazel-resultpath.patch b/recipe/patches/0007-Adjust-cross-bazel-resultpath.patch
index f366d50f..0b054357 100644
--- a/recipe/patches/0007-Adjust-cross-bazel-resultpath.patch
+++ b/recipe/patches/0007-Adjust-cross-bazel-resultpath.patch
@@ -1,7 +1,7 @@
-From 9632391cc472987525d28264c12910e4780d7f9b Mon Sep 17 00:00:00 2001
+From 35b6615e5f3a4884fb9ebb319354135d812f80fb Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn"
Date: Sat, 12 Feb 2022 22:10:21 +0100
-Subject: [PATCH 7/8] Adjust cross bazel resultpath
+Subject: [PATCH 7/9] Adjust cross bazel resultpath
---
compile.sh | 1 +
@@ -19,6 +19,3 @@ index ce49a1266e..e830fc13b7 100755
[ -e "$bazel_bin_path" ] \
|| fail "Could not find freshly built Bazel binary at '$bazel_bin_path'"
cp -f "$bazel_bin_path" "output/bazel${EXE_EXT}" \
---
-2.38.1.windows.1
-
diff --git a/recipe/patches/0008-win-Disable-VS-activation-and-make-build-verbose.patch b/recipe/patches/0008-win-Disable-VS-activation-and-make-build-verbose.patch
index 7d3cc0aa..a051d8c4 100644
--- a/recipe/patches/0008-win-Disable-VS-activation-and-make-build-verbose.patch
+++ b/recipe/patches/0008-win-Disable-VS-activation-and-make-build-verbose.patch
@@ -1,7 +1,7 @@
-From 92f01bd7255ab157453b812f681ff80e6a24cd10 Mon Sep 17 00:00:00 2001
+From 84d8844c48276b5131e6895d3c098d86ba1fe9eb Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn"
Date: Mon, 7 Feb 2022 21:43:56 +0100
-Subject: [PATCH 8/8] win: Disable VS activation and make build verbose
+Subject: [PATCH 8/9] win: Disable VS activation and make build verbose
---
src/main/native/windows/build_windows_jni.sh | 13 +++++++------
@@ -38,6 +38,3 @@ index 5d38ffd2a7..5850fc0b11 100644
EOF
# Invoke the file and hopefully generate the .DLL .
---
-2.38.1.windows.1
-
diff --git a/recipe/patches/0009-Update-windows-VS-detection-code-to-account-for-new-.patch b/recipe/patches/0009-Update-windows-VS-detection-code-to-account-for-new-.patch
new file mode 100644
index 00000000..806d7c53
--- /dev/null
+++ b/recipe/patches/0009-Update-windows-VS-detection-code-to-account-for-new-.patch
@@ -0,0 +1,117 @@
+From 76ba68d32acd77aa418de7ef5dde6e0b021ca1e7 Mon Sep 17 00:00:00 2001
+From: Paolo Tranquilli
+Date: Wed, 7 Jun 2023 17:56:13 +0200
+Subject: [PATCH 9/9] Update windows VS detection code to account for new
+ directory
+
+Windows VS 2022 version 17.6 introduced a new `vspkg` directory
+underneath `VC` that is throwing off the toolchain autodetection code.
+
+The checks now got renamed to a more approriate `_is_vs_2017_or_newer`
+and takes into account the possible presence of this `vspkg` directory.
+
+* Update windows VS detection code hard-coded paths with the 2022 version
+
+* Reorder VS hardcoded paths for autodetection and add 2022 Preview
+
+* make VS version check more future-proof
+---
+ tools/cpp/windows_cc_configure.bzl | 39 ++++++++++++++----------------
+ 1 file changed, 18 insertions(+), 21 deletions(-)
+
+diff --git a/tools/cpp/windows_cc_configure.bzl b/tools/cpp/windows_cc_configure.bzl
+index bd30dc62d9..2baf68d772 100644
+--- a/tools/cpp/windows_cc_configure.bzl
++++ b/tools/cpp/windows_cc_configure.bzl
+@@ -232,15 +232,10 @@ def find_vc_path(repository_ctx):
+ # 5. Check default directories for VC installation
+ auto_configure_warning_maybe(repository_ctx, "Looking for default Visual C++ installation directory")
+ for path in [
+- "Microsoft Visual Studio\\2019\\Preview\\VC",
+- "Microsoft Visual Studio\\2019\\BuildTools\\VC",
+- "Microsoft Visual Studio\\2019\\Community\\VC",
+- "Microsoft Visual Studio\\2019\\Professional\\VC",
+- "Microsoft Visual Studio\\2019\\Enterprise\\VC",
+- "Microsoft Visual Studio\\2017\\BuildTools\\VC",
+- "Microsoft Visual Studio\\2017\\Community\\VC",
+- "Microsoft Visual Studio\\2017\\Professional\\VC",
+- "Microsoft Visual Studio\\2017\\Enterprise\\VC",
++ "Microsoft Visual Studio\\%s\\%s\\VC" % (year, edition)
++ for year in (2022, 2019, 2017)
++ for edition in ("Preview", "BuildTools", "Community", "Professional", "Enterprise")
++ ] + [
+ "Microsoft Visual Studio 14.0\\VC",
+ ]:
+ path = program_files_dir + "\\" + path
+@@ -254,17 +249,19 @@ def find_vc_path(repository_ctx):
+ auto_configure_warning_maybe(repository_ctx, "Visual C++ build tools found at %s" % vc_dir)
+ return vc_dir
+
+-def _is_vs_2017_or_2019(repository_ctx, vc_path):
+- """Check if the installed VS version is Visual Studio 2017 or 2019."""
++def _is_vs_2017_or_newer(repository_ctx, vc_path):
++ """Check if the installed VS version is Visual Studio 2017 or newer."""
+
+- # The layout of VC folder in VS 2017 and 2019 is different from that in VS 2015 and older versions.
+- # In VS 2017 and 2019, it contains only three directories:
++ # The layout of VC folder in VS 2017 and newer versions is different from that in VS 2015 and older versions.
++ # From VS 2017 it contains three directories:
+ # "Auxiliary", "Redist", "Tools"
++ # From VS 2022 17.6, a fourth "vcpkg" directory is also present, but we only check presence of the three
++ # directories above in case other directories pop up in the future
+
+- vc_2017_or_2019_contents = ["auxiliary", "redist", "tools"]
++ vc_2017_or_newer_contents = ["auxiliary", "redist", "tools"]
+ vc_path_contents = [d.basename.lower() for d in repository_ctx.path(vc_path).readdir()]
+- vc_path_contents = sorted(vc_path_contents)
+- return vc_path_contents == vc_2017_or_2019_contents
++ vc_path_contents = sorted([d for d in vc_path_contents if d in vc_2017_or_newer_contents])
++ return vc_path_contents == vc_2017_or_newer_contents
+
+ def _is_msbuildtools(vc_path):
+ """Check if the installed VC version is from MSBuildTools."""
+@@ -275,7 +272,7 @@ def _is_msbuildtools(vc_path):
+
+ def _find_vcvars_bat_script(repository_ctx, vc_path):
+ """Find batch script to set up environment variables for VC. Doesn't %-escape the result."""
+- if _is_vs_2017_or_2019(repository_ctx, vc_path):
++ if _is_vs_2017_or_newer(repository_ctx, vc_path):
+ vcvars_script = vc_path + "\\Auxiliary\\Build\\VCVARSALL.BAT"
+ else:
+ vcvars_script = vc_path + "\\VCVARSALL.BAT"
+@@ -293,7 +290,7 @@ def _is_support_vcvars_ver(vc_full_version):
+
+ def _is_support_winsdk_selection(repository_ctx, vc_path):
+ """Windows SDK selection is supported with VC 2017 / 2019 or with full VS 2015 installation."""
+- if _is_vs_2017_or_2019(repository_ctx, vc_path):
++ if _is_vs_2017_or_newer(repository_ctx, vc_path):
+ return True
+
+ # By checking the source code of VCVARSALL.BAT in VC 2015, we know that
+@@ -319,7 +316,7 @@ def _get_vc_env_vars(repository_ctx, vc_path, msvc_vars_x64, target_arch):
+ dictionary of envvars
+ """
+ env = {}
+- if _is_vs_2017_or_2019(repository_ctx, vc_path):
++ if _is_vs_2017_or_newer(repository_ctx, vc_path):
+ lib = msvc_vars_x64["%{msvc_env_lib_x64}"]
+ full_version = _get_vc_full_version(repository_ctx, vc_path)
+ tools_path = "%s\\Tools\\MSVC\\%s\\bin\\HostX64\\%s" % (vc_path, full_version, target_arch)
+@@ -367,7 +364,7 @@ def setup_vc_env_vars(repository_ctx, vc_path, envvars = [], allow_empty = False
+
+ # Get VC version set by user. Only supports VC 2017 & 2019.
+ vcvars_ver = ""
+- if _is_vs_2017_or_2019(repository_ctx, vc_path):
++ if _is_vs_2017_or_newer(repository_ctx, vc_path):
+ full_version = _get_vc_full_version(repository_ctx, vc_path)
+
+ # Because VCVARSALL.BAT is from the latest VC installed, so we check if the latest
+@@ -448,7 +445,7 @@ def _find_msvc_tools(repository_ctx, vc_path, target_arch = "x64"):
+ def find_msvc_tool(repository_ctx, vc_path, tool, target_arch = "x64"):
+ """Find the exact path of a specific build tool in MSVC. Doesn't %-escape the result."""
+ tool_path = None
+- if _is_vs_2017_or_2019(repository_ctx, vc_path) or _is_msbuildtools(vc_path):
++ if _is_vs_2017_or_newer(repository_ctx, vc_path) or _is_msbuildtools(vc_path):
+ full_version = _get_vc_full_version(repository_ctx, vc_path)
+ if full_version:
+ tool_path = "%s\\Tools\\MSVC\\%s\\bin\\HostX64\\%s\\%s" % (vc_path, full_version, target_arch, tool)