Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,25 @@ Want to take on an issue? Leave a comment and a maintainer may assign it to you

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.

2. Install [ctags](https://github.com/universal-ctags/ctags) (required by zoekt)
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.

**macOS:** Run the provided install script:
```sh
// macOS:
brew install universal-ctags
./install-ctags-macos.sh
```

// Linux:
snap install universal-ctags
**Linux and other platforms:** Build from source:
```sh
curl https://codeload.github.com/universal-ctags/ctags/tar.gz/v6.1.0 | tar xz -C /tmp
cd /tmp/ctags-6.1.0
./autogen.sh
./configure --program-prefix=universal- --enable-json
make -j$(nproc)
sudo make install
```

After installing, set `CTAGS_COMMAND` in your `.env.development.local` to the path of the installed binary (e.g. `/usr/local/bin/universal-ctags`).

3. Install corepack:
```sh
npm install -g corepack
Expand Down
38 changes: 38 additions & 0 deletions install-ctags-macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

# This script installs universal-ctags v6.1.0 on macOS.
# This version is pinned to match the version used in the Sourcebot Docker image.
# See vendor/zoekt/install-ctags-alpine.sh for the Alpine equivalent.

CTAGS_VERSION=v6.1.0
CTAGS_ARCHIVE_TOP_LEVEL_DIR=ctags-6.1.0
INSTALL_DIR=/usr/local/bin

cleanup() {
cd /
rm -rf /tmp/ctags-$CTAGS_VERSION
}

trap cleanup EXIT

set -eux

# Ensure required build tools are available
if ! command -v brew >/dev/null 2>&1; then
echo "Homebrew is required to install build dependencies. See https://brew.sh."
exit 1
fi

brew install autoconf automake pkg-config jansson

curl --retry 5 "https://codeload.github.com/universal-ctags/ctags/tar.gz/$CTAGS_VERSION" | tar xz -C /tmp
cd /tmp/$CTAGS_ARCHIVE_TOP_LEVEL_DIR
./autogen.sh
./configure --program-prefix=universal- --enable-json
make -j"$(sysctl -n hw.ncpu)"
sudo make install

echo ""
echo "universal-ctags installed to $INSTALL_DIR/universal-ctags"
echo "Add the following to your .env.development.local:"
echo " CTAGS_COMMAND=$INSTALL_DIR/universal-ctags"
Loading