-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathjustfile
More file actions
124 lines (99 loc) · 3.65 KB
/
Copy pathjustfile
File metadata and controls
124 lines (99 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
buck := env_var_or_default("BUCK2", "./buck2")
set shell := ["bash", "-o", "pipefail", "-c"]
_default:
@just --list
# Pass arbitrary arguments through to buck2.
[group('meta')]
buck *args:
{{buck}} {{args}}
# List Buck targets in the repository.
[group('meta')]
targets:
{{buck}} targets //...
# Remove Buck outputs.
[group('meta')]
clean:
{{buck}} clean
# Run every lint recipe.
[group('check')]
lint-all: lint-starlark lint-cxx lint-rust lint-ts
# Run Starlark lint on Buck/Starlark/BXL files.
[group('check')]
lint-starlark:
git ls-files ':(glob)**/BUCK' ':(glob)**/*.bzl' ':(glob)**/*.bxl' | xargs {{buck}} starlark lint
# Build C/C++ diagnostic subtargets and print their reports.
[group('check')]
lint-cxx:
{{buck}} bxl scripts/check.bxl:main -- --kind cxx --output check --target //... | xargs cat
# Run Clippy for Rust targets and print its reports.
[group('check')]
lint-rust:
{{buck}} bxl scripts/check.bxl:main -- --kind rust --output clippy.txt --target //... | xargs cat
# Lint TypeScript/JS sources with oxlint.
[group('check')]
lint-ts:
git ls-files ':(glob)tests/assemblyscript/**/*.ts' ':(glob)tools/**/*.mjs' | xargs {{buck}} run toolchains//typescript:oxlint --
# Format all sources in place (Rust, C, TypeScript/JS).
[group('format')]
fmt:
git ls-files ':(glob)tests/rust/**/*.rs' | xargs {{buck}} run toolchains//rust:rustfmt --
git ls-files ':(glob)tests/c/**/*.c' ':(glob)tests/c/**/*.h' | xargs {{buck}} run toolchains//cxx:clang-format -- -i
git ls-files ':(glob)tests/assemblyscript/**/*.ts' ':(glob)tools/**/*.mjs' | xargs {{buck}} run toolchains//typescript:oxfmt --
# Check formatting without modifying files (used by CI).
[group('format')]
fmt-check:
git ls-files ':(glob)tests/rust/**/*.rs' | xargs {{buck}} run toolchains//rust:rustfmt -- --check
git ls-files ':(glob)tests/c/**/*.c' ':(glob)tests/c/**/*.h' | xargs {{buck}} run toolchains//cxx:clang-format -- --dry-run -Werror
git ls-files ':(glob)tests/assemblyscript/**/*.ts' ':(glob)tools/**/*.mjs' | xargs {{buck}} run toolchains//typescript:oxfmt -- --check
# Build all Buck targets in the repository.
[group('build')]
build:
{{buck}} build //...
# Build one C runtime suite.
[group('build')]
build-c runtime="wasmtime":
{{buck}} build //tests/c:{{runtime}}
# Build one AssemblyScript runtime suite.
[group('build')]
build-asc runtime="wasmtime":
{{buck}} build //tests/assemblyscript/wasm32-wasip1:{{runtime}}
# Build one Rust runtime suite. Use `p1` or `p3`.
[group('build')]
build-rust wasi="p1" runtime="wasmtime":
{{buck}} build //tests/rust/wasm32-wasi{{wasi}}:{{runtime}}
# Build the distribution archive.
[group('package')]
dist:
{{buck}} build --show-output //tests:dist
# Run the Wasmtime Buck tests.
[group('test')]
test:
{{buck}} test //tests:wasmtime
# Run the jco Buck tests.
[group('test')]
test-jco:
{{buck}} test //tests:jco
# Run one C runtime suite.
[group('test')]
test-c runtime="wasmtime":
{{buck}} test //tests/c:{{runtime}}
# Run one AssemblyScript runtime suite.
[group('test')]
test-asc runtime="wasmtime":
{{buck}} test //tests/assemblyscript/wasm32-wasip1:{{runtime}}
# Run one Rust runtime suite. Use `p1` or `p3`.
[group('test')]
test-rust wasi="p1" runtime="wasmtime":
{{buck}} test //tests/rust/wasm32-wasi{{wasi}}:{{runtime}}
# Run all Buck tests under //tests.
[group('test')]
test-all:
{{buck}} test //tests/...
# Run additional Buck runtime suites.
[group('test')]
test-extra-runtimes:
{{buck}} test //tests:wazero //tests:wasmedge //tests:wamr
# Run one Buck test target, e.g. `just test-one //tests/c:lseek_wasmtime`.
[group('test')]
test-one target:
{{buck}} test {{target}}