From fcb656ee066cb982fc2be2905c1a0811fe433205 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Fri, 20 Jan 2023 15:26:14 -0800 Subject: [PATCH] Force copy symlinks and fix mac issue --- ruby/BUILD.bazel | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ruby/BUILD.bazel b/ruby/BUILD.bazel index 3c22730c3648e..53c2911494c9d 100755 --- a/ruby/BUILD.bazel +++ b/ruby/BUILD.bazel @@ -35,15 +35,19 @@ genrule( outs = ["google-protobuf-"+PROTOBUF_RUBY_VERSION+"-java.gem"], cmd = """ set -eux + mkdir tmp for src in $(SRCS); do - cp --parents "$$src" "$(GENDIR)" + rsync -R -L "$$src" tmp done for wkt in $(execpaths //:well_known_ruby_protos); do - cp "$$wkt" "$(GENDIR)/ruby/lib/google/protobuf/" + mv "tmp/$$wkt" "tmp/ruby/lib/google/protobuf/" done - cd $(GENDIR)/ruby + mv "tmp/$(execpath //ruby/lib/google:copy_jar)" "tmp/ruby/lib/google" + cd tmp/ruby chmod -R 777 ./ gem build google-protobuf.gemspec + cd ../.. + mv tmp/ruby/google-protobuf-*.gem $@ """, target_compatible_with = select({ "@rules_ruby//ruby/runtime:config_jruby": [], @@ -64,20 +68,22 @@ genrule( outs = ["google-protobuf-"+PROTOBUF_RUBY_VERSION+".gem"], cmd = """ set -eux + mkdir tmp for src in $(SRCS); do - cp --parents "$$src" "$(GENDIR)" + rsync -R -L "$$src" "tmp" done mkdir -p "$(GENDIR)/ruby/ext/google/protobuf_c/third_party/utf8_range" for utf in $(execpaths @utf8_range//:utf8_range_srcs) $(execpath @utf8_range//:LICENSE); do - cp "$$utf" "$(GENDIR)/ruby/ext/google/protobuf_c/third_party/utf8_range" + mv "tmp/$$utf" "tmp/ruby/ext/google/protobuf_c/third_party/utf8_range" done for wkt in $(execpaths //:well_known_ruby_protos); do - cp "$$wkt" "$(GENDIR)/ruby/lib/google/protobuf/" + mv "tmp/$$wkt" "tmp/ruby/lib/google/protobuf/" done - cd $(GENDIR)/ruby + cd tmp/ruby chmod -R 777 ./ gem build google-protobuf.gemspec - pwd + cd ../.. + mv tmp/ruby/google-protobuf-*.gem $@ """, target_compatible_with = select({ "@rules_ruby//ruby/runtime:config_ruby": [],