Skip to content

Commit 65e9c24

Browse files
authored
Merge pull request #10 from cs3org/prototool-timeout
Configure prototool timeout
2 parents dc54cec + b44e9e3 commit 65e9c24

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN apt-get install python-pip -y
1010

1111
# deps for protoc
1212
RUN cd /tmp && curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v3.9.2/protoc-3.9.2-linux-x86_64.zip -o protoc.zip && unzip -o protoc.zip && sudo cp bin/protoc /usr/local/bin/protoc
13-
RUN cd /tmp && curl -sSL https://github.com/uber/prototool/releases/download/v1.8.0/prototool-Linux-x86_64 -o prototool && sudo cp prototool /usr/local/bin/ && sudo chmod u+x /usr/local/bin/prototool
13+
RUN cd /tmp && curl -sSL https://github.com/uber/prototool/releases/download/v1.10.0/prototool-Linux-x86_64 -o prototool && sudo cp prototool /usr/local/bin/ && sudo chmod u+x /usr/local/bin/prototool
1414
RUN cd /tmp && curl -sSL https://github.com/nilslice/protolock/releases/download/v0.14.1/protolock.20190917T024843Z.linux-amd64.tgz -o protolock.tgz && tar -xzf protolock.tgz && sudo cp protolock /usr/local/bin/
1515
RUN curl -sSL https://github.com/pseudomuto/protoc-gen-doc/releases/download/v1.3.0/protoc-gen-doc-1.3.0.linux-amd64.go1.11.2.tar.gz -o protoc-gen-doc.tar.gz && tar xzfv protoc-gen-doc.tar.gz && sudo cp protoc-gen-doc-*/protoc-gen-doc /usr/local/bin/
1616
RUN go install github.com/golang/protobuf/protoc-gen-go@v1.3.2

build.go

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,6 @@ import (
1414
"strings"
1515
)
1616

17-
const (
18-
// ProtobufVersion is the version of the protocol buffers.
19-
ProtobufVersion = "3.7.1"
20-
// PrototoolVersion specifies the version of the prototool.
21-
PrototoolVersion = "1.6.0"
22-
)
23-
24-
var (
25-
// ProtoOS specifies the operative system for prototool.
26-
ProtoOS = getProtoOS()
27-
// ProtocFilename is the name of the protoc binary.
28-
ProtocFilename = fmt.Sprintf("protoc-%s-%s-x86_64.zip", ProtobufVersion, ProtoOS)
29-
)
30-
3117
var (
3218
gitMail = flag.String("git-author-mail", "cs3org-bot@hugo.labkode.com", "Git author mail")
3319
gitName = flag.String("git-author-name", "cs3org-bot", "Git author name")
@@ -290,7 +276,7 @@ func findFolders() []string {
290276

291277
func buildProto() {
292278
dir := "."
293-
cmd := exec.Command("prototool", "compile")
279+
cmd := exec.Command("prototool", "compile", "--walk-timeout", "10s")
294280
cmd.Dir = dir
295281
run(cmd)
296282

@@ -299,10 +285,10 @@ func buildProto() {
299285
run(cmd)
300286

301287
// lint
302-
cmd = exec.Command("prototool", "format", "-w")
288+
cmd = exec.Command("prototool", "format", "-w", "--walk-timeout", "10s")
303289
cmd.Dir = dir
304290
run(cmd)
305-
cmd = exec.Command("prototool", "lint")
291+
cmd = exec.Command("prototool", "lint", "--walk-timeout", "10s")
306292
cmd.Dir = dir
307293
run(cmd)
308294
cmd = exec.Command("go", "run", "tools/check-license/check-license.go")
@@ -340,7 +326,7 @@ func buildGo() {
340326
// remove leftovers (existing defs)
341327
os.RemoveAll("build/go-cs3apis/cs3")
342328

343-
cmd := exec.Command("prototool", "generate")
329+
cmd := exec.Command("prototool", "generate", "--walk-timeout", "10s")
344330
run(cmd)
345331

346332
sed("build/go-cs3apis", ".go", "github.com/cs3org/go-cs3apis/build/go-cs3apis/cs3/", "github.com/cs3org/go-cs3apis/cs3/")

0 commit comments

Comments
 (0)