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

Fold geocouch in to couchdb formula #475

Closed
wants to merge 1 commit into from

Conversation

apjanke
Copy link
Contributor

@apjanke apjanke commented Apr 20, 2016

Checklist

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same formula update/change?
  • Does your submission pass brew audit --strict --online <formula> (where <formula> is the name of the formula you're submitting)?
  • Have you built your formula locally prior to submission with brew install <formula>?

References

Closes #436
Fixes #471
Fixes "geocouch" item in #342

Description

Fixes issues with couchdb/geocouch's installation model not working under Homebrew sandboxing.

This makes geocouch an option of the couchdb formula instead of its own separate formula, because couchdb/geocouch's installation model really wants some of those files to be under couchdb's installation hierarchy.

Leaves a placeholder geocouch formula around. This is so users with an existing geocouch installation will have easy access to the caveats when it stops working and they're wondering what happened. Also so a brew update; brew upgrade results in removal of the old geocouch files, which may conflict with a new geocouch-enabled couchdb installation.

The geocouch option is off by default because GeoCouch is considered "experimental" (from what I can see while Googling) and is of lower quality/stability than CouchDB itself, so we probably don't want it on by default. Otherwise, I would have made it recommended, to provide continuity for existing users of geocouch, who would have then automatically picked it up in the upgrade to the next couchdb version at the same time geocouch became a placeholder or disappeared.

The geocouch placeholder formula can be boneyarded after a few months, once all GeoCouch users are likely to have gone through an upgrade cycle.

Testing

I'm not sure this actually works, because I couldn't find a simple way to test the GeoCouch components of CouchDB. The GeoCouch readme says to just run the test suite. But that won't really catch it, because if the installation didn't work, then the GeoCouch tests might not have been properly added to the CouchDB test suite, and you wouldn't really be testing it.

Is there a GeoCouch user who can explain how to do a "Hello World" exercising the GeoCouch extension?

@@ -68,6 +77,52 @@ def install
(var/"run/couchdb").mkpath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want to put these (var/...).mkpath in post_install.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving to post_install.

@xu-cheng
Copy link
Member

👍

@apjanke apjanke force-pushed the geocouch-as-couchdb-option branch 2 times, most recently from 0a4048d to 44e14a3 Compare April 20, 2016 05:47
@xu-cheng xu-cheng added the maintainer feedback Additional maintainers' opinions may be needed label Apr 20, 2016
depends_on "spidermonkey"
depends_on "icu4c"
depends_on "erlang"
depends_on "curl" if MacOS.version <= :leopard

resource "geocouch" do
url "https://codeload.github.com/couchbase/geocouch/tar.gz/couchdb1.3.x"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer GitHub archive rather than codeload URLs. We should probably add an audit for that. Also, do we not have a tagged release we can use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this formula, the archive URL was redirecting to this one. If I didn't replace it for the resource usage, I was getting a SHA mismatch error.

I'll try the archive URL again; maybe it was something I was doing wrong locally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that may be some weirdness using a branch tarball.

Copy link
Member

@DomT4 DomT4 Apr 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's cleaner to use a git checkout, branch and revision. It breaks our audit rule about using tags and revisions together but it should prevent the checksum breaking every time they push a new commit in that branch at least.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on checkout and revision if upstream don't provide tags we can use 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might have been a transient issue or mistake on my part. The GitHub archive link is working again. Switched back to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think using the branch and revision is a better idea, personally. It's not a "real" archive tarball as such, and if they push another commit to that branch we'll get a checksum failure again. Just seems like unnecessary future hassle for something we can prevent today.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Switched to using git with branch/revision instead of the branch tarball.

@apjanke
Copy link
Contributor Author

apjanke commented Apr 20, 2016

Amended to remove geocuch instead of making it a placeholder.

Most of the other feedback makes sense; will address that too.

@apjanke apjanke added the needs response Needs a response from the issue/PR author label Apr 20, 2016
@apjanke apjanke self-assigned this Apr 23, 2016
@@ -78,13 +133,68 @@ def post_install
end
end

def caveats; <<-EOS.undent
def caveats
str = <<-EOS.undent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoying nit but we tend to use a simple s rather than str for caveats like these across formulae.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

@ghost ghost removed the needs response Needs a response from the issue/PR author label Apr 24, 2016
@apjanke apjanke force-pushed the geocouch-as-couchdb-option branch 6 times, most recently from 7e8a4f6 to 682fc95 Compare April 24, 2016 06:57
@apjanke
Copy link
Contributor Author

apjanke commented Apr 24, 2016

Updated to address most of the feedback. Seems ready: it builds and passes test, though I wish we had a better test for the geocouch part.

<true/>
</dict>
</plist>
To see these instructions again, just run 'brew info couchdb'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can probably kill all these geocouch caveats; they either aren't Homebrew specific or apply to most Homebrew formulae.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True: the port 5984 is a couchdb default, and the rest is brew's normal functioning, now that we've folded geocouch in as an option and it's not doing the sandbox-violating cross-formula install. Removing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I killed all the remaining caveats, too, since they were just instructions on how to test couchdb, and that should go in, well, the test definition. Converted them to actual test steps so now there's no caveats, and the test does more checking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@MikeMcQuaid
Copy link
Member

This is looking good; almost there.

@apjanke apjanke force-pushed the geocouch-as-couchdb-option branch 3 times, most recently from 209693a to e8b029c Compare April 24, 2016 18:46
@apjanke
Copy link
Contributor Author

apjanke commented Apr 25, 2016

Test failed on Mavericks only. Which is weird, because that's what I tested it on locally, and it worked fine. Didn't try it under test-bot, though. Will look in to it.

Error Message

failed: brew test couchdb --verbose

Stacktrace

        Testing couchdb
==> Using the sandbox
/usr/bin/sandbox-exec -f /tmp/homebrew20160424-46760-1w3m6y3-0.sb /Users/brewadmin/Homebrew/Cellar/ruby187/1.8.7-p374_1/bin/ruby -W0 -I /usr/local/Library/Homebrew -- /usr/local/Library/Homebrew/test.rb /usr/local/Library/Taps/homebrew/homebrew-core/Formula/couchdb.rb --verbose
==> /usr/local/Cellar/couchdb/1.6.1_5/bin/couchjs -h
Usage: couchjs [FILE]

The couchjs command runs the Apache CouchDB JavaScript interpreter.

The exit status is 0 for success or 1 for failure.

Options:

  -h          display a short help message and exit
  -V          display version information and exit
  -H          enable couchjs cURL bindings (only avaiable
              if package was built with cURL available)
  -S SIZE     specify that the runtime should allow at
              most SIZE bytes of memory to be allocated
  -u FILE     path to a .uri file containing the address
              (or addresses) of one or more servers

Report bugs at <https://issues.apache.org/jira/browse/COUCHDB>.
Apache CouchDB 1.6.1 (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
[info] [<0.32.0>] Apache CouchDB has started on http://127.0.0.1:5984/
==> curl --silent localhost:5984
[info] [<0.101.0>] 127.0.0.1 - - GET / 200
Error: couchdb: failed
<#<PkgVersion:0x106ea8fb0
 @revision=5,
 @version=#<Version::FromURL:0x106f17d48 @version="1.6.1">>> expected to be =~
</1\.6\.1_5/>.

@apjanke apjanke added the needs response Needs a response from the issue/PR author label Apr 25, 2016
@MikeMcQuaid
Copy link
Member

@apjanke Any news on this? Would be great to get it merged in, even if restricted to Yosemite and above.

@xu-cheng xu-cheng mentioned this pull request Jun 21, 2016
53 tasks
@apjanke apjanke force-pushed the geocouch-as-couchdb-option branch from e8b029c to 96a78a9 Compare June 29, 2016 12:41
@ghost ghost removed the needs response Needs a response from the issue/PR author label Jun 29, 2016
Fixes issues with couchdb/geocouch's installation model not working
with Homebrew sandboxing.

Closes Homebrew#436
Fixes Homebrew#471
@apjanke apjanke force-pushed the geocouch-as-couchdb-option branch from 96a78a9 to 87bd094 Compare June 29, 2016 13:02
@apjanke
Copy link
Contributor Author

apjanke commented Jun 29, 2016

I took another look at this, and I don't even know why it ran the test the way it did. Here's the failing test message.

==> curl --silent localhost:5984
[info] [<0.101.0>] 127.0.0.1 - - GET / 200
Error: couchdb: failed
<#<PkgVersion:0x106ea8fb0
 @revision=5,
 @version=#<Version::FromURL:0x106f17d48 @version="1.6.1">>> expected to be =~
</1\.6\.1_5/>.

But the current test code isn't even matching against a version number; it's matching against /Homebrew/. And it's not passing --silent to curl.

      assert_match /Homebrew/, shell_output("curl -# localhost:5984")

Maybe it was something weird with the Mavericks test-bot's state. brew test-bot ... couchdb passed for me locally on Mavericks against this PR.

I amended this PR with a couple audit fixes and rebased on master. That'll kick off another test run and we'll see if the failure is repeatable.

@apjanke
Copy link
Contributor Author

apjanke commented Jun 29, 2016

It passed this time. I'm going to tentatively chalk that previous failure up to some odd state on the Mavericks test bot.

Look okay to merge now?

@MikeMcQuaid
Copy link
Member

Look okay to merge now?

👍

@apjanke apjanke closed this in 8c13fc2 Jul 2, 2016
@apjanke apjanke deleted the geocouch-as-couchdb-option branch July 14, 2016 17:27
@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
maintainer feedback Additional maintainers' opinions may be needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants