[arch-commits] Commit in gitlab/trunk (PKGBUILD ruby27-pop-extra-arg.patch)

Anatol Pomozov anatolik at archlinux.org
Mon Jan 13 02:18:19 UTC 2020


    Date: Monday, January 13, 2020 @ 02:18:18
  Author: anatolik
Revision: 552277

Replace workaround for 'Rack' project to the correct fix in 'Grape' project

https://gitlab.com/groups/gitlab-org/-/epics/2380

Modified:
  gitlab/trunk/PKGBUILD
  gitlab/trunk/ruby27-pop-extra-arg.patch

----------------------------+
 PKGBUILD                   |    8 ++++---
 ruby27-pop-extra-arg.patch |   45 ++++++++++++++++++++++++-------------------
 2 files changed, 31 insertions(+), 22 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-01-13 02:18:15 UTC (rev 552276)
+++ PKGBUILD	2020-01-13 02:18:18 UTC (rev 552277)
@@ -49,7 +49,7 @@
             'bf33b818e4ea671c16f58563997ba5fe0a09090e5c03577ff974d31324d4e9782b85a9bb4f1749b97257ce93400c692de935f003770d52b5994c9cab9aee57c6'
             'abacbff0d7be918337a17b56481c84e6bf3eddd9551efe78ba9fb74337179e95c9b60f41c49f275e05074a4074a616be36fa208a48fc12d5b940f0554fbd89c3'
             '88e199d2f63e4f235930c35c6dfde80e6010e590907bd4de0af1fbfe6d5491ff56845aefcfe8edefa707712bd84fef96880655747b8bfb949ceeadc0456b0121'
-            'ac1f033a6a4cde442e3280f06ee5e78a800420715fff6a35bad798e948997c173499fb970592f146483d583b4f0697c2844071d66348ac7da69f36f1a9c757a8')
+            '0cc5c1df3cd18978df9a01bb64680d3a375c1ff4de6a453045dd26355777b4f08e3a05f55f035c8012a9683100de0bc3d11c280debcb343eb7167fc25342d5c0')
 
 
 _datadir="/usr/share/webapps/${pkgname}"
@@ -123,8 +123,10 @@
   bundle config force_ruby_platform true # some native gems are not available for newer ruby
   bundle install --jobs=$(nproc) --no-cache --deployment --without development test aws kerberos
 
-  # workaround for a weird ruby27 issue https://gitlab.com/groups/gitlab-org/-/epics/2380
-  pushd vendor/bundle/ruby/2.7.0/gems/rack-2.0.7/
+  # workaround for a ruby2.7 issue
+  # https://gitlab.com/groups/gitlab-org/-/epics/2380
+  # https://github.com/ruby-grape/grape/issues/1967
+  pushd vendor/bundle/ruby/2.7.0/gems/grape-1.1.0/
   patch -p1 < $srcdir/ruby27-pop-extra-arg.patch
   popd
 

Modified: ruby27-pop-extra-arg.patch
===================================================================
--- ruby27-pop-extra-arg.patch	2020-01-13 02:18:15 UTC (rev 552276)
+++ ruby27-pop-extra-arg.patch	2020-01-13 02:18:18 UTC (rev 552277)
@@ -1,19 +1,26 @@
-diff --git a/lib/rack/builder.rb b/lib/rack/builder.rb
-index 975cf1e1..c61e8421 100644
---- a/lib/rack/builder.rb
-+++ b/lib/rack/builder.rb
-@@ -79,6 +79,14 @@ module Rack
-     # The +call+ method in this example sets an additional environment key which then can be
-     # referenced in the application if required.
-     def use(middleware, *args, &block)
-+      # workaround for ruby 2.7 problem discussed https://gitlab.com/groups/gitlab-org/-/epics/2380
-+      if not args.empty? and args[-1] == block
-+        # for some reason ruby adds block defined in lib/api/api_guard.rb
-+        # both to args and to 'block' parameter
-+        # pop extra parameter from 'args'
-+        args.pop
-+      end
-+
-       if @map
-         mapping, @map = @map, nil
-         @use << proc { |app| generate_map app, mapping }
+From 9ff085264c5ce3db12290c68bc8373578234e425 Mon Sep 17 00:00:00 2001
+From: dm1try <me at dmitry.it>
+Date: Sat, 11 Jan 2020 22:24:15 +0300
+Subject: [PATCH] fix args forwarding in Middleware::Stack#merge_with for ruby
+ 2.7.0 ref #1967
+
+---
+ CHANGELOG.md                        | 1 +
+ lib/grape/middleware/stack.rb       | 3 ++-
+ spec/grape/middleware/stack_spec.rb | 9 +++++++++
+ 3 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/lib/grape/middleware/stack.rb b/lib/grape/middleware/stack.rb
+index 8509a4653..488a51498 100644
+--- a/lib/grape/middleware/stack.rb
++++ b/lib/grape/middleware/stack.rb
+@@ -78,7 +78,8 @@ def use(*args, &block)
+       def merge_with(middleware_specs)
+         middleware_specs.each do |operation, *args|
+           if args.last.is_a?(Proc)
+-            public_send(operation, *args, &args.pop)
++            last_proc = args.pop
++            public_send(operation, *args, &last_proc)
+           else
+             public_send(operation, *args)
+           end



More information about the arch-commits mailing list