diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0a7c10b4..1020cddd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,6 +115,14 @@ jobs: uses: ./.github/actions/build-cache - name: Test WASM run: cd sqlc-gen-ftl && cargo test --features ci --test sqlc_gen_ftl_test -- --nocapture + - name: Check for uncommitted changes + run: | + if [[ -n $(git status -s) ]]; then + echo "Error: Building sqlc-gen-ftl resulted in uncommitted changes:" + git status -s + git --no-pager diff + exit 1 + fi extension: name: VSCode Extension runs-on: ubuntu-latest diff --git a/Justfile b/Justfile index 747161599..20ece3084 100644 --- a/Justfile +++ b/Justfile @@ -85,7 +85,7 @@ dev *args: watchexec -r {{WATCHEXEC_ARGS}} -- "ftl dev --plain {{args}}" # Build everything -build-all: build-protos-unconditionally build-backend build-frontend build-backend-tests build-generate build-zips lsp-generate build-jvm build-language-plugins build-go2proto-testdata build-sqlc-gen-ftl +build-all: build-protos-unconditionally build-backend build-frontend build-backend-tests build-generate build-zips lsp-generate build-jvm build-language-plugins build-go2proto-testdata # Run "go generate" on all packages build-generate: @@ -165,16 +165,15 @@ build-extension: pnpm-install @mk {{EXTENSION_OUT}} : frontend/vscode/src frontend/vscode/package.json -- "cd frontend/vscode && rm -f ftl-*.vsix && pnpm run compile" # Build the sqlc-ftl-gen plugin, used to generate FTL schema from SQL -build-sqlc-gen-ftl: build-protos +build-sqlc-gen-ftl: build-rust-protos @mk {{SQLC_GEN_FTL_OUT}} : sqlc-gen-ftl/src -- \ "cd sqlc-gen-ftl && \ cargo build --target wasm32-wasip1 --release" -cargo-install: - @mk sqlc-gen-ftl/target : sqlc-gen-ftl/Cargo.toml -- \ - "cd sqlc-gen-ftl && \ - cargo install protoc-gen-prost && \ - cargo build" +# Generate Rust protos +build-rust-protos: + @mk sqlc-gen-ftl/src/protos : backend/protos -- \ + "cd backend/protos && buf generate --template buf.gen.rust.yaml" # Install development version of VSCode extension install-extension: build-extension diff --git a/backend/protos/buf.gen.rust.yaml b/backend/protos/buf.gen.rust.yaml new file mode 100644 index 000000000..d802bbed1 --- /dev/null +++ b/backend/protos/buf.gen.rust.yaml @@ -0,0 +1,6 @@ +version: v1 +plugins: + - plugin: prost + out: src/protos + opt: + - bytes=. diff --git a/backend/protos/buf.gen.yaml b/backend/protos/buf.gen.yaml index b20b03964..dd8e9a876 100644 --- a/backend/protos/buf.gen.yaml +++ b/backend/protos/buf.gen.yaml @@ -16,7 +16,3 @@ plugins: out: ../../python-runtime/ftl/src/ftl/protos opt: - pyi_out=../../python-runtime/ftl/src/ftl/protos - - plugin: prost - out: ../../sqlc-gen-ftl/src/protos - opt: - - bytes=. diff --git a/scripts/autofmt b/scripts/autofmt index 6704b6b47..8360b0b9e 100755 --- a/scripts/autofmt +++ b/scripts/autofmt @@ -24,8 +24,6 @@ find backend/protos \( -name '*.pb.go' -o -name '*.connect.go' \) -print0 | xarg just pnpm-install -just cargo-install - (cd backend/protos && buf generate) echo "Formatting TypeScript..."