Repository navigation
Ship kit-rpc's generated code as ordinary source, with no build script - #315
Draft
marthendalnunes wants to merge 4 commits into
Draft
marthendalnunes wants to merge 4 commits into
marthendalnunes wants to merge 4 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
kit-rpcalready kept its generated protocol code ingenerated/, but a build script staged it intoOUT_DIRand carriedbuffa-buildandconnectrpc-buildas build dependencies. Every crate that depends onkit-rpcbuilt those generators and their tree, though only the regeneration scripts ever used them.Change
kit-rpcincludesgenerated/directly.build.rsand the[build-dependencies]are gone, andconnectrpc-buildleaves thetransportfeature.kit-rpc-codegen(publish = false, nothing depends on it).scripts/regen-rpc-proto.shandscripts/regen-transport-proto.shrun it, so the existing "generated code is fresh" job (scripts/check-generated-fresh.sh) checks the same output as before. There is one way to generate, not two.OUT_DIRmarker plumbing (scripts/codegen-out-dir.pyand its test) is removed.Code lives in
kit-rpc(consumer side) andkit-rpc-codegen(tool);kit-coreis untouched.Generated bytes
Same buffa 0.9.2 and connectrpc-build 0.9.0, same proto inputs. Regenerating changes only 7 lines in two wrapper files (
_includes.rs,transport/_connectrpc.rs):include!(concat!(env!("OUT_DIR"), "/x.rs"))becomesinclude!("x.rs"), because there is noOUT_DIRwithout a build script. Every other generated file is byte-identical. No wire change;buf lintandbuf breakingare unaffected.Build dependencies
cargo tree -e normal,buildfor a crate that depends onkit-rpc:kit-rpcbuild-dependencies: 1 before (buffa-build; 2 withtransport, plusconnectrpc-build), 0 after.buffa-build,buffa-codegen,buffa-descriptor,prettyplease), 0 after. With thetransportfeature, 8 before (those plusconnectrpc-build,connectrpc-codegen,anyhow,heck), 0 after.kitbinary (kit-bin): 7 fewer packages in the release list (scripts/release/kit-packages.golden: the 7 above), now 283.kit-client: 94 packages before, 90 after.kit-serve86 to 82,kit-sync117 to 113.Checked on the Studio: freshness script clean, clippy (workspace lints) on
kit-rpc,kit-rpc-codegen,kit-client,kit-serve,kit-syncandkit-transport-connect,kit-rpcnextest (25 of 25), rustdoc with warnings denied, wasm32 check ofkit-rpcwithtransportand ofkit-client.