uber / prototool

Your Swiss Army Knife for Protocol Buffers
MIT License
5.05k stars 345 forks source link

break check fails with git clone --depth 1 file:///work /tmp/prototool382034397 had error #518

Closed marcellodesales closed 4 years ago

marcellodesales commented 4 years ago

I'm trying to run break check against a repo and I'm not sure what the error is...

git clone --depth 1 file:///work /tmp/prototool382034397 had error:

Could you help me verify the root cause of this error? I'm trying to validate for the first time..

Here's what I have so far...

Prototool.yaml

protoc:
  includes:
  - src/main/proto
  - imports/google-commons
  - imports/protocol-buffers/src
  version: 3.9.1
generate:
  plugins:
  - name: java
    output: ./build/generated/source/proto/main/java
  - name: grpc-java
    output: ./build/generated/source/proto/main/grpc

Full logs

$ docker run --rm -e PROTOCOOL_DEBUG=1 -v $(pwd):/work --tmpfs /tmp:exec prototool break check --debug src
2019-10-31T02:35:07.672Z    DEBUG   returning ProtoSets {"workDirPath": "/work", "dirPath": "src", "protoSets": [{"WorkDirPath":"/work","DirPath":"/work/src","DirPathToFiles":{"/work/imports/google-commons/google/api":[{"Path":"/work/imports/google-commons/google/api/annotations.proto","DisplayPath":"imports/google-commons/google/api/annotations.proto"},{"Path":"/work/imports/google-commons/google/api/http.proto","DisplayPath":"imports/google-commons/google/api/http.proto"}],"/work/imports/protocol-buffers/src/google/protobuf":[{"Path":"/work/imports/protocol-buffers/src/google/protobuf/descriptor.proto","DisplayPath":"imports/protocol-buffers/src/google/protobuf/descriptor.proto"},{"Path":"/work/imports/protocol-buffers/src/google/protobuf/empty.proto","DisplayPath":"imports/protocol-buffers/src/google/protobuf/empty.proto"}],"/work/src/main/proto":[{"Path":"/work/src/main/proto/course.proto","DisplayPath":"src/main/proto/course.proto"},{"Path":"/work/src/main/proto/service.proto","DisplayPath":"src/main/proto/service.proto"},{"Path":"/work/src/main/proto/student.proto","DisplayPath":"src/main/proto/student.proto"}],"/work/src/main/proto/common":[{"Path":"/work/src/main/proto/common/globalId.proto","DisplayPath":"src/main/proto/common/globalId.proto"}]},"Config":{"DirPath":"/work","ExcludePrefixes":[],"Compile":{"ProtobufVersion":"3.9.1","IncludePaths":["/work/imports/google-commons","/work/imports/protocol-buffers/src","/work/src/main/proto"],"IncludeWellKnownTypes":true,"AllowUnusedImports":false},"Create":{"DirPathToBasePackage":null},"Lint":{"Group":"","NoDefault":false,"IncludeIDs":[],"ExcludeIDs":[],"IgnoreIDToFilePaths":{},"FileHeader":"","JavaPackagePrefix":"","AllowSuppression":false},"Break":{"IncludeBeta":false,"AllowBetaDeps":false},"Gen":{"GoPluginOptions":{"ImportPath":"","ExtraModifiers":null},"Plugins":[{"Name":"grpc-java","Type":1,"Flags":"","OutputPath":{"RelPath":"./build/generated/source/proto/main/grpc","AbsPath":"/work/build/generated/source/proto/main/grpc"},"FileSuffix":"","IncludeImports":false,"IncludeSourceInfo":false},{"Name":"java","Type":1,"Flags":"","OutputPath":{"RelPath":"./build/generated/source/proto/main/java","AbsPath":"/work/build/generated/source/proto/main/java"},"FileSuffix":"","IncludeImports":false,"IncludeSourceInfo":false}]}}}]}
2019-10-31T02:35:07.672Z    DEBUG   using file  {"file": "src/main/proto/common/globalId.proto"}
2019-10-31T02:35:07.672Z    DEBUG   using file  {"file": "src/main/proto/course.proto"}
2019-10-31T02:35:07.672Z    DEBUG   using file  {"file": "src/main/proto/service.proto"}
2019-10-31T02:35:07.672Z    DEBUG   using file  {"file": "src/main/proto/student.proto"}
2019-10-31T02:35:09.537Z    DEBUG   downloaded protobuf zip file    {"url": "https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protoc-3.9.1-linux-x86_64.zip"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/", "fileMode": "drwxr-xr-x"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/", "fileMode": "drwxr-xr-x"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/", "fileMode": "drwxr-xr-x"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/empty.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.537Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/empty.proto"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/struct.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.537Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/struct.proto"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/timestamp.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.537Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/timestamp.proto"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/compiler/", "fileMode": "drwxr-xr-x"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/compiler/plugin.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.537Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/compiler/plugin.proto"}
2019-10-31T02:35:09.537Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/descriptor.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.538Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/descriptor.proto"}
2019-10-31T02:35:09.538Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/type.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.538Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/type.proto"}
2019-10-31T02:35:09.538Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/any.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.538Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/any.proto"}
2019-10-31T02:35:09.539Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/wrappers.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.539Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/wrappers.proto"}
2019-10-31T02:35:09.539Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/duration.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.539Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/duration.proto"}
2019-10-31T02:35:09.539Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/source_context.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.539Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/source_context.proto"}
2019-10-31T02:35:09.539Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/field_mask.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.539Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/field_mask.proto"}
2019-10-31T02:35:09.540Z    DEBUG   found protobuf file in zip  {"fileName": "include/google/protobuf/api.proto", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.540Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/include/google/protobuf/api.proto"}
2019-10-31T02:35:09.540Z    DEBUG   found protobuf file in zip  {"fileName": "bin/", "fileMode": "drwxr-xr-x"}
2019-10-31T02:35:09.540Z    DEBUG   found protobuf file in zip  {"fileName": "bin/protoc", "fileMode": "-rwxr-xr-x"}
2019-10-31T02:35:09.587Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/bin/protoc"}
2019-10-31T02:35:09.587Z    DEBUG   found protobuf file in zip  {"fileName": "readme.txt", "fileMode": "-rw-r--r--"}
2019-10-31T02:35:09.587Z    DEBUG   wrote protobuf file {"path": "/tmp/protobuf/3.9.1/readme.txt"}
2019-10-31T02:35:09.589Z    DEBUG   output from protoc --version    {"output": "libprotoc 3.9.1"}
2019-10-31T02:35:09.589Z    DEBUG   protobuf downloaded {"path": "/tmp/protobuf/3.9.1"}
2019-10-31T02:35:09.589Z    DEBUG   running protoc  {"command": "/tmp/protobuf/3.9.1/bin/protoc -I /work/imports/google-commons -I /work/imports/protocol-buffers/src -I /work/src/main/proto -I /tmp/protobuf/3.9.1/include -o /tmp/prototool882265846 --include_imports /work/src/main/proto/common/globalId.proto"}
2019-10-31T02:35:09.589Z    DEBUG   running protoc  {"command": "/tmp/protobuf/3.9.1/bin/protoc -I /work/imports/google-commons -I /work/imports/protocol-buffers/src -I /work/src/main/proto -I /tmp/protobuf/3.9.1/include -o /tmp/prototool002265395 --include_imports /work/src/main/proto/course.proto /work/src/main/proto/service.proto /work/src/main/proto/student.proto"}
2019-10-31T02:35:09.642Z    DEBUG   git clone --depth 1 file:///work /tmp/prototool382034397
git clone --depth 1 file:///work /tmp/prototool382034397 had error:
optiman commented 4 years ago

I had the same error when I forgot to install git in my custom-built prototool container.

marcellodesales commented 4 years ago

@optiman Thank you so much... I assumed that git was installed after getting the error... It's definitely not clear that git is missing... My custom prototool doesn't have it...

$ docker run -ti my-prototool git version
docker: Error response from daemon: OCI runtime create failed: 
container_linux.go:345: starting container process caused 
  "exec: \"git\": executable file not found in $PATH": unknown.

I fixed it after adding git to the image... Thanks a lot!

FROM alpine:3.9
 ENV PROTOTOOL_CACHE_PATH=/tmp
 ENV LD_LIBRARY_PATH=/lib64:/lib
 WORKDIR /work
-RUN apk --no-cache add --update ca-certificates libc6-compat
+RUN apk --no-cache add --update ca-certificates libc6-compat git
 COPY --from=build /usr/local/bin /usr/local/bin
 COPY --from=build /usr/include /usr/include
 RUN chmod -R 755 /usr/include