Skip to content

Commit 6ddd5e6

Browse files
committed
Fix build-linux-ts-native: use build.py, cpp grammar only
1 parent 4351262 commit 6ddd5e6

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

.github/workflows/build-linux-ts-native.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,27 @@ jobs:
1212
- name: Install build tools
1313
run: |
1414
sudo apt-get update
15-
sudo apt-get install -y build-essential cmake git openjdk-17-jdk-headless
15+
sudo apt-get install -y build-essential python3 git openjdk-17-jdk-headless
1616
17-
- name: Clone java-tree-sitter 1.9.1
17+
- name: Clone java-tree-sitter (latest, with submodules for cpp only)
1818
run: |
19-
git clone --depth 1 --branch 1.9.1 \
20-
https://github.com/seart-group/java-tree-sitter.git java-tree-sitter
19+
git clone --depth 1 https://github.com/seart-group/java-tree-sitter.git java-tree-sitter
20+
cd java-tree-sitter
21+
# Only init the submodules we actually need
22+
git submodule update --init --depth 1 tree-sitter tree-sitter-cpp
2123
22-
- name: Build native library
24+
- name: Build native library (C++ grammar only, glibc)
2325
run: |
2426
cd java-tree-sitter
25-
# The native CMake target produces libjava-tree-sitter.so
26-
cmake -B build \
27-
-DCMAKE_BUILD_TYPE=Release \
28-
-DCMAKE_C_FLAGS="-O2" \
29-
-DJTREESITTER_BUILD_SHARED_LIBS=ON
30-
cmake --build build --target java-tree-sitter -- -j$(nproc)
31-
# Find the .so wherever CMake placed it
32-
find build -name "libjava-tree-sitter.so"
27+
python3 build.py --verbose tree-sitter-cpp
28+
ls -lh libjava-tree-sitter.so
29+
file libjava-tree-sitter.so
30+
ldd libjava-tree-sitter.so
3331
3432
- name: Copy to libs/linux-x64/
3533
run: |
3634
mkdir -p libs/linux-x64
37-
find java-tree-sitter/build -name "libjava-tree-sitter.so" \
38-
-exec cp {} libs/linux-x64/ \;
39-
echo "Built:"
40-
file libs/linux-x64/libjava-tree-sitter.so
41-
ldd libs/linux-x64/libjava-tree-sitter.so
35+
cp java-tree-sitter/libjava-tree-sitter.so libs/linux-x64/
4236
4337
- uses: actions/upload-artifact@v4
4438
with:

0 commit comments

Comments
 (0)