Skip to content

Commit e0d4ff9

Browse files
chore: add macOS universal-ctags v6.1.0 install script and update contributing docs (#1023)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 70484e8 commit e0d4ff9

File tree

2 files changed

+53
-5
lines changed

2 files changed

+53
-5
lines changed

CONTRIBUTING.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,25 @@ Want to take on an issue? Leave a comment and a maintainer may assign it to you
3636

3737
1. Install <a href="https://go.dev/doc/install"><img src="https://go.dev/favicon.ico" width="16" height="16"> go</a>, <a href="https://docs.docker.com/get-started/get-docker/"><img src="https://www.docker.com/favicon.ico" width="16" height="16"> docker</a>, and <a href="https://nodejs.org/"><img src="https://nodejs.org/favicon.ico" width="16" height="16"> NodeJS</a>. Note that a NodeJS version of at least `24` is required.
3838

39-
2. Install [ctags](https://github.com/universal-ctags/ctags) (required by zoekt)
39+
2. Install [universal-ctags](https://github.com/universal-ctags/ctags) v6.1.0 (required by zoekt). Version 6.1.0 is required — newer versions have a known incompatibility with zoekt.
40+
41+
**macOS:** Run the provided install script:
4042
```sh
41-
// macOS:
42-
brew install universal-ctags
43+
./install-ctags-macos.sh
44+
```
4345

44-
// Linux:
45-
snap install universal-ctags
46+
**Linux and other platforms:** Build from source:
47+
```sh
48+
curl https://codeload.github.com/universal-ctags/ctags/tar.gz/v6.1.0 | tar xz -C /tmp
49+
cd /tmp/ctags-6.1.0
50+
./autogen.sh
51+
./configure --program-prefix=universal- --enable-json
52+
make -j$(nproc)
53+
sudo make install
4654
```
4755

56+
After installing, set `CTAGS_COMMAND` in your `.env.development.local` to the path of the installed binary (e.g. `/usr/local/bin/universal-ctags`).
57+
4858
3. Install corepack:
4959
```sh
5060
npm install -g corepack

install-ctags-macos.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh
2+
3+
# This script installs universal-ctags v6.1.0 on macOS.
4+
# This version is pinned to match the version used in the Sourcebot Docker image.
5+
# See vendor/zoekt/install-ctags-alpine.sh for the Alpine equivalent.
6+
7+
CTAGS_VERSION=v6.1.0
8+
CTAGS_ARCHIVE_TOP_LEVEL_DIR=ctags-6.1.0
9+
INSTALL_DIR=/usr/local/bin
10+
11+
cleanup() {
12+
cd /
13+
rm -rf /tmp/ctags-$CTAGS_VERSION
14+
}
15+
16+
trap cleanup EXIT
17+
18+
set -eux
19+
20+
# Ensure required build tools are available
21+
if ! command -v brew >/dev/null 2>&1; then
22+
echo "Homebrew is required to install build dependencies. See https://brew.sh."
23+
exit 1
24+
fi
25+
26+
brew install autoconf automake pkg-config jansson
27+
28+
curl --retry 5 "https://codeload.github.com/universal-ctags/ctags/tar.gz/$CTAGS_VERSION" | tar xz -C /tmp
29+
cd /tmp/$CTAGS_ARCHIVE_TOP_LEVEL_DIR
30+
./autogen.sh
31+
./configure --program-prefix=universal- --enable-json
32+
make -j"$(sysctl -n hw.ncpu)"
33+
sudo make install
34+
35+
echo ""
36+
echo "universal-ctags installed to $INSTALL_DIR/universal-ctags"
37+
echo "Add the following to your .env.development.local:"
38+
echo " CTAGS_COMMAND=$INSTALL_DIR/universal-ctags"

0 commit comments

Comments
 (0)