Skip to content

THRIFT-5242: Add Homebrew installation instructions for macOS - #3826

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-5242
Open

THRIFT-5242: Add Homebrew installation instructions for macOS#3826
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-5242

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Sep 8, 2026

Copy link
Copy Markdown
Member

JIRA: THRIFT-5242
Client: doc

Description

Update doc/install/os_x.md to:

  • Document installing the pre-built Thrift compiler via Homebrew (brew install thrift).
  • Document building from source using Homebrew-provided dependencies with both CMake and Autotools.
  • Add guidance regarding macOS's outdated default bison (v2.3) and the keg-only Homebrew bison.
  • Modernize external links to HTTPS (https://www.boost.org, https://libevent.org, https://thrift.apache.org/download).

This change was created with AI assistance.

@slachiewicz
slachiewicz requested a review from Jens-G as a code owner September 8, 2026 11:13
@slachiewicz
slachiewicz force-pushed the THRIFT-5242 branch 2 times, most recently from 82a1e28 to 362d954 Compare September 11, 2026 07:00
@Jens-G

Jens-G commented Sep 11, 2026

Copy link
Copy Markdown
Member

Code review

Found 2 issues:

  1. The Autotools recipe does not work with the dependencies the page lists. brew install cmake boost libevent openssl bison flex installs none of autoconf, automake, libtool or pkg-config, and macOS does not ship them. The recipe starts with ./bootstrap.sh, which exits with "Couldn't find libtoolize!" when libtool is missing. It also requires automake 1.13 or later and runs aclocal/autoconf/automake, and configure.ac needs the pkg-config macros. The macOS CI job installs automake bison flex boost libevent openssl libtool pkg-config before running the same steps. (bug due to doc/install/os_x.md: brew install cmake boost libevent openssl bison flex, followed by ./bootstrap.sh)

```bash
brew install cmake boost libevent openssl bison flex
```

run: |
brew install automake bison flex boost libevent openssl libtool pkg-config
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH

  1. The commit has no AI attribution trailer, although the PR description says the change was created with AI assistance (AGENTS.md says "Always label AI-assisted commits and PRs. Use one or both of: Co-Authored-By: <AI tool name and version> / Generated-by: <AI tool name and version>").

thrift/AGENTS.md

Lines 60 to 74 in 362d954

- **Always** label AI-assisted commits and PRs. Use one or both of:
```
Co-Authored-By: <AI tool name and version>
Generated-by: <AI tool name and version>
```
Example:
```
THRIFT-9999: Fix connection timeout handling in Go client
Client: go
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
```
- Apply this label even when AI only generated a portion of the change.
- **Never** put tool-internal links into a commit message, PR description, JIRA comment or e-mail.

Two suggestions, below the bar for the list above but verified:

  • The page is about installing the compiler, but the CMake recipe runs with the default options. Those also build the libraries, tests and tutorials (BUILD_LIBRARIES, BUILD_TESTING and BUILD_TUTORIALS default to ON), and the tests need compiled Boost libraries. The compiler-only options used in doc/ReleaseManagement.md (-DBUILD_TESTING=OFF -DBUILD_TUTORIALS=OFF -DWITH_CPP=OFF … -DBUILD_COMPILER=ON) would match what the page promises. Also, the macOS CI job only runs the Autotools path, so the recipe marked "(Recommended)" is the one that is not tested.

#### Building with CMake (Recommended)
```bash
cmake -B build \
-DBISON_EXECUTABLE="$(brew --prefix bison)/bin/bison" \
-DOPENSSL_ROOT_DIR="$(brew --prefix openssl)"
cmake --build build
sudo cmake --install build
```

  • export LDFLAGS="-L$(brew --prefix bison)/lib" is not needed. bison only runs as a program and nothing links against it; CI only adds bison's bin directory to PATH. The export also replaces any LDFLAGS the reader already has set.

```bash
export PATH="$(brew --prefix bison)/bin:$PATH"
export LDFLAGS="-L$(brew --prefix bison)/lib"

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@slachiewicz

Copy link
Copy Markdown
Member Author

Rewrote the branch after the review above:

  • The Homebrew line now installs automake libtool pkg-config as the macOS CI job does, so ./bootstrap.sh finds libtoolize.
  • Both recipes build only the compiler, which is what the page promises: --disable-libs --disable-tests for Autotools and -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_TUTORIALS=OFF for CMake. Neither needs Boost, libevent or OpenSSL, so those moved to a sentence for readers who also want the C++ library.
  • Dropped the LDFLAGS export and the "(Recommended)" label.
  • The CMake recipe now builds into cmake-build. cmake -B build reuses the repository's own build/ directory, which holds the CMake modules.
  • The commit carries the attribution trailer.

Verified: both recipes run as written on macOS 15 (Apple Silicon) → thrift -version prints 0.25.0 from each build.

This comment was created with AI assistance.

Client: doc

Update doc/install/os_x.md to document installing the Thrift compiler
via Homebrew ('brew install thrift') and building from source using
Homebrew dependencies with CMake and Autotools.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@slachiewicz

Copy link
Copy Markdown
Member Author

A limit on the verification above, since I had no clean macOS environment for it:

  • The sudo … install steps ran into a scratch prefix (cmake --install --prefix, make install DESTDIR=), so the install target is tested but not the /usr/local permissions.
  • flex on the test machine came from Xcode, not Homebrew, so the brew install line was not exercised from a fresh machine. All six formula names resolve.
  • The unchanged section on building Boost and libevent by hand was not run.

The macOS CI job covers the Autotools path on a fresh runner; the CMake path has no CI coverage.

This comment was created with AI assistance.

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

Successfully merging this pull request may close these issues.

2 participants