Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/explicit require cgi #29

Merged
merged 2 commits into from
Mar 10, 2017

Conversation

tancnle
Copy link
Contributor

@tancnle tancnle commented Mar 9, 2017

Why

Running bundle exec rake spec fails due to:

Failure/Error: diff(query, symbolize_keys(CGI::parse(other.query)), allow_unexpected_keys: false)
     
NoMethodError:
  undefined method `parse' for CGI:Class

How

This is an existing issue on master and I can reproduce it locally. Oddly enough bundle exec rspec <filename> does not exhibit this issue. It seems like Ruby resolves CGI class definition to cgi/util.rb and ignores cgi/core.rb >.<

> bundle exec rspec
pry(#<RSpec::ExampleGroups::PactQueryHash::Difference::WhenTheOtherIsTheSame>)> show-source CGI

From: ~/.rubies/ruby-2.3.3/lib/ruby/2.3.0/cgi/core.rb @ line 6:

> bundle exec rake
pry(#<RSpec::ExampleGroups::PactQueryHash::Difference::WhenTheOtherIsTheSame>)> show-source CGI

From: /Users/tanle/.rubies/ruby-2.3.3/lib/ruby/2.3.0/cgi/util.rb @ line 2:

What have been done

Explicitly require CGI class and ensure core.rb and util.rb are loaded in the right order.

This should fix #27.

Without this require statement, running `bundle exec rake spec` reports
undefined `parse` method on `CGI.class`. This is due to Ruby resolves
class definition to `cgi/util.rb` and ignores `cgi/core.rb` >.<
@bethesque bethesque merged commit 78335f7 into pact-foundation:master Mar 10, 2017
@bethesque
Copy link
Member

Thank you Tan :)

@tancnle tancnle deleted the fix/explicit-require-cgi branch March 14, 2017 11:45
matoro added a commit to matoro/http that referenced this pull request Jun 20, 2022
I am observing the same behavior in this test as documented in
pact-foundation/pact-support#29; applying the
same fix also fixes it here.
matoro added a commit to matoro/gentoo that referenced this pull request Jun 20, 2022
Giant push to the Ruby tree to bring up dev-ruby/http to the 5.x branch.
http-5.x changes the underlying C parser from http-parser to llhttp-ffi,
which pulls in most of the socketry async ecosystem for its tests.  All
of these packages have been tested on sparc, using all compatible Ruby
versions from ruby26 to ruby31.

KNOWN ISSUES:

* dev-ruby/async-http tests can hang on ruby27 only
* dev-ruby/dalli tests are RESTRICTed because they spin up a local
  memcached instance, which is broken on sparc (see bug 636552)
* In order to get the benefits of respect-cflags.patch for packages that
  use ffi-compiler (such as dev-ruby/llhttp-ffi), you must rebuild
  dev-ruby/ffi-compiler
* dev-ruby/ffi has two failing tests, but passes everything else.  This
  does not seem to affect functionality.  Documented in bug 847286 and
  upstream ffi/ffi#957
* dev-ruby/simplecov tests fail for ruby3x, already filed by someone
  else as bug 835620.  This may be fixed in newer upstream versions
* 5.1.0 seems to have introduced a new issue not present in 5.0.4, fix
  is simple and submitted upstream as
  httprb/http#719, courtest of
  pact-foundation/pact-support#29

Signed-off-by: matoro <matoro@users.noreply.github.com>
Closes: https://bugs.gentoo.org/766162
Bug: https://bugs.gentoo.org/761550
ixti pushed a commit to httprb/http that referenced this pull request Jun 20, 2022
I am observing the same behavior in this test as documented in
pact-foundation/pact-support#29; applying the
same fix also fixes it here.
matoro added a commit to matoro/gentoo that referenced this pull request Jun 25, 2022
Giant push to the Ruby tree to bring up dev-ruby/http to the 5.x branch.
http-5.x changes the underlying C parser from http-parser to llhttp-ffi,
which pulls in most of the socketry async ecosystem for its tests.  All
of these packages have been tested on sparc, using all compatible Ruby
versions from ruby26 to ruby31.

KNOWN ISSUES:

* dev-ruby/async-http tests can hang on ruby27 only
* dev-ruby/dalli tests are RESTRICTed because they spin up a local
  memcached instance, which is broken on sparc (see bug 636552)
* In order to get the benefits of respect-cflags.patch for packages that
  use ffi-compiler (such as dev-ruby/llhttp-ffi), you must rebuild
  dev-ruby/ffi-compiler
* dev-ruby/ffi has two failing tests, but passes everything else.  This
  does not seem to affect functionality.  Documented in bug 847286 and
  upstream ffi/ffi#957
* dev-ruby/simplecov tests fail for ruby3x, already filed by someone
  else as bug 835620.  This may be fixed in newer upstream versions
* 5.1.0 seems to have introduced a new issue not present in 5.0.4, fix
  is simple and submitted upstream as
  httprb/http#719, courtest of
  pact-foundation/pact-support#29

Signed-off-by: matoro <matoro@users.noreply.github.com>
Closes: https://bugs.gentoo.org/766162
Bug: https://bugs.gentoo.org/761550
matoro added a commit to matoro/gentoo that referenced this pull request Jul 11, 2022
Giant push to the Ruby tree to bring up dev-ruby/http to the 5.x branch.
http-5.x changes the underlying C parser from http-parser to llhttp-ffi,
which pulls in most of the socketry async ecosystem for its tests.  All
of these packages have been tested on sparc, using all compatible Ruby
versions from ruby26 to ruby31.

KNOWN ISSUES:

* dev-ruby/async-http tests can hang on ruby27 only
* dev-ruby/dalli tests are RESTRICTed because they spin up a local
  memcached instance, which is broken on sparc (see bug 636552)
* In order to get the benefits of respect-cflags.patch for packages that
  use ffi-compiler (such as dev-ruby/llhttp-ffi), you must rebuild
  dev-ruby/ffi-compiler
* dev-ruby/ffi has two failing tests, but passes everything else.  This
  does not seem to affect functionality.  Documented in bug 847286 and
  upstream ffi/ffi#957
* dev-ruby/simplecov tests fail for ruby3x, already filed by someone
  else as bug 835620.  This may be fixed in newer upstream versions
* 5.1.0 seems to have introduced a new issue not present in 5.0.4, fix
  is simple and submitted upstream as
  httprb/http#719, courtest of
  pact-foundation/pact-support#29

Signed-off-by: matoro <matoro@users.noreply.github.com>
Closes: https://bugs.gentoo.org/766162
Bug: https://bugs.gentoo.org/761550
matoro added a commit to matoro/gentoo that referenced this pull request Jul 13, 2022
Giant push to the Ruby tree to bring up dev-ruby/http to the 5.x branch.
http-5.x changes the underlying C parser from http-parser to llhttp-ffi,
which pulls in most of the socketry async ecosystem for its tests.  All
of these packages have been tested on sparc, using all compatible Ruby
versions from ruby26 to ruby31.

KNOWN ISSUES:

* dev-ruby/async-http tests can hang on ruby27 only
* dev-ruby/dalli tests are RESTRICTed because they spin up a local
  memcached instance, which is broken on sparc (see bug 636552)
* In order to get the benefits of respect-cflags.patch for packages that
  use ffi-compiler (such as dev-ruby/llhttp-ffi), you must rebuild
  dev-ruby/ffi-compiler
* dev-ruby/ffi has two failing tests, but passes everything else.  This
  does not seem to affect functionality.  Documented in bug 847286 and
  upstream ffi/ffi#957
* dev-ruby/simplecov tests fail for ruby3x, already filed by someone
  else as bug 835620.  This may be fixed in newer upstream versions
* 5.1.0 seems to have introduced a new issue not present in 5.0.4, fix
  is simple and submitted upstream as
  httprb/http#719, courtest of
  pact-foundation/pact-support#29

Closes: https://bugs.gentoo.org/766162
Bug: https://bugs.gentoo.org/761550
Signed-off-by: matoro <matoro@users.noreply.github.com>
matoro added a commit to matoro/gentoo that referenced this pull request Sep 29, 2022
Giant push to the Ruby tree to bring up dev-ruby/http to the 5.x branch.
http-5.x changes the underlying C parser from http-parser to llhttp-ffi,
which pulls in most of the socketry async ecosystem for its tests.  All
of these packages have been tested on sparc, using all compatible Ruby
versions from ruby26 to ruby31.

KNOWN ISSUES:

* dev-ruby/async-http tests can hang on ruby27 only
* dev-ruby/dalli tests are RESTRICTed because they spin up a local
  memcached instance, which is broken on sparc (see bug 636552)
* In order to get the benefits of respect-cflags.patch for packages that
  use ffi-compiler (such as dev-ruby/llhttp-ffi), you must rebuild
  dev-ruby/ffi-compiler
* dev-ruby/ffi has two failing tests, but passes everything else.  This
  does not seem to affect functionality.  Documented in bug 847286 and
  upstream ffi/ffi#957
* dev-ruby/simplecov tests fail for ruby3x, already filed by someone
  else as bug 835620.  This may be fixed in newer upstream versions
* 5.1.0 seems to have introduced a new issue not present in 5.0.4, fix
  is simple and submitted upstream as
  httprb/http#719, courtest of
  pact-foundation/pact-support#29

Closes: https://bugs.gentoo.org/766162
Bug: https://bugs.gentoo.org/761550
Signed-off-by: matoro <matoro@users.noreply.github.com>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Oct 22, 2022
Giant push to the Ruby tree to bring up dev-ruby/http to the 5.x branch.
http-5.x changes the underlying C parser from http-parser to llhttp-ffi,
which pulls in most of the socketry async ecosystem for its tests.  All
of these packages have been tested on sparc, using all compatible Ruby
versions from ruby26 to ruby31.

KNOWN ISSUES:

* dev-ruby/async-http tests can hang on ruby27 only
* dev-ruby/dalli tests are RESTRICTed because they spin up a local
  memcached instance, which is broken on sparc (see bug 636552)
* In order to get the benefits of respect-cflags.patch for packages that
  use ffi-compiler (such as dev-ruby/llhttp-ffi), you must rebuild
  dev-ruby/ffi-compiler
* dev-ruby/ffi has two failing tests, but passes everything else.  This
  does not seem to affect functionality.  Documented in bug 847286 and
  upstream ffi/ffi#957
* dev-ruby/simplecov tests fail for ruby3x, already filed by someone
  else as bug 835620.  This may be fixed in newer upstream versions
* 5.1.0 seems to have introduced a new issue not present in 5.0.4, fix
  is simple and submitted upstream as
  httprb/http#719, courtest of
  pact-foundation/pact-support#29

Closes: https://bugs.gentoo.org/766162
Bug: https://bugs.gentoo.org/761550
Signed-off-by: matoro <matoro@users.noreply.github.com>
Signed-off-by: Matt Turner <mattst88@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants