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

pacparser 1.3.7 (new formula) #5661

Closed
wants to merge 1 commit into from

Conversation

aaronhurt
Copy link
Contributor

@aaronhurt aaronhurt commented Oct 7, 2016

Adding pacparser (github.com/pacparser/pacparser). A library to parse proxy auto-config (PAC) files.

depends_on "python" => :optional

def install
system "make", "-j1", "-C", "src", "install",
Copy link
Member

Choose a reason for hiding this comment

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

Does this not work with a parallel build?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it doesn't. It's a known issue. I disable that for my Alpine Linux build of this as well.

manugarg/pacparser#27

Copy link
Member

Choose a reason for hiding this comment

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

Use ENV.deparallelize and add a link to the upstream issue and a comment in Ruby to clarify.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, committed and squished.


test do
## functional tests are run as part of the make
assert_equal version.to_s, shell_output("#{bin}/pactester -v").strip
Copy link
Member

Choose a reason for hiding this comment

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

Can this test be modified to do something more substantial than e.g. --version or --help e.g. parse a simple, embedded PAC file? See cmake.rb for an example of an application formula with a good test and tinyxml2.rb for an example of a library formula with a good test. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The upstream package has test cases that are run at the end of the make. Those tests are -pure functional tests and do run through example PAC files. If/when those tests fail the entire build will fail.

Copy link
Member

Choose a reason for hiding this comment

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

This is not a test of the software compilation but a test that it's been installed by Homebrew properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then I guess I'm confused as why a simple "it executes" isn't sufficient for this section if all it is testing is that the binary is in the proper location and executes? Like I said there are a series of actual functional tests run during the make process. I could replicate those in the test section of the package but it seems a bit redundant to run them twice.

Copy link
Member

Choose a reason for hiding this comment

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

We've found --version is often not sufficient to identify packaging bugs compared to a functional/integration test. Duplicating a single functional test here would be 👍

# Disable parallel build due to upstream concurrency issue.
# https://github.com/pacparser/pacparser/issues/27
ENV.deparallelize
system "make", "-j1", "-C", "src", "install",
Copy link
Member

Choose a reason for hiding this comment

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

Can remove the -j1 now. Additionally, a Dir.chdir "src" will save needing to repeat it below. You may also want to use a ENV["VERSION"] = version to avoid setting that twice, too.

Copy link
Contributor Author

@aaronhurt aaronhurt Oct 9, 2016

Choose a reason for hiding this comment

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

No problem, I can change that. Squished and pushed.

@zmwangx zmwangx added new formula PR adds a new formula to Homebrew/homebrew-core needs response Needs a response from the issue/PR author labels Oct 13, 2016
class Pacparser < Formula
desc "Library to parse proxy auto-config (PAC) files"
homepage "https://github.com/pacparser/pacparser"
url "https://github.com/pacparser/pacparser/archive/1.3.6.tar.gz"
Copy link
Contributor

Choose a reason for hiding this comment

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

@leprechau Thanks for adding pacparser to homebrew. I have no idea of how homebrew formula files work. Is it possible for the formula to auto-track pacparser releases (for example, I just cut a new release - 1.3.7).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@manugarg np, I need to finish up this PR with the requested tests and I'll update to 1.3.7 at the same time. We use pacparser in our go applications with my go-pacparser wrapper. Thank you for the time and effort developing the library and test tool.

Copy link
Contributor

Choose a reason for hiding this comment

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

@leprechau Sounds good. Thanks!

Copy link
Contributor Author

@aaronhurt aaronhurt Oct 19, 2016

Choose a reason for hiding this comment

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

Been a bit tied up with other projects the last few days but I will get this updated, hopefully this week. I haven't forgotten about it yet ;p

@BrewTestBot BrewTestBot removed the needs response Needs a response from the issue/PR author label Oct 19, 2016
@dunn dunn added the needs response Needs a response from the issue/PR author label Oct 26, 2016
@BrewTestBot BrewTestBot removed the needs response Needs a response from the issue/PR author label Oct 28, 2016
@aaronhurt
Copy link
Contributor Author

@MikeMcQuaid @manugarg updated to 1.3.7 and replicated the test cases in the test section of the formula

@aaronhurt aaronhurt changed the title pacparser 1.3.6 (new formula) pacparser 1.3.7 (new formula) Oct 28, 2016
Adding pacparser (github.com/pacparser/pacparser).  A library to parse
proxy auto-config (PAC) files.
@aaronhurt
Copy link
Contributor Author

squished and pushed as a single commit

@MikeMcQuaid
Copy link
Member

Thanks for your contribution to Homebrew! Without people like you submitting PRs we couldn't run this project. You rock!

@aaronhurt aaronhurt deleted the new/pacparser branch November 10, 2016 16:13
@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
new formula PR adds a new formula to Homebrew/homebrew-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants