Migrate ruby and php to the new utf8_range repo

pull/10758/head
Mike Kruskal 2 years ago
parent 254fa021c4
commit b81def1cbd
  1. 4
      php/BUILD.bazel
  2. 3
      php/tests/compile_extension.sh
  3. 4
      protobuf_deps.bzl
  4. 2
      ruby/BUILD.bazel
  5. 14
      ruby/Rakefile
  6. 2
      ruby/internal.bzl

@ -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"],

@ -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).

@ -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"):

@ -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"],

@ -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|

@ -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],

Loading…
Cancel
Save