Skip to content

Commit

Permalink
Force copy symlinks and fix mac issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mkruskal-google committed Jan 20, 2023
1 parent 20c5464 commit fcb656e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions ruby/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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": [],
Expand All @@ -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": [],
Expand Down

0 comments on commit fcb656e

Please sign in to comment.