diff --git a/php/BUILD.bazel b/php/BUILD.bazel index 3c97ad8db2..ac33702ab7 100644 --- a/php/BUILD.bazel +++ b/php/BUILD.bazel @@ -34,7 +34,7 @@ inline_sh_binary( name = "build_extension", cmd = """ mkdir -p php/ext/google/protobuf/third_party/utf8_range - cp third_party/utf8_range/* php/ext/google/protobuf/third_party/utf8_range + cp external/utf8_range/* php/ext/google/protobuf/third_party/utf8_range pushd php/ext/google/protobuf phpize @@ -48,7 +48,7 @@ genrule( name = "extension", srcs = [ ":source_files", - "//third_party/utf8_range:all_files", + "@utf8_range//:utf8_range_srcs", ], tools = [":build_extension"], outs = ["protobuf.so"], diff --git a/php/tests/compile_extension.sh b/php/tests/compile_extension.sh index dc42aa32ee..f9fb8cdf12 100755 --- a/php/tests/compile_extension.sh +++ b/php/tests/compile_extension.sh @@ -4,6 +4,9 @@ set -ex cd $(dirname $0)/.. +# Pull in dependencies. +git submodule update --init --recursive + # utf8_range has to live in the base third_party directory. # We copy it into the ext/google/protobuf directory for the build # (and for the release to PECL). diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index 5e5f511e4d..95e71242de 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -67,8 +67,8 @@ def protobuf_deps(): _github_archive( name = "utf8_range", repo = "https://github.com/protocolbuffers/utf8_range", - commit = "77f787ec84cce7c4c7059a614e3147eac23d511e", - sha256 = "e9ece5beebe0949cb4a4768b7fc9ca85b64fec41b3175b0c898bdd3f848c4ed1", + commit = "45fbf543fec00020a08650791a37575319a3ea1d", + sha256 = "dd93db062025f563068abaa224549e9d341434b5851e959c7853dfa263c96416", ) if not native.existing_rule("rules_cc"): diff --git a/ruby/BUILD.bazel b/ruby/BUILD.bazel index 5e15d9241a..d4114b57e2 100644 --- a/ruby/BUILD.bazel +++ b/ruby/BUILD.bazel @@ -71,7 +71,7 @@ filegroup( name = "protobuf", srcs = [ ":srcs", - "//third_party/utf8_range:all_files", + "@utf8_range//:utf8_range_srcs", ] + select({ ":java_ruby": [":protobuf_java"], "@bazel_tools//src/conditions:darwin": [":protobuf_c_mac"], diff --git a/ruby/Rakefile b/ruby/Rakefile index 89a00e1ddb..e6b774c5f3 100644 --- a/ruby/Rakefile +++ b/ruby/Rakefile @@ -84,12 +84,16 @@ if RUBY_PLATFORM == "java" else unless ENV['IN_DOCKER'] == 'true' # We need utf8_range in-tree. + if ENV['BAZEL'] == 'true' + utf8_root = '../external/utf8_range' + else + utf8_root = '../third_party/utf8_range' + end FileUtils.mkdir_p("ext/google/protobuf_c/third_party/utf8_range") - FileUtils.cp("../third_party/utf8_range/utf8_range.h", "ext/google/protobuf_c/third_party/utf8_range") - FileUtils.cp("../third_party/utf8_range/naive.c", "ext/google/protobuf_c/third_party/utf8_range") - FileUtils.cp("../third_party/utf8_range/range2-neon.c", "ext/google/protobuf_c/third_party/utf8_range") - FileUtils.cp("../third_party/utf8_range/range2-sse.c", "ext/google/protobuf_c/third_party/utf8_range") - FileUtils.cp("../third_party/utf8_range/LICENSE", "ext/google/protobuf_c/third_party/utf8_range") + FileUtils.cp(utf8_root+"/utf8_range.h", "ext/google/protobuf_c/third_party/utf8_range") + FileUtils.cp(utf8_root+"/naive.c", "ext/google/protobuf_c/third_party/utf8_range") + FileUtils.cp(utf8_root+"/range2-neon.c", "ext/google/protobuf_c/third_party/utf8_range") + FileUtils.cp(utf8_root+"/range2-sse.c", "ext/google/protobuf_c/third_party/utf8_range") end Rake::ExtensionTask.new("protobuf_c", spec) do |ext| diff --git a/ruby/internal.bzl b/ruby/internal.bzl index 74a2d10ef8..10ae10824c 100644 --- a/ruby/internal.bzl +++ b/ruby/internal.bzl @@ -23,7 +23,7 @@ def internal_ruby_extension( ":srcs", ":test_ruby_protos", ":tests", - "//third_party/utf8_range:all_files", + "@utf8_range//:utf8_range_srcs", ], tags = ["manual"], outs = [extension],