Open marcellonovak opened 1 month ago
That's a mistake in the docs. git
does not support the @
notation for refs (go
works that way). The correct syntax would be
git clone --branch demo-cca-1.0.0 https://github.com/veraison/services
Well I downloaded... something, but now I got this block of errors:
intern@intern-vm:~$ sudo make -C ${TOPDIR}/services
[sudo] password for intern:
make: Entering directory '/home/intern/services'
make[1]: Entering directory '/home/intern/services/builtin'
/bin/bash: line 1: go: command not found
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/builtin'
make[1]: Entering directory '/home/intern/services/config'
/bin/bash: line 1: go: command not found
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/config'
make[1]: Entering directory '/home/intern/services/handler'
/bin/bash: line 1: go: command not found
protoc --go_out=. --go_opt=paths=source_relative --proto_path=. \
--proto_path=../proto \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
--go-json_out=. --go-json_opt=paths=source_relative endorsement_response.proto
google/protobuf/struct.proto: File not found.
google/protobuf/empty.proto: File not found.
evidence.proto:5:1: Import "google/protobuf/struct.proto" was not found or had errors.
evidence.proto:12:9: "google.protobuf.Struct" is not defined.
appraisal_context.proto:7:1: Import "evidence.proto" was not found or had errors.
appraisal_context.proto:10:9: "EvidenceContext" is not defined.
state.proto:6:1: Import "google/protobuf/struct.proto" was not found or had errors.
state.proto: "google.protobuf.ListValue" is not defined.
vts.proto:7:1: Import "google/protobuf/struct.proto" was not found or had errors.
vts.proto:8:1: Import "google/protobuf/empty.proto" was not found or had errors.
vts.proto:9:1: Import "appraisal_context.proto" was not found or had errors.
vts.proto:11:1: Import "state.proto" was not found or had errors.
vts.proto:20:5: "google.protobuf.Struct" is not defined.
vts.proto:44:5: "google.protobuf.Struct" is not defined.
vts.proto:62:25: "google.protobuf.Empty" is not defined.
vts.proto:62:57: "ServiceState" is not defined.
vts.proto:66:51: "AppraisalContext" is not defined.
vts.proto:67:44: "google.protobuf.Empty" is not defined.
endorsement_response.proto:6:1: Import "vts.proto" was not found or had errors.
endorsement_response.proto:9:14: "proto.Endorsement" is not defined.
endorsement_response.proto:10:14: "proto.Endorsement" is not defined.
make[1]: *** [../mk/proto.mk:21: protogen] Error 1
make[1]: Leaving directory '/home/intern/services/handler'
make: *** [mk/subdir.mk:41: handler.all] Error 2
make: Leaving directory '/home/intern/services'
Hm, it looks like it wants to re-build the GRPC protobuf interfaces (not sure why). You need to install the protobuf compiler and a a few plugins for it:
sudo apt install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 && go install github.com/mitchellh/protoc-gen-go-json@latest
(the first comand is for Ubuntu and similar; adjust for your distro as appropriate)
I was able to successfully install protobuf and see the version before, but I tried as you suggested, and got a similar result:
intern@intern-vm:~$ make -C ${TOPDIR}/services
make: Entering directory '/home/intern/services'
make[1]: Entering directory '/home/intern/services/builtin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/builtin'
make[1]: Entering directory '/home/intern/services/config'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/config'
make[1]: Entering directory '/home/intern/services/handler'
protoc --go_out=. --go_opt=paths=source_relative --proto_path=. \
--proto_path=../proto \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
--go-json_out=. --go-json_opt=paths=source_relative endorsement_response.proto
google/protobuf/struct.proto: File not found.
google/protobuf/empty.proto: File not found.
evidence.proto:5:1: Import "google/protobuf/struct.proto" was not found or had errors.
evidence.proto:12:9: "google.protobuf.Struct" is not defined.
appraisal_context.proto:7:1: Import "evidence.proto" was not found or had errors.
appraisal_context.proto:10:9: "EvidenceContext" is not defined.
state.proto:6:1: Import "google/protobuf/struct.proto" was not found or had errors.
state.proto: "google.protobuf.ListValue" is not defined.
vts.proto:7:1: Import "google/protobuf/struct.proto" was not found or had errors.
vts.proto:8:1: Import "google/protobuf/empty.proto" was not found or had errors.
vts.proto:9:1: Import "appraisal_context.proto" was not found or had errors.
vts.proto:11:1: Import "state.proto" was not found or had errors.
vts.proto:20:5: "google.protobuf.Struct" is not defined.
vts.proto:44:5: "google.protobuf.Struct" is not defined.
vts.proto:62:25: "google.protobuf.Empty" is not defined.
vts.proto:62:57: "ServiceState" is not defined.
vts.proto:66:51: "AppraisalContext" is not defined.
vts.proto:67:44: "google.protobuf.Empty" is not defined.
endorsement_response.proto:6:1: Import "vts.proto" was not found or had errors.
endorsement_response.proto:9:14: "proto.Endorsement" is not defined.
endorsement_response.proto:10:14: "proto.Endorsement" is not defined.
make[1]: *** [../mk/proto.mk:21: protogen] Error 1
make[1]: Leaving directory '/home/intern/services/handler'
make: *** [mk/subdir.mk:41: handler.all] Error 2
make: Leaving directory '/home/intern/services'
no luck.
also tried removing the services folder, and re-cloning the repo, with this output:
intern@intern-vm:~$ git clone --branch demo-cca-1.0.0 https://github.com/veraison/services
Cloning into 'services'...
remote: Enumerating objects: 6255, done.
remote: Counting objects: 100% (6254/6254), done.
remote: Compressing objects: 100% (1915/1915), done.
remote: Total 6255 (delta 4268), reused 5854 (delta 4127), pack-reused 1
Receiving objects: 100% (6255/6255), 101.46 MiB | 16.60 MiB/s, done.
Resolving deltas: 100% (4268/4268), done.
Note: switching to 'b6c2b4a90035f47b532c3212a05491a3c9fd4466'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
intern@intern-vm:~$ make -C ${TOPDIR}/services
make: Entering directory '/home/intern/services'
make[1]: Entering directory '/home/intern/services/builtin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/builtin'
make[1]: Entering directory '/home/intern/services/config'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/intern/services/config'
make[1]: Entering directory '/home/intern/services/handler'
protoc --go_out=. --go_opt=paths=source_relative --proto_path=. \
--proto_path=../proto \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
--go-json_out=. --go-json_opt=paths=source_relative endorsement_response.proto
google/protobuf/struct.proto: File not found.
google/protobuf/empty.proto: File not found.
evidence.proto:5:1: Import "google/protobuf/struct.proto" was not found or had errors.
evidence.proto:12:9: "google.protobuf.Struct" is not defined.
appraisal_context.proto:7:1: Import "evidence.proto" was not found or had errors.
appraisal_context.proto:10:9: "EvidenceContext" is not defined.
state.proto:6:1: Import "google/protobuf/struct.proto" was not found or had errors.
state.proto: "google.protobuf.ListValue" is not defined.
vts.proto:7:1: Import "google/protobuf/struct.proto" was not found or had errors.
vts.proto:8:1: Import "google/protobuf/empty.proto" was not found or had errors.
vts.proto:9:1: Import "appraisal_context.proto" was not found or had errors.
vts.proto:11:1: Import "state.proto" was not found or had errors.
vts.proto:20:5: "google.protobuf.Struct" is not defined.
vts.proto:44:5: "google.protobuf.Struct" is not defined.
vts.proto:62:25: "google.protobuf.Empty" is not defined.
vts.proto:62:57: "ServiceState" is not defined.
vts.proto:66:51: "AppraisalContext" is not defined.
vts.proto:67:44: "google.protobuf.Empty" is not defined.
endorsement_response.proto:6:1: Import "vts.proto" was not found or had errors.
endorsement_response.proto:9:14: "proto.Endorsement" is not defined.
endorsement_response.proto:10:14: "proto.Endorsement" is not defined.
make[1]: *** [../mk/proto.mk:21: protogen] Error 1
make[1]: Leaving directory '/home/intern/services/handler'
make: *** [mk/subdir.mk:41: handler.all] Error 2
make: Leaving directory '/home/intern/services'
Hm, it looks like protoc
is not finding the standard .proto
's that should be part of its installation. So either it hasn't installed properly or something is off in the environment. Things to check:
struct.proto
(one of the things it can't find) exists under /usr/include/google/protobuf
. If not, then try re-installing protobuf-compiler
(or whatever provides protoc
on your distro)$(go env GOPATH)/bin
(usually resolves to $HOME/go/bin
) is still in PATH
in the shell you're running the command in (note that if you've updated it inside .bashrc
, that won't take effect for shells that are already open).If this still doesn't work, please provide more info about your environment -- what distro are you on, what version of Go are you using, where/how it was installed, etc
FWIW, the following sequence of commands worked for me inside a fresh Ubuntu 22.04 VM:
sudo apt install git protobuf-compiler
wget https://golang.org/dl/go1.21.6.linux-amd64.tar.gz
tar xvf go1.21.6.linux-amd64.tar.gz -C ~
export PATH=$HOME/go/bin:$PATH
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 && go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 && go install github.com/mitchellh/protoc-gen-go-json@latest
git clone --branch demo-cca-1.0.0 https://github.com/veraison/services
make -C services/
Trying to follow the demo on a fresh ubuntu machine, made it up to here:
Repo not found? Are the demo commands out of date? Thank you for any help.