homebrewbcelbuck

Buck installation with brew tries to hit an invalid url and throws 404


brew install buck throws

curl: (22) The requested URL returned error: 404 Not Found
Trying a mirror...
==> Downloading https://www-us.apache.org/dist/commons/bcel/binaries/bcel-6.3.1-bin.tar.gz*

and finally gives an error

Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "ant--bcel"
Download failed: https://www-us.apache.org/dist/commons/bcel/binaries/bcel-6.3.1-bin.tar.gz*

The version bcel-6.3.1-bin.tar.gz does not exist in the binary- https://www-us.apache.org/dist/commons/bcel/binaries/

How do I get pass this?


Solution

  • Update:

    The problem has already been reported at homebrew-core. And a fix pr-44608 is waiting to be merged.

    # use the pull request temporarily
    brew install https://github.com/Homebrew/homebrew-core/raw/7f6d84a68ce8898d5f8bb1add2ed6d624cbb9598/Formula/ant.rb
    
    # install buck from facebook/homebrew-fb
    brew install buck
    

    The buck formula from tap facebook/homebrew-fb depends on formula ant. And download URL of the dependency bcel is broken in formula ant.

    You didn't do anything wrong. It's a problem on the tap side. Open an issue under homebrew/homebrew-core and report this problem to them.

    class Ant < Formula
      desc "Java build tool"
      homepage "https://ant.apache.org/"
    
      # ...
    
      resource "bcel" do
        # this url is broken, causing the build of `ant` failed
        url "https://www.apache.org/dyn/closer.cgi?path=commons/bcel/binaries/bcel-6.3.1-bin.tar.gz"
        sha256 "ed1d281cb66dedb89611019168071fe22a50ff325253e2c453dc00423905cf9d"
      end
    
    #...