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

whatweb 0.5.5 (new formula) #140724

Closed
wants to merge 1 commit into from

Conversation

oregonpillow
Copy link

@oregonpillow oregonpillow commented Aug 28, 2023

whatweb is a ubiquitous tool used for enumeration of web servers and other IOT devices. Commonly used within penetration testing and security audits, I felt that this tool should be provided as a Brew package. A known issue is that macOS versions older than Monterey require an updated Ruby version. Therefore is is expected that running brew bot tests for whatweb will trigger an error since it wants 'depends_on' to be replaced by 'uses_from_macos'. Unless there is a better way to deal with this, I kindly ask for an exception to be made within the pipeline.

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • * Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

* there is 1 expected error running brew audit --new-formula whatweb, . My situation is similar to https://github.com/orgs/Homebrew/discussions/2208#discussioncomment-1394078 , where it was recommended to ask the maintainers for a CI exception, otherwise i'm not sure the best way to proceed. My formula needs to install a newer Ruby version for older version of macos but without replacing replace 'depends_on' with 'uses_from_macos' which the test complains about.

@github-actions github-actions bot added new formula PR adds a new formula to Homebrew/homebrew-core ruby Ruby use is a significant feature of the PR or issue labels Aug 28, 2023
@github-actions
Copy link
Contributor

Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request.

Formula/w/whatweb.rb Outdated Show resolved Hide resolved
Formula/w/whatweb.rb Outdated Show resolved Hide resolved
Comment on lines 29 to 32
system "gem", "install", "bson"
system "gem", "install", "bson_ext"
system "gem", "install", "mongo"
system "gem", "install", "rchardet"
Copy link
Member

Choose a reason for hiding this comment

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

These should be checksummed resources, not downloaded at random like this.

Copy link
Author

Choose a reason for hiding this comment

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

added checksummed resources

Copy link
Member

Choose a reason for hiding this comment

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

@oregonpillow @SMillerDev if there's a Gemfile.lock I think it's reasonable to use that instead, otherwise: yes, I agree.

Formula/w/whatweb.rb Outdated Show resolved Hide resolved
"-e", "MANPATH=#{man}"

# gem 'addressable', '~> 2.8', '>= 2.8.5'
resource "addressable" do
Copy link
Member

Choose a reason for hiding this comment

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

Put the resource blocks outside of def install. Other maintainers may agree but: if this has a Gemfile.lock it's using, I'm not convinced you need to use a resource for all of these instead of just using bundle install.

Copy link
Member

Choose a reason for hiding this comment

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

Previous iterations of the formulae added gems after the bundler run. That's why I suggested resources.

Copy link
Member

Choose a reason for hiding this comment

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

Yeh, I'm pretty confused as to why these gems would be manually installed like this rather than using system "bundle", "install", "--local", "--path=#{libexec}/vendor" or something (like other Ruby formulae do).

@oregonpillow oregonpillow force-pushed the whatweb-0.5.5 branch 4 times, most recently from 9fe88a1 to f4ca945 Compare September 11, 2023 11:42
Comment on lines 15 to 17
system "bundle", "config", "--local", "#{libexec}/whatweb"
system "bundle", "update"
system "bundle", "install"
system "make", "install",
Copy link
Member

Choose a reason for hiding this comment

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

To allow bundler installs the repo should have a Gemfile.lock

@oregonpillow oregonpillow force-pushed the whatweb-0.5.5 branch 3 times, most recently from d503bdb to 86b14d4 Compare September 11, 2023 12:08
system "gem", "install", "bundler"
ENV.prepend_path "PATH", buildpath/"gem_home/bin"
system "bundle", "config", "--local", "#{libexec}/whatweb"
system "bundle", "update"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
system "bundle", "update"

We want to use the versions in Gemfile.lock here.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @MikeMcQuaid ok i will remove this, i put it there as a last ditch effort for a job i'm having trouble with.

This job keeps failing due to a missing gem addressable, which doesn't make sense to me since it's included in the Gemfile. I also tried testing the forumula on my mac computer and a Debian 10 system and they don't have this problem. I don't know if this is a CI problem or a problem for the venfor

"-e", "MANPATH=#{man}"
end

test do
Copy link
Member

Choose a reason for hiding this comment

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

Looks like https://github.com/urbanadventurer/WhatWeb/blob/master/Gemfile is missing a Gemfile.lock and that perhaps is why addressable isn't being installed as expected. I'd suggest perhaps making a PR to add one but there's been no PRs merged since 2021 so I'm wondering if this project is maintained at all any more, unfortunately.

@chenrui333
Copy link
Member

  ==> /opt/homebrew/Cellar/whatweb/0.5.5/bin/whatweb --log-json=test.json --verbose --color=never google.com
  WhatWeb is not installed and is missing dependencies.
  The following gems are missing:
   - addressable
  
  To install run the following command from the WhatWeb folder:
  'bundle install'
  
  Error: whatweb: failed
  An exception occurred within a child process:
    Minitest::Assertion: Expected: 0
    Actual: 1

@chenrui333 chenrui333 added the test failure CI fails while running the test-do block label Sep 20, 2023
@oregonpillow
Copy link
Author


  ==> /opt/homebrew/Cellar/whatweb/0.5.5/bin/whatweb --log-json=test.json --verbose --color=never google.com

  WhatWeb is not installed and is missing dependencies.

  The following gems are missing:

   - addressable

  

  To install run the following command from the WhatWeb folder:

  'bundle install'

  

  Error: whatweb: failed

  An exception occurred within a child process:

    Minitest::Assertion: Expected: 0

    Actual: 1

Thanks. I'm aware of this error. The problem is despite 'addressable' being listed in the gem file, bundle will not install it and I haven't figured why it's doing this, or how to fix it.

@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Oct 11, 2023
@github-actions github-actions bot closed this Oct 19, 2023
@github-actions github-actions bot added the outdated PR was locked due to age label Nov 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2023
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 outdated PR was locked due to age ruby Ruby use is a significant feature of the PR or issue stale No recent activity test failure CI fails while running the test-do block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants