Navigation Menu

Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Update to groonga version to 5.1.1 and always bundle groonga-normalizer-mysql to groonga #47472

Closed
wants to merge 5 commits into from

Conversation

cosmo0920
Copy link
Contributor

No description provided.

@MikeMcQuaid
Copy link
Member

There's some tests failing on Mavericks? Maybe they just need updated.

@apjanke
Copy link
Contributor

apjanke commented Dec 29, 2015

Here's the failing test.

==> brew test --verbose groonga
Testing groonga
==> Using the sandbox
/usr/bin/sandbox-exec -f /tmp/homebrew20151229-28799-1e3yyj6-0.sb /usr/local/Cellar/ruby187/1.8.7-p374_1/bin/ruby -W0 -I /usr/local/Library/Homebrew -- /usr/local/Library/Homebrew/test.rb /usr/local/Library/Formula/groonga.rb --verbose
Error: groonga: failed
<"[[0,1451353445.91227,0.00238299369812012],true]\n"> expected to be =~
</[[0,\d+.\d+,\d+.\d+],true]/>.
==> FAILED

It passes on my local Mavericks box; I can't tell why it's failing just on the Mavericks test boxes. But I think I see an issue. Here's the test.

    # expected returned result is like this:
    # [[0,1447502555.38667,0.000824928283691406],true]\n
    assert_match(/[[0,\d+.\d+,\d+.\d+],true]/, io.read)

That regex isn't doing what it's intended to. Brackets are special in regexes; they define character classes. If you change the test to this:

    assert_match(/[this is bogus[0,\d+.\d+,\d+.\d+],true]/, io.read)

then it still passes. The brackets should be escaped with backslashes.

    assert_match(/\[\[0,\d+.\d+,\d+.\d+\],true\]/, io.read)

Same with the test in groonga-normalizer-mysql. Though it looks like it also has a real failure, too.

==> brew test --verbose groonga-normalizer-mysql
Testing groonga-normalizer-mysql
==> Using the sandbox
/usr/bin/sandbox-exec -f /tmp/homebrew20151229-28861-1i8ht7f-0.sb /usr/local/Cellar/ruby187/1.8.7-p374_1/bin/ruby -W0 -I /usr/local/Library/Homebrew -- /usr/local/Library/Homebrew/test.rb /usr/local/Library/Formula/groonga-normalizer-mysql.rb --verbose
Error: groonga-normalizer-mysql: failed
<"[[-3,1451353450.48176,0.000321149826049805,\"[plugin][register] cannot find plugin file: </usr/local/Cellar/groonga/5.1.1/lib/groonga/plugins/normalizers/mysql.so>\",[[\"grn_plugin_set_name_resolve_error\",\"plugin.c\",727]]],false]\n"> expected to be =~
</[[0,\d+.\d+,\d+.\d+],true]/>.

That looks like groonga expects the plugin to be installed in its Cellar, instead of linked under the main brew prefix. That test should also be failing on 10.10 and 10.11, but is getting a false negative because of the erroneous regex. It's not a regression, either: if you change the test like below, you can see that the same plugin load failure is happening with the current 5.1.0 version of groonga, too. May need to fiddle with the formulae to relocate groonga's plugin dir location.

      # [[0,1447502555.38667,0.000824928283691406],true]\n
      str = io.read
      puts str
      assert_match(/[[0,\d+.\d+,\d+.\d+],true]/, str)

@cosmo0920
Copy link
Contributor Author

That looks like groonga expects the plugin to be installed in its Cellar, instead of linked under the main brew prefix.

Yes, Groonga assumes that its plugins are installed in its Cellar's plugin directory by default.

Should I fix groonga-normailzer-mysql test in this PR?

@apjanke
Copy link
Contributor

apjanke commented Dec 31, 2015

