Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Setting up LLVM: setup-llvm.sh

The compiler, pep-build (tools/compiler), links LLVM 20 through the pepper-llvm package, so building it from source needs an LLVM 20 development install. The setup scripts provision one:

./scripts/setup-llvm.sh --devtools            # Linux and macOS
pwsh -File scripts/setup-llvm.ps1 -DevTools   # Windows

They record the LLVM they settled on in .pep/llvm-prefix (gitignored), which scripts/pepper-tests.sh, the release scripts and the workflows read. Run them again on each new machine rather than copying that file. Building Pepper from source says what each platform needs first.

scripts/setup-llvm.sh [options]
pwsh -File scripts/setup-llvm.ps1 [-DevTools] [-Force]

What it does

  • provisions LLVM 20, the one LLVM major Pepper builds with, cheapest source first: an LLVM 20 that is already installed, else the platform’s package manager (apt llvm-20-dev or Homebrew llvm@20), else the LLVM release archive (cached, so a second run is free). Windows always uses the archive: no Windows package ships llvm-config and the component libraries;
  • writes the prefix, one line, to .pep/llvm-prefix in the checkout;
  • does nothing more when a valid install is already there.

Options

scripts/setup-llvm.sh takes these; --help prints them.

OptionWhat it does
--devtoolsAlso check for the lldb debugger, with instructions when it is missing
--no-devtoolsSkip the debugger, even when PEPPER_SETUP_DEVTOOLS is set
--no-packagesDo not use apt or Homebrew: use an LLVM already installed, or the release archive
--checkReport the LLVM it would use and what .pep/llvm-prefix records, changing nothing; the status is 0 only when they agree
-h, --helpPrint the options

Of --devtools and --no-devtools, the last one given wins. An unknown argument is an error that exits with status 2.

scripts/setup-llvm.ps1 takes -DevTools, which installs lldb, lldb-dap and lldb-server into the same prefix, and -Force, which downloads and extracts the archive again even when a valid install is there.

Environment variables

VariableWhat it does
PEPPER_SETUP_DEVTOOLS1 sets up the debugger on every run, as --devtools does, so it can be turned on once per machine