Commit ecb5bec
authored
Add Rust distribution targets and their CI workflows (#168)
## What is the goal of this PR?
We added crate distribution targets (`assemble_crate` and
`deploy_crate`) for Rust, and added CI workflows for deploying snapshot
and release crates.
## What are the changes implemented in this PR?
We recently tried adding an `assemble_crate` rule to our existing Rust
proto codebase to distribute Rust proto bindings, but it didn't work -
it didn't contain any protobuf source code, because the `assemble_crate`
rule doesn't support Cargo build scripts.
But instead of actually adding that support, we had a rethink of the
build architecture. The old idea was (following Tonic's own docs) for
`typedb-protocol` to come bundled with the `.proto` sources and a Cargo
build script that would allow the end-user to compile the protobufs
on-the-fly. This would require them to have `protoc` installed in their
environment, and would dramatically increase their compilation time and
overhead.
A better option would be to bundle the generated Rust sources. So we've
created the `rust_tonic_compile` rule that enables just that in
typedb/typedb-dependencies#391. Now, both
`rust_library` and `assemble_crate` rules can depend on
`typedb_protocol` seamlessly, so we can depend on `typedb_protocol`
either through Bazel or Cargo.
As this PR stabilises the release process, we've gone ahead and added
the relevant CI workflows: `deploy-crate-snapshot` and
`deploy-crate-release`.1 parent 26782a5 commit ecb5bec
File tree
5 files changed
+45
-60
lines changed- .factory
- dependencies/vaticle
- grpc/rust
5 files changed
+45
-60
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
| |||
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
23 | 25 | | |
24 | | - | |
25 | | - | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 41 | + | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
51 | | - | |
52 | | - | |
| 46 | + | |
53 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
| |||
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
63 | 76 | | |
64 | 77 | | |
65 | 78 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
0 commit comments