Skip to content

Commit

Permalink
Initialize dev env for Rust agent (#2293)
Browse files Browse the repository at this point in the history
* init rust

Signed-off-by: Kosuke Morimoto <ksk@vdaas.org>

* add license

Signed-off-by: Kosuke Morimoto <ksk@vdaas.org>

---------

Signed-off-by: Kosuke Morimoto <ksk@vdaas.org>
  • Loading branch information
kmrmt committed Jan 15, 2024
1 parent 9be659b commit 958f7f4
Show file tree
Hide file tree
Showing 22 changed files with 10,194 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,20 @@ hack/go.mod.default3
.vscode/

telepresence.log

# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
#Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

!rust/libs
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ SWAP_TAG ?= latest

BINDIR ?= /usr/local/bin

RUST_DIR ?= $(HOME)/.cargo
RUST_BIN ?= $(RUST_DIR)/bin

UNAME := $(eval UNAME := $(shell uname -s))$(UNAME)
ARCH := $(eval ARCH := $(shell uname -m))$(ARCH)
PWD := $(eval PWD := $(shell pwd))$(PWD)
Expand Down
6 changes: 6 additions & 0 deletions Makefile.d/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,9 @@ stern/install: $(GOPATH)/bin/stern

$(GOPATH)/bin/stern:
$(call go-install, github.com/stern/stern)

.PHONY: rust/install
rust/install: $(RUST_BIN)/cargo

$(RUST_BIN)/cargo:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
6 changes: 6 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ plugins:
out: apis/swagger
opt:
- json_names_for_fields=true
- plugin: buf.build/community/neoeinstein-prost
out: rust/libs/proto/src
- plugin: buf.build/community/neoeinstein-tonic
out: rust/libs/proto/src
opt:
- no_include
2 changes: 2 additions & 0 deletions hack/license/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ func readAndRewrite(path string) error {
tmpl = googleProtoApache
}
d.Escape = slushEscape
case ".rs":
d.Escape = slushEscape
default:
if fi.Name() == "Dockerfile" {
tmpl = docker
Expand Down
Loading

0 comments on commit 958f7f4

Please sign in to comment.