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

Add RDM tests option to OLA #48575

Closed
wants to merge 4 commits into from
Closed

Conversation

peternewman
Copy link
Contributor

@brunchboy needs to test this first; this is really just to run Travis against it and start asking some questions regarding some bits.

@peternewman
Copy link
Contributor Author

Sorry, I failed to read the contributing guidelines first, so my commit messages don't have the right prefix.

@@ -20,14 +21,15 @@ class Ola < Formula

option :universal
option "with-ftdi", "Install FTDI USB plugin for OLA."
option "with-rdm-tests", "Install RDM Tests for OLA."

depends_on "pkg-config" => :build
depends_on "cppunit"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a :test dependency flag? We only need cppunit for the tests.

Copy link
Member

Choose a reason for hiding this comment

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

No, there isn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay thanks. Any plans to do so? If I understand your bottle concept correctly, will that not still drag the test deps in, despite the fact your unlikely to bother testing the binary?

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'd like to add a TODO if there's an issue covering adding a :test dependency flag.

@brunchboy
Copy link
Contributor

Hmm… I am getting stumped as to how to test this as well. Here is the best I have been able to achieve so far, perhaps one of the maintainers can give us some help? I have gotten lost in the documentation.

➜ pn-homebrew git:(master)  brew uninstall ola
Uninstalling /usr/local/Cellar/ola/0.10.0_2... (354 files, 18.1M)
ola 0.10.0, 0.9.3, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.8_1 are still installed.
Remove them all with `brew uninstall --force ola`.
➜ pn-homebrew git:(master) brew install --with-rdm-tests https://raw.github.com/peternewman/homebrew/master/Library/Formula/ola.rb
######################################################################## 100.0%
==> Downloading https://github.com/OpenLightingProject/ola/releases/download/0.1
Already downloaded: /Library/Caches/Homebrew/ola-0.10.0.tar.gz
==> ./configure --disable-fatal-warnings --disable-silent-rules --prefix=/usr/lo
Last 15 lines from /Users/jim/Library/Logs/Homebrew/ola/01.configure:
checking for MHD_create_response_from_buffer... yes
checking for libftdi... no
checking for libusb... no
checking for libusb_error_name... no
checking for libusb_hotplug_api... no
checking for asm/termios.h... (cached) no
checking for liblo... no
checking for serial port lock directory... checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... darwin
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking for python module: google.protobuf... no
configure: error: failed to find required module google.protobuf

@@ -3,6 +3,7 @@ class Ola < Formula
homepage "https://www.openlighting.org/ola/"
url "https://github.com/OpenLightingProject/ola/releases/download/0.10.0/ola-0.10.0.tar.gz"
sha256 "cae8131a62f0ff78d399c42e64a51b610d7cf090b606704081ec9dd2cf979883"
revision 2
Copy link
Member

Choose a reason for hiding this comment

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

Don't need the revision unless we're making a breaking change here. Also would be revision 1; default is 0 and unwritten.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My reading of your docs was a revision was needed to force the build to update, or is that not the case? I simply bumped it each time I committed, as I wasn't sure what it did about freshness, or does it just git pull? Anyway removed.

@DomT4
Copy link
Member

DomT4 commented Jan 31, 2016

Uninstalling /usr/local/Cellar/ola/0.10.0_2... (354 files, 18.1M)
ola 0.10.0, 0.9.3, 0.9.5, 0.9.6, 0.9.7, 0.9.8, 0.9.8_1 are still installed.

I'd maybe consider a brew cleanup ola unless you're intentionally keeping around that many old ola versions 😸.

checking for python module: google.protobuf... no
configure: error: failed to find required module google.protobuf

Did you install protobuf without the Python bindings?

@brunchboy
Copy link
Contributor

I should probably clean up many formulas, I don’t think I have ever run brew cleanup on anything, I wasn’t really aware of the need to. 😊

I don’t remember making any specific choices when installing protobuf. It doesn’t look like it though, it seems to report that --universal was my only option selected:

➜ ~ brew info protobuf
protobuf: stable 2.6.1 (bottled), devel 3.0.0-beta-2, HEAD
Protocol buffers (Google's data interchange format)
https://github.com/google/protobuf/
/usr/local/Cellar/protobuf/2.6.1 (81 files, 12.4M) *
  Built from source with: --universal
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/protobuf.rb
==> Options
--c++11
    Build using C++11 mode
--universal
    Build a universal binary
--with-test
    Run build-time check
--without-python
    Build without python support
--devel
    Install development version 3.0.0-beta-2
--HEAD
    Install HEAD version
==> Caveats
Editor support and examples have been installed to:
  /usr/local/Cellar/protobuf/2.6.1/share/doc/protobuf

@peternewman
Copy link
Contributor Author

My reading of that brew info is it should install with python by default, or have I read that wrong?

Separate question, how do I force --with-python on protobuf when people choose the RDM tests option? Currently it's just depending on protobuf-c, which pulls in protobuf.

@peternewman
Copy link
Contributor Author

I think in the interim @brunchboy you can install protobuf --with-python, then try my Formula again and it will hopefully get further.

@brunchboy
Copy link
Contributor

@peternewman you were right, even though I thought my original reading of the brew info was the same as yours, which is that it should install with python by default. Uninstalling protobuf, reinstalling it explicitly --with-python, and then trying your formula --with-rdm-tests was successful, and this time included rdm_model_collector.py, rdm_responder_test.py, and rdm_test_server.py in the bin directory. Hopefully @DomT4 can answer your question about how to make that dependency explicit, but beyond that, things look good. (Also, thanks to him and his brew cleanup suggestion, I have recovered several gigabytes of space on my SSD. 😀 )

@brunchboy
Copy link
Contributor

Is there anything else needed from me?

@DomT4
Copy link
Member

DomT4 commented Feb 6, 2016

Ah, I completely missed the email on the notification last week. Not sure why I didn't get nudged by GitHub there. I'll look this over today, and try to look into the protobuf fun as well.

@peternewman
Copy link
Contributor Author

Thanks @DomT4 . @brunchboy we shouldn't need anything from you for the moment, apart from to ideally remove protobuf and ola and retest when it's all working.

Doing this has reminded me we don't have a Ja Rule option yet, now that's launched, so we should try and do that at some point too.

@brunchboy
Copy link
Contributor

All right, sounds good. Having overcome my superstitious fears of uninstalling and reinstalling ola and protobuf once (because they’re so critical to the project devouring my free time 😉) it will be no problem to do it again when it’s all ready.

@DomT4
Copy link
Member

DomT4 commented Feb 13, 2016

Sorry, I haven't forgotten this. Life and Homebrew are both combining to be extremely hectic, which is fun. If I don't post some kind of update here today please feel free to throw 🍅s at me.

@DomT4
Copy link
Member

DomT4 commented Feb 13, 2016

Well, my hunch was wrong. I thought perhaps passing --universal interfered in some way with generating Python bindings for Protobuf but I can't reproduce that. I'm tempted to say @brunchboy's issue was some local build problem rather than indicative of a wider problem unless others start reporting it as well.

how do I force --with-python on protobuf when people choose the RDM tests option?

At the moment, you can't. You can make people build with non-default options, but you can't make people build with default options. Really though, the amount of Homebrew users who deviate from the defaults is a minority of the user base and I can't foresee significant issues here. Hopefully not famous last words there 😉.

Need one small change in the formula but otherwise I'm happy:

if build.with? "rdm-tests"
  depends_on :python if MacOS.version <= :snow_leopard
else
  depends_on :python => :optional
end

@peternewman
Copy link
Contributor Author

Sorry @DomT4 I've been rather sidetracked too. A similar question to the other, is there an issue for adding the feature to force a --with, so I can add a comment and we can improve our fomula when it gets fixed?

Can we at least detect which --with option they've chosen and display a warning to the user, or can we only put a comment in the formula?

@DomT4
Copy link
Member

DomT4 commented Mar 2, 2016

You can check the options if you wish to, example. It's pretty rare, we tend to reserve it for cases that are known to be a regular occurrence.

@brunchboy
Copy link
Contributor

@peternewman I am still waiting for this PR to be closed before updating the formula to include OLA 0.10.1, so Homebrew is still stuck on 0.10.0. I am sure you are busy preparing for the Google Summer of Code, but is there any hope we can see this finished soon?

@DomT4
Copy link
Member

DomT4 commented Mar 25, 2016

@BrewTestBot test this please

@DomT4
Copy link
Member

DomT4 commented Mar 25, 2016

Merged in 52b37f1. Thank you for your contribution to Homebrew @peternewman; we appreciate it! 😺

@DomT4 DomT4 closed this in 52b37f1 Mar 25, 2016
depends_on "ossp-uuid"
depends_on "libusb" => :recommended
depends_on "liblo" => :recommended
depends_on :python => :optional
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this line redundant, now its been duplicated on line 44?

Copy link
Member

Choose a reason for hiding this comment

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

I chopped it in post before merging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, just spotted that. Thanks.

@peternewman
Copy link
Contributor Author

Sorry @brunchboy . Okay based on your comments @DomT4 I won't bother actively checking and we can see how people get on with it.

xu-cheng pushed a commit to Homebrew/homebrew-core that referenced this pull request Mar 26, 2016
Closes Homebrew/legacy-homebrew#48575.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
@brunchboy
Copy link
Contributor

Great, thanks, guys! I have submitted a PR to update the formula to 0.10.1.

@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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants