From 9c55bc7ea161b4fcf2b74913d68cb8d8e6490dc7 Mon Sep 17 00:00:00 2001 From: worstell Date: Mon, 16 Dec 2024 16:55:48 -0800 Subject: [PATCH] chore: remove rust proto gen from build tasks (#3783) --- .github/workflows/ci.yml | 8 ++++++++ Justfile | 13 ++++++------- backend/protos/buf.gen.rust.yaml | 6 ++++++ backend/protos/buf.gen.yaml | 4 ---- scripts/autofmt | 2 -- 5 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 backend/protos/buf.gen.rust.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b69fe70f7..edbd939a98 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 747161599f..20ece30847 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 0000000000..d802bbed13 --- /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 b20b039648..dd8e9a8765 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 6704b6b479..8360b0b9ee 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..."