Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove rust proto gen from build tasks #3783

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll eventually use this task for the plugin release

@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
Expand Down
6 changes: 6 additions & 0 deletions backend/protos/buf.gen.rust.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I think you can just call this buf.gen.yaml, I don't think there's anything that would automatically pick it up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's currently in the same directory as the buf.gen.yaml we use for other protos- i could move it to the sqlc-gen-ftl directory but i figured we may use rust/rust protos for other things

plugins:
- plugin: prost
out: src/protos
opt:
- bytes=.
4 changes: 0 additions & 4 deletions backend/protos/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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=.
2 changes: 0 additions & 2 deletions scripts/autofmt
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
Loading