Skip to content
Open
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
14 changes: 11 additions & 3 deletions .devcontainer/apt-install/install.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#!/bin/sh
apt-get update -y
set -e # Exit on error

# Basic, commonly needed, dependencies of Ruby & JRuby projects
# Install basic development dependencies for Ruby & JRuby projects
apt-get update -y
apt-get install -y direnv default-jdk git zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev

# Support for PostgreSQL
# Support for PostgreSQL (commented out by default)
# apt-get install -y postgresql libpq-dev

# NOTE: Tree-sitter setup is NOT done here because the workspace is not mounted yet
# during the devcontainer build phase. Tree-sitter setup happens in postCreateCommand
# after the workspace is mounted. See devcontainer.json for details.
# This gem needs ALL grammars for fenced code block merging (handled by setup-tree-sitter.sh).

echo "Basic apt packages installed. Tree-sitter will be set up after workspace mount."

# Adds the direnv setup script to ~/.bashrc file (at the end)
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bundle update --bundler",
// First setup tree-sitter (auto-detects sudo requirement), then run bundle as the regular user
// Use ${containerWorkspaceFolder} to get the actual workspace path in the container
"postCreateCommand": "bash ${containerWorkspaceFolder}/.github/scripts/ubuntu/setup-tree-sitter.sh --workspace=${containerWorkspaceFolder} && bundle update --bundler",

// Configure tool-specific properties.
"customizations" : {
Expand Down
30 changes: 28 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ export K_SOUP_COV_COMMAND_NAME="Test Coverage"
# Available formats are html, xml, rcov, lcov, json, tty

export K_SOUP_COV_FORMATTERS="html,xml,rcov,lcov,json,tty"
export K_SOUP_COV_MIN_BRANCH=89 # Means you want to enforce X% branch coverage
export K_SOUP_COV_MIN_LINE=99 # Means you want to enforce X% line coverage
export K_SOUP_COV_MIN_BRANCH=81 # Means you want to enforce X% branch coverage
export K_SOUP_COV_MIN_LINE=96 # Means you want to enforce X% line coverage
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
export K_SOUP_COV_MULTI_FORMATTERS=true
export K_SOUP_COV_OPEN_BIN=false # Means don't try to open coverage results in browser
export MAX_ROWS=1 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage
export KETTLE_TEST_SILENT=true
export KETTLE_DEV_DEBUG=false
export KETTLE_RB_DEV=false

# Internal Debugging Controls

Expand All @@ -57,6 +58,31 @@ export RUBOCOP_LTS_LOCAL=false
export OPENCOLLECTIVE_HANDLE=kettle-rb
export FUNDING_ORG=kettle-rb

# tree_haver dependencies (SONAME form)
export TREE_SITTER_RUNTIME_LIB=/home/linuxbrew/.linuxbrew/Cellar/tree-sitter/0.26.3/lib/libtree-sitter.so
# Run vendor/setup-java-tree-sitter.sh to download JARs
export TREE_SITTER_JAVA_JARS_DIR=/home/pboling/src/kettle-rb/ast-merge/vendor/tree_haver/vendor/jars
# JVM options for java-tree-sitter:
# - --enable-native-access: Required for Java Foreign Function API
# - -Djava.library.path: Path to libtree-sitter.so for JNI loading
export JAVA_OPTS="--enable-native-access=ALL-UNNAMED -Djava.library.path=/home/linuxbrew/.linuxbrew/Cellar/tree-sitter/0.26.3/lib"
export JRUBY_OPTS="-J--enable-native-access=ALL-UNNAMED -J-Djava.library.path=/home/linuxbrew/.linuxbrew/Cellar/tree-sitter/0.26.3/lib"
# If Ruby/JRuby cannot find libraries at runtime, you may need to export:
# LD_LIBRARY_PATH is needed for java-tree-sitter to find libtree-sitter.so at runtime
# export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib64:/usr/lib
export LD_LIBRARY_PATH="/home/linuxbrew/.linuxbrew/Cellar/tree-sitter/0.26.3/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

# Example language library path:
export TREE_SITTER_TOML_PATH=/home/pboling/.local/share/mise/installs/lua/5.4.8/luarocks/lib/luarocks/rocks-5.4/tree-sitter-toml/0.0.31-1/parser/toml.so
export TREE_SITTER_JSON_PATH=/home/pboling/.local/share/mise/installs/lua/5.4.8/luarocks/lib/luarocks/rocks-5.4/tree-sitter-json/0.0.29-1/parser/json.so
export TREE_SITTER_JSONC_PATH=/home/pboling/.local/share/mise/installs/lua/5.4.8/luarocks/lib/luarocks/rocks-5.4/tree-sitter-jsonc/0.0.29-1/parser/jsonc.so
# Luarocks version (incompatible with MRI backend):
export TREE_SITTER_BASH_PATH=/home/pboling/.local/share/mise/installs/lua/5.4.8/luarocks/lib/luarocks/rocks-5.4/tree-sitter-bash/0.0.49-1/parser/bash.so
# npm version (N-API, so WILL NOT WORK with ruby_tree_sitter):
# export TREE_SITTER_BASH_PATH=/var/home/pboling/.local/share/mise/installs/node/23.11.0/lib/node_modules/tree-sitter-bash/prebuilds/linux-x64/tree-sitter-bash.node
# Compiled from source (compatible with ruby_tree_sitter)
# export TREE_SITTER_BASH_PATH=/tmp/tree-sitter-bash/libtree-sitter-bash.so

# .env would override anything in this file, if `dotenv` is uncommented below.

# .env is a DOCKER standard, and if we use it, it would be in deployed, or DOCKER, environments,
Expand Down
Loading
Loading