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

Hard dependency on Homebrew #1191

Open
raxod502-plaid opened this issue Feb 15, 2024 · 1 comment
Open

Hard dependency on Homebrew #1191

raxod502-plaid opened this issue Feb 15, 2024 · 1 comment

Comments

@raxod502-plaid
Copy link

For some reason it seems that the watchman build system has a hard dependency on Homebrew:

% ./autogen.sh
+ PREFIX=/usr/local
+ python3 build/fbcode_builder/getdeps.py build --allow-system-packages --src-dir=. --project-install-prefix=watchman:/usr/local watchman
Building on {distro=None, distro_vers=None, fb=off, fbsource=off, os=darwin, shared_libs=off, test=on}
Testing ENV[BOOST_ROOT_1_69_0]: None
Traceback (most recent call last):
  File "/Users/rrosborough/code/watchman/build/fbcode_builder/getdeps.py", line 1376, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/rrosborough/code/watchman/build/fbcode_builder/getdeps.py", line 1359, in main
    return args.func(args)
           ^^^^^^^^^^^^^^^
  File "/Users/rrosborough/code/watchman/build/fbcode_builder/getdeps.py", line 108, in run
    self.run_project_cmd(args, loader, manifest)
  File "/Users/rrosborough/code/watchman/build/fbcode_builder/getdeps.py", line 562, in run_project_cmd
    fetcher = loader.create_fetcher(m)
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rrosborough/code/watchman/build/fbcode_builder/getdeps/load.py", line 252, in create_fetcher
    return manifest.create_fetcher(self.build_opts, ctx)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rrosborough/code/watchman/build/fbcode_builder/getdeps/manifest.py", line 423, in create_fetcher
    if package_fetcher.packages_are_installed():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rrosborough/code/watchman/build/fbcode_builder/getdeps/fetcher.py", line 180, in packages_are_installed
    proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rrosborough/.asdf/installs/python/3.11.1/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/rrosborough/.asdf/installs/python/3.11.1/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/rrosborough/.asdf/installs/python/3.11.1/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'brew'

This appears to be because there is a hardcoded assumption that all Mac users use Homebrew, which is not the case:

    def get_package_manager(self):
        if not self.is_linux() and not self.is_darwin():
            return None
        if self.is_darwin():
            return "homebrew"
        if self.distro in ("fedora", "centos", "centos_stream"):
            return "rpm"
        if self.distro.startswith(("debian", "ubuntu")):
            return "deb"
        return None

For this reason it's unclear how to build watchman on any Apple-based system without Homebrew. I would have assumed that integration with the system package manager would only be needed if I wanted dependencies to be automatically installed. But that is not what I want, I just want to compile watchman and I can install dependencies by hand.

@raxod502-plaid
Copy link
Author

Editing build/fbcode_builder/getdeps/platform.py to change return "homebrew" to return "macports" appears to work around the hard failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant