Skip to content

Commit 8b493e8

Browse files
committed
Replace runtime with c2rust
1 parent 6e06187 commit 8b493e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+23608
-1309
lines changed

.github/workflows/build.yml

+72-71
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build & Test
22

33
env:
44
CARGO_TERM_COLOR: always
5-
RUSTFLAGS: "-D warnings"
5+
# RUSTFLAGS: "-D warnings"
66
CROSS_DEBUG: 1
77

88
on:
@@ -25,7 +25,7 @@ jobs:
2525
- linux-arm
2626
- linux-x64
2727
- linux-x86
28-
- linux-powerpc64
28+
# - linux-powerpc64
2929
- windows-arm64
3030
- windows-x64
3131
- windows-x86
@@ -38,20 +38,20 @@ jobs:
3838
# 2. Add a new record to the matrix map in `cli/npm/install.js`
3939
- { platform: linux-arm64 , target: aarch64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
4040
- { platform: linux-arm , target: arm-unknown-linux-gnueabi , os: ubuntu-latest , use-cross: true }
41-
- { platform: linux-x64 , target: x86_64-unknown-linux-gnu , os: ubuntu-22.04 , features: wasm }
41+
- { platform: linux-x64 , target: x86_64-unknown-linux-gnu , os: ubuntu-22.04 }
4242
- { platform: linux-x86 , target: i686-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
43-
- { platform: linux-powerpc64 , target: powerpc64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
43+
# - { platform: linux-powerpc64 , target: powerpc64-unknown-linux-gnu , os: ubuntu-latest , use-cross: true }
4444
- { platform: windows-arm64 , target: aarch64-pc-windows-msvc , os: windows-latest }
45-
- { platform: windows-x64 , target: x86_64-pc-windows-msvc , os: windows-latest , features: wasm }
45+
- { platform: windows-x64 , target: x86_64-pc-windows-msvc , os: windows-latest }
4646
- { platform: windows-x86 , target: i686-pc-windows-msvc , os: windows-latest }
47-
- { platform: macos-arm64 , target: aarch64-apple-darwin , os: macos-latest , features: wasm }
48-
- { platform: macos-x64 , target: x86_64-apple-darwin , os: macos-13 , features: wasm }
47+
- { platform: macos-arm64 , target: aarch64-apple-darwin , os: macos-latest }
48+
- { platform: macos-x64 , target: x86_64-apple-darwin , os: macos-13 }
4949

5050
# Cross compilers for C library
5151
- { platform: linux-arm64 , cc: aarch64-linux-gnu-gcc , ar: aarch64-linux-gnu-ar }
5252
- { platform: linux-arm , cc: arm-linux-gnueabi-gcc , ar: arm-linux-gnueabi-ar }
5353
- { platform: linux-x86 , cc: i686-linux-gnu-gcc , ar: i686-linux-gnu-ar }
54-
- { platform: linux-powerpc64 , cc: powerpc64-linux-gnu-gcc , ar: powerpc64-linux-gnu-ar }
54+
# - { platform: linux-powerpc64 , cc: powerpc64-linux-gnu-gcc , ar: powerpc64-linux-gnu-ar }
5555

5656
# Prevent race condition (see #2041)
5757
- { platform: windows-x64 , rust-test-threads: 1 }
@@ -85,6 +85,7 @@ jobs:
8585
uses: actions-rust-lang/setup-rust-toolchain@v1
8686
with:
8787
target: ${{ matrix.target }}
88+
cache: false
8889

8990
- name: Install cross
9091
if: ${{ matrix.use-cross }}
@@ -157,43 +158,43 @@ jobs:
157158
env:
158159
WASMTIME_REPO: https://github.com/bytecodealliance/wasmtime
159160

160-
- name: Build C library (make)
161-
if: ${{ runner.os != 'Windows' }}
162-
run: make.sh -j CFLAGS="$CFLAGS"
163-
env:
164-
CFLAGS: -g -Werror -Wall -Wextra -Wshadow -Wpedantic -Werror=incompatible-pointer-types
165-
166-
- name: Build C library (CMake)
167-
if: ${{ !matrix.use-cross }}
168-
run: |
169-
cmake -S lib -B build/static \
170-
-DBUILD_SHARED_LIBS=OFF \
171-
-DCMAKE_BUILD_TYPE=Debug \
172-
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
173-
-DTREE_SITTER_FEATURE_WASM=$WASM
174-
cmake --build build/static --verbose
175-
176-
cmake -S lib -B build/shared \
177-
-DBUILD_SHARED_LIBS=ON \
178-
-DCMAKE_BUILD_TYPE=Debug \
179-
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
180-
-DTREE_SITTER_FEATURE_WASM=$WASM
181-
cmake --build build/shared --verbose
182-
env:
183-
CC: ${{ contains(matrix.target, 'linux') && 'clang' || '' }}
184-
WASM: ${{ contains(matrix.features, 'wasm') && 'ON' || 'OFF' }}
185-
186-
- name: Build wasm library
187-
# No reason to build on the same Github runner hosts many times
188-
if: ${{ !matrix.no-run && !matrix.use-cross }}
189-
shell: bash
190-
run: |
191-
cd lib/binding_web
192-
npm ci
193-
CJS=true npm run build
194-
CJS=true npm run build:debug
195-
npm run build
196-
npm run build:debug
161+
# - name: Build C library (make)
162+
# if: ${{ runner.os != 'Windows' }}
163+
# run: make.sh -j CFLAGS="$CFLAGS"
164+
# env:
165+
# CFLAGS: -g -Werror -Wall -Wextra -Wshadow -Wpedantic -Werror=incompatible-pointer-types
166+
167+
# - name: Build C library (CMake)
168+
# if: ${{ !matrix.use-cross }}
169+
# run: |
170+
# cmake -S lib -B build/static \
171+
# -DBUILD_SHARED_LIBS=OFF \
172+
# -DCMAKE_BUILD_TYPE=Debug \
173+
# -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
174+
# -DTREE_SITTER_FEATURE_WASM=$WASM
175+
# cmake --build build/static --verbose
176+
177+
# cmake -S lib -B build/shared \
178+
# -DBUILD_SHARED_LIBS=ON \
179+
# -DCMAKE_BUILD_TYPE=Debug \
180+
# -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
181+
# -DTREE_SITTER_FEATURE_WASM=$WASM
182+
# cmake --build build/shared --verbose
183+
# env:
184+
# CC: ${{ contains(matrix.target, 'linux') && 'clang' || '' }}
185+
# WASM: ${{ contains(matrix.features, 'wasm') && 'ON' || 'OFF' }}
186+
187+
# - name: Build wasm library
188+
# # No reason to build on the same Github runner hosts many times
189+
# if: ${{ !matrix.no-run && !matrix.use-cross }}
190+
# shell: bash
191+
# run: |
192+
# cd lib/binding_web
193+
# npm ci
194+
# CJS=true npm run build
195+
# CJS=true npm run build:debug
196+
# npm run build
197+
# npm run build:debug
197198

198199
- name: Build target
199200
run: $BUILD_CMD build --release --target=${{ matrix.target }} --features=${{ matrix.features }}
@@ -211,17 +212,17 @@ jobs:
211212
if: ${{ !matrix.no-run && inputs.run-test && steps.cache.outputs.cache-hit != 'true' }}
212213
run: $BUILD_CMD run -p xtask -- generate-fixtures
213214

214-
- name: Generate Wasm fixtures
215-
if: ${{ !matrix.no-run && !matrix.use-cross && inputs.run-test && steps.cache.outputs.cache-hit != 'true' }}
216-
run: $BUILD_CMD run -p xtask -- generate-fixtures --wasm
215+
# - name: Generate Wasm fixtures
216+
# if: ${{ !matrix.no-run && !matrix.use-cross && inputs.run-test && steps.cache.outputs.cache-hit != 'true' }}
217+
# run: $BUILD_CMD run -p xtask -- generate-fixtures --wasm
217218

218219
- name: Run main tests
219220
if: ${{ !matrix.no-run && inputs.run-test }}
220221
run: $BUILD_CMD test --target=${{ matrix.target }} --features=${{ matrix.features }}
221222

222-
- name: Run wasm tests
223-
if: ${{ !matrix.no-run && !matrix.use-cross && inputs.run-test }}
224-
run: $BUILD_CMD run -p xtask -- test-wasm
223+
# - name: Run wasm tests
224+
# if: ${{ !matrix.no-run && !matrix.use-cross && inputs.run-test }}
225+
# run: $BUILD_CMD run -p xtask -- test-wasm
225226

226227
- name: Run benchmarks
227228
# Cross-compiled benchmarks are pointless
@@ -236,23 +237,23 @@ jobs:
236237
if-no-files-found: error
237238
retention-days: 7
238239

239-
- name: Upload Wasm artifacts
240-
if: ${{ matrix.platform == 'linux-x64' }}
241-
uses: actions/upload-artifact@v4
242-
with:
243-
name: tree-sitter.wasm
244-
path: |
245-
lib/binding_web/tree-sitter.js
246-
lib/binding_web/tree-sitter.js.map
247-
lib/binding_web/tree-sitter.cjs
248-
lib/binding_web/tree-sitter.cjs.map
249-
lib/binding_web/tree-sitter.wasm
250-
lib/binding_web/tree-sitter.wasm.map
251-
lib/binding_web/debug/tree-sitter.cjs
252-
lib/binding_web/debug/tree-sitter.cjs.map
253-
lib/binding_web/debug/tree-sitter.js
254-
lib/binding_web/debug/tree-sitter.js.map
255-
lib/binding_web/debug/tree-sitter.wasm
256-
lib/binding_web/debug/tree-sitter.wasm.map
257-
if-no-files-found: error
258-
retention-days: 7
240+
# - name: Upload Wasm artifacts
241+
# if: ${{ matrix.platform == 'linux-x64' }}
242+
# uses: actions/upload-artifact@v4
243+
# with:
244+
# name: tree-sitter.wasm
245+
# path: |
246+
# lib/binding_web/tree-sitter.js
247+
# lib/binding_web/tree-sitter.js.map
248+
# lib/binding_web/tree-sitter.cjs
249+
# lib/binding_web/tree-sitter.cjs.map
250+
# lib/binding_web/tree-sitter.wasm
251+
# lib/binding_web/tree-sitter.wasm.map
252+
# lib/binding_web/debug/tree-sitter.cjs
253+
# lib/binding_web/debug/tree-sitter.cjs.map
254+
# lib/binding_web/debug/tree-sitter.js
255+
# lib/binding_web/debug/tree-sitter.js.map
256+
# lib/binding_web/debug/tree-sitter.wasm
257+
# lib/binding_web/debug/tree-sitter.wasm.map
258+
# if-no-files-found: error
259+
# retention-days: 7

.github/workflows/ci.yml

+24-22
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99
- LICENSE
1010
- cli/src/templates
1111
push:
12-
branches: [master]
12+
branches:
13+
- 'c2rust-master'
14+
- 'c2rust-release'
1315
paths-ignore:
1416
- docs/**
1517
- "**/README.md"
@@ -22,27 +24,27 @@ concurrency:
2224
cancel-in-progress: ${{ github.event_name != 'push' }}
2325

2426
jobs:
25-
checks:
26-
runs-on: ubuntu-latest
27-
steps:
28-
- name: Checkout repository
29-
uses: actions/checkout@v4
30-
31-
- name: Set up stable Rust toolchain
32-
uses: actions-rust-lang/setup-rust-toolchain@v1
33-
with:
34-
toolchain: stable
35-
36-
- name: Set up nightly Rust toolchain
37-
uses: actions-rust-lang/setup-rust-toolchain@v1
38-
with:
39-
toolchain: nightly
40-
components: clippy, rustfmt
41-
42-
- name: Lint files
43-
run: |
44-
make lint
45-
make lint-web
27+
# checks:
28+
# runs-on: ubuntu-latest
29+
# steps:
30+
# - name: Checkout repository
31+
# uses: actions/checkout@v4
32+
33+
# - name: Set up stable Rust toolchain
34+
# uses: actions-rust-lang/setup-rust-toolchain@v1
35+
# with:
36+
# toolchain: stable
37+
38+
# - name: Set up nightly Rust toolchain
39+
# uses: actions-rust-lang/setup-rust-toolchain@v1
40+
# with:
41+
# toolchain: nightly
42+
# components: clippy, rustfmt
43+
44+
# - name: Lint files
45+
# run: |
46+
# make lint
47+
# make lint-web
4648

4749
sanitize:
4850
uses: ./.github/workflows/sanitize.yml

.github/workflows/sanitize.yml

+12-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Sanitize
22

33
env:
44
CARGO_TERM_COLOR: always
5-
RUSTFLAGS: -D warnings
65

76
on:
87
workflow_call:
@@ -37,15 +36,15 @@ jobs:
3736
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
3837
run: cargo xtask generate-fixtures
3938

40-
- name: Run main tests with undefined behaviour sanitizer (UBSAN)
41-
run: cargo test -- --test-threads 1
42-
env:
43-
CFLAGS: -fsanitize=undefined
44-
RUSTFLAGS: ${{ env.RUSTFLAGS }} -lubsan
45-
46-
- name: Run main tests with address sanitizer (ASAN)
47-
run: cargo test -- --test-threads 1
48-
env:
49-
ASAN_OPTIONS: verify_asan_link_order=0
50-
CFLAGS: -fsanitize=address
51-
RUSTFLAGS: ${{ env.RUSTFLAGS }} -lasan --cfg sanitizing
39+
# - name: Run main tests with undefined behaviour sanitizer (UBSAN)
40+
# run: cargo test -- --test-threads 1
41+
# env:
42+
# CFLAGS: -fsanitize=undefined
43+
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -lubsan
44+
45+
# - name: Run main tests with address sanitizer (ASAN)
46+
# run: cargo test -- --test-threads 1
47+
# env:
48+
# ASAN_OPTIONS: verify_asan_link_order=0
49+
# CFLAGS: -fsanitize=address
50+
# RUSTFLAGS: ${{ env.RUSTFLAGS }} -lasan --cfg sanitizing

0 commit comments

Comments
 (0)