This sounds like something that will have to be changed in groonga itself. Homebrew's sandboxing principle is that only the formula itself should be able to install files in to that formula's cellar. Shared files should be linked in to some common area. Have a look at #47245, which addressed a similar plugin-installation issue with QT4.

@cosmo0920
Copy link
Contributor Author

Groonga does not have a functionality to change plugin load path. I cannot accept #47245 style fix.

@MikeMcQuaid
Copy link
Member

The alternative is plugins are installed using with-$PLUGIN style options in the groonga formula.

@cosmo0920
Copy link
Contributor Author

My idea is ... groonga-normalizer-mysql should be always bundled as resources in groonga formula.
Because groonga-normalizer-mysql plugin is useful but it does not update frequently as groonga.

@MikeMcQuaid
Copy link
Member

My idea is ... groonga-normalizer-mysql should be always bundled as resources in groonga formula.
Because groonga-normalizer-mysql plugin is useful but it does not update frequently as groonga.

@cosmo0920 Sounds good 👍

@cosmo0920 cosmo0920 changed the title groonga 5.1.1 Update to groonga version to 5.1.1 and always bundle groonga-normalizer-mysql to groonga Jan 4, 2016
@cosmo0920
Copy link
Contributor Author

Should I add caveat to announce to be abandoned groonga-normalizer-mysql and unified into groonga formula?

@DomT4
Copy link
Member

DomT4 commented Jan 12, 2016

It may potentially be a case for link_overwrite so people don't see linking errors, if they will, on upgrade.

@cosmo0920
Copy link
Contributor Author

I added link_overwrite for paths which should be overwritten.

Now, I got success upgrading Groonga with brew command in my environment like this:

% brew upgrade groonga
==> Upgrading 1 outdated package, with result:
groonga 5.1.1
==> Upgrading groonga
==> Downloading https://homebrew.bintray.com/bottles/groonga-5.1.1.el_capitan.bo

curl: (22) The requested URL returned error: 401 Unauthorized
Error: Failed to download resource "groonga"
Download failed: https://homebrew.bintray.com/bottles/groonga-5.1.1.el_capitan.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://packages.groonga.org/source/groonga/groonga-5.1.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/groonga-5.1.1.tar.gz
==> ./configure --prefix=/usr/local/Cellar/groonga/5.1.1 --with-zlib --enable-mr
==> make install
==> Downloading http://packages.groonga.org/source/groonga-normalizer-mysql/groo
Already downloaded: /Library/Caches/Homebrew/groonga--groonga-normalizer-mysql-1.1.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/groonga/5.1.1
==> make
==> make install
Warning: These files were overwritten during `brew link` step:
/usr/local/share/doc/groonga-normalizer-mysql/README.md
/usr/local/share/doc/groonga-normalizer-mysql/lgpl-2.0.txt
/usr/local/share/doc/groonga-normalizer-mysql/news.md
/usr/local/lib/groonga/plugins/normalizers/mysql.a
/usr/local/lib/groonga/plugins/normalizers/mysql.so
/usr/local/lib/pkgconfig/groonga-normalizer-mysql.pc

They have been backed up in /Library/Caches/Homebrew/Backup
==> Summary
🍺  /usr/local/Cellar/groonga/5.1.1: 1146 files, 28M, built in 6 minutes 26 seconds

@DomT4
Copy link
Member

DomT4 commented Jan 14, 2016

Merged in b59da2a & eb7a54c. Thank you for your contributions to Homebrew @cosmo0920! 😺

@DomT4 DomT4 closed this in eb7a54c Jan 14, 2016
@cosmo0920
Copy link
Contributor Author

Yay! Thanks for your advice!

@cosmo0920 cosmo0920 deleted the groonga-5.1.1 branch January 14, 2016 04:38
cosmo0920 added a commit to mroonga/homebrew-mroonga that referenced this pull request Jan 29, 2016
Because this formula has been bundled in groonga formula in this PR:
Homebrew/legacy-homebrew#47472
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants