diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 662d9ce88f..d4f37dc9d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -295,6 +295,7 @@ jobs: # Dependencies # ################ ################ + # Install LLVM - also adds .llvm/bin to the PATH - name: Install LLVM 17 uses: KyleMayes/install-llvm-action@v2 with: diff --git a/docs/docs/development.md b/docs/docs/development.md index c88f4bcadb..2c84ad9775 100644 --- a/docs/docs/development.md +++ b/docs/docs/development.md @@ -147,13 +147,21 @@ yarn jlab_link # run this whenever you need to update a local perspective packag Install system dependencies through Homebrew: ```bash -brew install cmake +brew install cmake llvm@17 +brew link llvm@17 # optional, see below ``` On M1 (Apple Silicon) systems, make sure your brew-installed dependencies are in `/opt/homebrew` (the default location), and that `/opt/homebrew/bin` is on the `PATH`. +If you do not want to link the llvm@17 keg, then while developing ensure it is +on your PATH too, like this: + +``` +PATH=$(brew --prefix llvm@17)/bin:$PATH +``` + **Note**: Perspective vendors its C++ extensions, so you may run into trouble building if you have `brew`-installed versions of libraries, such as `flatbuffers`. diff --git a/tools/perspective-scripts/lint_cpp.mjs b/tools/perspective-scripts/lint_cpp.mjs index 7dbf027438..e532612404 100644 --- a/tools/perspective-scripts/lint_cpp.mjs +++ b/tools/perspective-scripts/lint_cpp.mjs @@ -45,7 +45,7 @@ export function tidyLint(flags) { * @param {string} sourceDir */ function tidy(buildDir, sourceDir, flags) { - const ctpath = CLANG_TIDY_PATH; + const ctpath = CLANG_TIDY; // if (!fs.existsSync(ctpath)) { // console.warn("run-clang-tidy not found, skipping lint"); // return; @@ -62,24 +62,17 @@ function tidy(buildDir, sourceDir, flags) { } } -const CLANG_TIDY_PATH = fs.existsSync(`${__dirname}/../../.llvm`) - ? `${__dirname}/../../.llvm/bin/run-clang-tidy` - : `run-clang-tidy`; - -const CLANG_FMT_PATH = fs.existsSync(`${__dirname}/../../.llvm`) - ? `${__dirname}/../../.llvm/bin/clang-format` - : `clang-format`; - -console.log(`${__dirname}/../../.llvm`); +const CLANG_TIDY = `run-clang-tidy`; +const CLANG_FORMAT = `clang-format`; function formatLint(dir) { - execSync(`${CLANG_FMT_PATH} -style=file --dry-run -Werror ${dir}`, { + execSync(`${CLANG_FORMAT} -style=file --dry-run -Werror ${dir}`, { stdio: "inherit", }); } function clangFormatFix(dir) { - execSync(`${CLANG_FMT_PATH} -style=file -i ${dir}`, { + execSync(`${CLANG_FORMAT} -style=file -i ${dir}`, { stdio: "inherit", }); }