-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle macos SDK in the justfile include_args
#184
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,7 @@ indent_size = 8 | |
[Makefile] | ||
indent_style = tab | ||
indent_size = 8 | ||
|
||
[justfile] | ||
indent_style = tab | ||
indent_size = 4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,11 @@ just_repo := "https://github.com/casey/just.git" | |
just_branch := "master" | ||
just_sha := "f5bdffda344daca6c791303e4bb2006ee5a0b144" # 1.35.0 | ||
|
||
include_args := "-Isrc/ -I" + ts_path + "/lib/include -Inode_modules/nan" | ||
include_args := "-Isrc/ -I" + ts_path + "/lib/include -Inode_modules/nan" + if os() == "macos" { | ||
" -I" + `xcrun --sdk macosx --show-sdk-path` + "/usr/include/" | ||
} else { | ||
"" | ||
} | ||
general_cflags := "-Wall -Werror --pedantic -Wno-format-pedantic" | ||
|
||
fuzzer_flags := env("FUZZER_FLAGS", "-fsanitize=fuzzer,address,undefined") | ||
|
@@ -50,27 +54,31 @@ no_just_parsing := ''' | |
default: | ||
just --list | ||
|
||
# Install needed packages and make sure tools are setup | ||
setup *npm-args: | ||
_check_installed +dep: | ||
#!/bin/sh | ||
set -eau | ||
|
||
check_installed () { | ||
check_installed() { | ||
printf "checking $1... " | ||
if "$1" --version 2> /dev/null ; then | ||
local dep=0 | ||
command -v "$1" 1>/dev/null || dep=$? | ||
|
||
if [[ "${dep}" == 0 ]]; then | ||
echo "tool $1 found!" | ||
else | ||
echo | ||
echo "tool $1 NOT found. This may be needed for some functionality" | ||
fi | ||
echo | ||
} | ||
|
||
check_installed npm | ||
check_installed cargo | ||
check_installed clang | ||
check_installed clang-tidy | ||
check_installed clang-format | ||
for d in {{dep}}; do | ||
check_installed $d | ||
done | ||
|
||
# Install needed packages and make sure tools are setup | ||
setup *npm-args: | ||
#!/bin/sh | ||
set -eau | ||
just _check_installed npm cargo clang clang-tidy clang-format kk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tgross35 I'm surprised this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I actually had to adjust this in #186 and removed it there - it was always saying not found, bash syntax with a sh shebang :) I should have read the output better There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I should have tested it myself, should not have pushed the commit |
||
|
||
if which npm > /dev/null; then | ||
npm install --include=dev {{ npm-args }} | ||
|
@@ -89,6 +97,7 @@ _lint-min: _clone-repo-tree-sitter configure-compile-database | |
# Run the linter for JS, C, Cargo, and Python. Requires clang-tidy, clippy, and ruff. | ||
lint: _lint-min | ||
cargo clippy | ||
@just _check_installed ruff | ||
ruff check . | ||
|
||
_out-dirs: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this allows checking dependencies that do not have a
--version
flag