Open isker opened 4 years ago
Nevermind Boost, it's a transitive dep of folly:
Ξ» brew deps --include-build --tree watchman
watchman
βββ autoconf
βββ automake
β βββ autoconf
βββ libtool
βββ pkg-config
βββ folly
β βββ cmake
β β βββ sphinx-doc
β β βββ python@3.8
β β βββ pkg-config
β β βββ gdbm
β β βββ openssl@1.1
β β βββ readline
β β βββ sqlite
β β β βββ readline
β β βββ xz
β βββ pkg-config
β βββ boost
β β βββ icu4c
β βββ double-conversion
β β βββ cmake
β β βββ sphinx-doc
β β βββ python@3.8
β β βββ pkg-config
β β βββ gdbm
β β βββ openssl@1.1
β β βββ readline
β β βββ sqlite
β β β βββ readline
β β βββ xz
β βββ fmt
β β βββ cmake
β β βββ sphinx-doc
β β βββ python@3.8
β β βββ pkg-config
β β βββ gdbm
β β βββ openssl@1.1
β β βββ readline
β β βββ sqlite
β β β βββ readline
β β βββ xz
β βββ gflags
β β βββ cmake
β β βββ sphinx-doc
β β βββ python@3.8
β β βββ pkg-config
β β βββ gdbm
β β βββ openssl@1.1
β β βββ readline
β β βββ sqlite
β β β βββ readline
β β βββ xz
β βββ glog
β β βββ cmake
β β β βββ sphinx-doc
β β β βββ python@3.8
β β β βββ pkg-config
β β β βββ gdbm
β β β βββ openssl@1.1
β β β βββ readline
β β β βββ sqlite
β β β β βββ readline
β β β βββ xz
β β βββ gflags
β β βββ cmake
β β βββ sphinx-doc
β β βββ python@3.8
β β βββ pkg-config
β β βββ gdbm
β β βββ openssl@1.1
β β βββ readline
β β βββ sqlite
β β β βββ readline
β β βββ xz
β βββ libevent
β β βββ autoconf
β β βββ automake
β β β βββ autoconf
β β βββ libtool
β β βββ pkg-config
β β βββ openssl@1.1
β βββ lz4
β βββ openssl@1.1
β βββ snappy
β β βββ cmake
β β β βββ sphinx-doc
β β β βββ python@3.8
β β β βββ pkg-config
β β β βββ gdbm
β β β βββ openssl@1.1
β β β βββ readline
β β β βββ sqlite
β β β β βββ readline
β β β βββ xz
β β βββ pkg-config
β βββ xz
β βββ zstd
β βββ cmake
β βββ sphinx-doc
β βββ python@3.8
β βββ pkg-config
β βββ gdbm
β βββ openssl@1.1
β βββ readline
β βββ sqlite
β β βββ readline
β βββ xz
βββ openssl@1.1
βββ pcre
βββ python@3.8
βββ pkg-config
βββ gdbm
βββ openssl@1.1
βββ readline
βββ sqlite
β βββ readline
βββ xz
Though judging by the list from CI, some deps like ninja are still missing from the formula. https://github.com/facebook/watchman/blob/ebdade398e26e87e73b5aa82e287503bdfcf1f5a/.github/workflows/getdeps_mac.yml#L20-L72
This issue might be related/of interest: https://github.com/facebook/watchman/issues/839
Thanks for taking a look at this!
I think fixing up the homebrew formula in core homebrew is probably quite difficult.
The easiest way to build watchman from master today is using our getdeps machinery. That is responsible for fetching, building and composing the dependencies. This is at odds with homebrew's own dependency management, so a proper update to the homebrew formula probably should not use the getdeps stuff.
Another challenge here is that watchman depends on folly
and fbthrift
and all of those projects use a continuous delivery model in the internal single source repository where they all reside. When we export to github those projects are mapped to separate projects that are hard to relate to each other. We have another piece of infrastructure that will cut a weekly tag to try to form a consistent relationship, but due to the nature of continuous delivery, any of those projects might not actually be buildable with each other due to various transient bugs.
I've been copied on numerous issues in the folly repo over the past few years where folks have been working to resolve build issues that block updating the folly homebrew formula, so I sense that this might turn into an ongoing/uphill battle to keep the formula working.
What I've been leaning towards as a solution for this is to effectively move watchman out of homebrew core and manage it via our taps repo at https://github.com/facebook/homebrew-fb.
We could automatically update the tap as part of our weekly release automation and have it install the most recently successful macos binary build published to our releases section.
This feels like less work for everyone overall, and I have made a proof of concept of this approach in a personal project: https://github.com/wez/wezterm/blob/master/.github/workflows/gen_macos_tag.yml#L85-L108 which updates a tab formula here: https://github.com/wez/homebrew-wezterm/blob/master/Formula/wezterm.rb
I haven't had an opportunity to sit down and make this happen so far, but if you're feeling motivated and have the bandwidth for it, we'd love to see you submit a couple of PRs for this.
What I think needs to happen:
/opt/facebook/watchman
to avoid problems with collisions under /usr/local
Then we can look at deprecating the homebrew core formula. I think that this will result in something that is easier to maintain overall.
What do you think?
This sounds reasonable. Monorepos are The Way π.
I'm confused about what the collisions/opt
part is for though. Won't homebrew link it straight into /usr/local/bin when installing anyway?
I'm confused about what the collisions/
opt
part is for though. Won't homebrew link it straight into /usr/local/bin when installing anyway?
By default, yes, but for example: at FB we have a site specific homebrew deployment set to deploy to /opt/homebrew
and there's some other complicated chef stuff happening that manages /usr/local/bin
and its permissions which makes it frustrating to use their own user specific stock homebrew. Some people choose to do that anyway, and others do a per-user install. If we hard code /usr/local/bin
into the binaries then we make it difficult to co-exist with other configurations of homebrew, the current core brew formula or other distribution systems.
Outside of homebrew/mac, some users have commented that they'd appreciate having the linux binaries not deploy /usr/local
so that they can do things like mount them via NFS more easily.
So, here's where my inexperience with native {builds,packaging,anything at all} fails me: why would the prefix get baked into the binaries at all? I thought that the prefix was just to tell make install
where to copy the binaries.
I set up the formula at https://github.com/facebook/homebrew-fb/pull/41.
hey folks, trying to catch up on this whole conversation; it sounds like, per @isker PR merged last week by @kapji: https://github.com/facebook/homebrew-fb/pull/41 now if someone wants to install watchman via homebrew and not get stuck on the 2017's 4.9.0 version they'd need to:
brew tap facebook/fb
brew install facebook/fb/watchman
correct?
The side problem I'm seeing about this is that @isker's PR "hardcoded" the version in the .rb file to v2020.08.17.00
, which at this point is fairly old too (6+ months). Is there a way to update that automatically when a new version is out? Or is the expectation that someone will always have to manually go and override that line in the config?
PS: btw @isker thank you SO MUCH for deciding to drive this problem and make that PR ππ
As for now, it needs to be maintained manually. Feel free to send PR for the new version.
The intent was that, after that initial formula was merged, I would add a script to the release CI tooling for this project that would automatically update the version in that formula and commit.
However that initial PR sat for about 5 months and I no longer have much interest in driving the remaining work. Feel free to pick it up.
On Thu, Feb 18, 2021 at 07:02 Ruslan Sayfutdinov notifications@github.com wrote:
As for now, it needs to be maintained manually. Feel free to send PR for the new version.
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/facebook/watchman/issues/851#issuecomment-781295200, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH3ZNJGRGEPY3X3NFUSK3LS7T6WBANCNFSM4QK66WAA .
I think I can set up the GitHub action to automatically send PR to the Facebook repo updating the version every release.
Buck has this implemented here: https://github.com/facebook/buck/blob/master/tools/release/platforms/homebrew.py You can make something similar.
that would be great @fanzeyi π do you know if/when you'll be able to do it?
@kelset maybe later this week. Will update soon =)
Some update, I have a version working and it opened a PR here https://github.com/facebook/homebrew-fb/pull/56 in my testing. I'm now waiting on our open source team for a bot token I can use to make these commits :)
dope π lmk once it works :) I'm planning to do a PR for the react-native docs once it's all set up :)
@fanzeyi any updates on this?
Hello @wez! As per https://github.com/facebook/watchman/issues/665#issuecomment-465404481 I am trying to get the homebrew formula building again. Sadly my knowledge of: homebrew internals; watchman; and native toolchains of any kind are all pretty poor π .
I made the suggested changes to the formula:
But
getdeps.py
is, well, still trying to get all of the deps. Right now it's trying and failing to build openssl. I'm not sure why, but I'm pretty sure it shouldn't be trying to build it in the first place.OpenSSL build error
``` Assessing openssl... Download https://www.openssl.org/source/openssl-1.1.1f.tar.gz -> /private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/downloads/openssl-openssl-1.1.1f.tar.gz ... .. 0 of 9792828 [Complete in 0.834120 seconds] --- + cd /private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/build/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c && \ + /usr/bin/perl \ + /private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/extracted/openssl-openssl-1.1.1f.tar.gz/openssl-1.1.1f/Configure \ + --prefix=/private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/installed/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c \ + --openssldir=/private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/installed/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c \ + darwin64-x86_64-cc \ + enable-static-engine \ + enable-capieng \ + no-makedepend \ + no-unit-test \ + no-tests Configuring OpenSSL version 1.1.1f (0x1010106fL) for darwin64-x86_64-cc Using os-specific seed configuration Creating configdata.pm Creating Makefile ********************************************************************** *** *** *** OpenSSL has been successfully configured *** *** *** *** If you encounter a problem while building, please open an *** *** issue on GitHub ***
*** and include the output from the following command: ***
*** ***
*** perl configdata.pm --dump ***
*** ***
*** (If you are new to OpenSSL, you might want to consult the ***
*** 'Troubleshooting' section in the INSTALL file first) ***
*** ***
**********************************************************************
---
+ cd /private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/build/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c && \
+ make \
+ install_sw \
+ install_ssldirs
/usr/bin/perl "-I." -Mconfigdata "../../extracted/openssl-openssl-1.1.1f.tar.gz/openssl-1.1.1f/util/dofile.pl" \
"-oMakefile" ../../extracted/openssl-openssl-1.1.1f.tar.gz/openssl-1.1.1f/include/crypto/bn_conf.h.in > include/crypto/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "../../extracted/openssl-openssl-1.1.1f.tar.gz/openssl-1.1.1f/util/dofile.pl" \
"-oMakefile" ../../extracted/openssl-openssl-1.1.1f.tar.gz/openssl-1.1.1f/include/crypto/dso_conf.h.in > include/crypto/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "../../extracted/openssl-openssl-1.1.1f.tar.gz/openssl-1.1.1f/util/dofile.pl" \
"-oMakefile" ../../extracted/openssl-openssl-1.1.1f.tar.gz/openssl-1.1.1f/include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
created directory `/private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/installed/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c'
created directory `/private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/installed/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c/certs'
created directory `/private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/installed/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c/private'
created directory `/private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/installed/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c/misc'
Command '['make', 'install_sw', 'install_ssldirs']' returned non-zero exit status 2.
!! Failed
install ./apps/CA.pl -> /private/tmp/fbcode_builder_getdeps-ZprivateZtmpZwatchman-20200825-72628-nwvu33Zwatchman-2020.08.17.00ZbuildZfbcode_builder/installed/openssl-UtXLnJ2t0v50wqKwl2XtYbrqHH1o2BVeZQYDPt0Ta_c/misc/CA.pl
cp: ./apps/CA.pl: No such file or directory
make: *** [install_ssldirs] Error 1
make: *** Waiting for unfinished jobs....
```
Am I supposed to skip
autogen.sh
and invokegetdeps.py
directly with something like--allow-system-packages
? If so, I think I'd need to add homebrew dependencies on more than just folly. Boost, for example. Is there a full list handy anywhere?