Merge pull request #10797 from mkruskal-google/sync-stage

Integrate from Piper for C++, Java, Python, Objective-C, C#, and Ruby
diff --git a/csharp/build_release.sh b/csharp/build_release.sh
index 1c3a9de..8a641b2 100755
--- a/csharp/build_release.sh
+++ b/csharp/build_release.sh
@@ -7,4 +7,5 @@
 set DOTNET_CLI_TELEMETRY_OPTOUT=true
 
 # Builds Google.Protobuf NuGet packages
+dotnet restore -s /lib/csharp/ src/Google.Protobuf/Google.Protobuf.csproj
 dotnet pack --no-restore -c Release src/Google.Protobuf.sln -p:ContinuousIntegrationBuild=true
diff --git a/java/core/src/main/java/com/google/protobuf/ByteString.java b/java/core/src/main/java/com/google/protobuf/ByteString.java
index 0e03ebd..1acbad0 100644
--- a/java/core/src/main/java/com/google/protobuf/ByteString.java
+++ b/java/core/src/main/java/com/google/protobuf/ByteString.java
@@ -75,6 +75,7 @@
  */
 @CheckReturnValue
 public abstract class ByteString implements Iterable<Byte>, Serializable {
+  private static final long serialVersionUID = 1L;
 
   /**
    * When two strings to be concatenated have a combined length shorter than this, we just copy
@@ -945,6 +946,8 @@
 
   /** Base class for leaf {@link ByteString}s (i.e. non-ropes). */
   abstract static class LeafByteString extends ByteString {
+    private static final long serialVersionUID = 1L;
+
     @Override
     protected final int getTreeDepth() {
       return 0;
@@ -1603,7 +1606,6 @@
   // Keep this class private to avoid deadlocks in classloading across threads as ByteString's
   // static initializer loads LiteralByteString and another thread loads BoundedByteString.
   private static final class BoundedByteString extends LiteralByteString {
-
     private final int bytesOffset;
     private final int bytesLength;
 
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index 82e7bf2..fb2248a 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -49,9 +49,12 @@
         http_archive(
             name = "zlib",
             build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
-            sha256 = "d8688496ea40fb61787500e863cc63c9afcbc524468cedeb478068924eb54932",
-            strip_prefix = "zlib-1.2.12",
-            urls = ["https://github.com/madler/zlib/archive/v1.2.12.tar.gz"],
+            sha256 = "d14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98",
+            strip_prefix = "zlib-1.2.13",
+            urls = [
+                "https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.xz",
+                "https://zlib.net/zlib-1.2.13.tar.xz",
+            ],
         )
 
     if not native.existing_rule("jsoncpp"):
diff --git a/toolchain/BUILD.bazel b/toolchain/BUILD.bazel
index 20a435c..5bc8c8a 100644
--- a/toolchain/BUILD.bazel
+++ b/toolchain/BUILD.bazel
@@ -102,7 +102,7 @@
     linker_path = "/usr/tools",
     sysroot = "/usr/tools/xcode_14_0/macosx",
     target_cpu = "aarch64",
-    target_full_name = "aarch64-apple-macosx11.3",
+    target_full_name = "aarch64-apple-macosx10.9",
 )
 
 cc_toolchain_config(
@@ -119,7 +119,7 @@
     linker_path = "/usr/tools",
     sysroot = "/usr/tools/xcode_14_0/macosx",
     target_cpu = "x86_64",
-    target_full_name = "x86_64-apple-macosx11.3",
+    target_full_name = "x86_64-apple-macosx10.9",
 )
 
 cc_toolchain_config(