Skip to content

Commit 02ca03a

Browse files
author
7908837174
committed
fix(demo): correct protoc-gen-go installation instructions (fixes #59)
Clarify the distinction between protoc and protoc-gen-go installation: - protoc is the Protocol Buffer compiler - protoc-gen-go is the Go language plugin for protoc - Both are required for generating Go code from .proto files Updated both CCA and PSA demo documentation to provide clear, platform-specific installation instructions with troubleshooting guidance. Fixes #59 Signed-off-by: 7908837174 <7908837174@github.com>
1 parent 1a4a60b commit 02ca03a

File tree

1 file changed

+78
-29
lines changed

1 file changed

+78
-29
lines changed

demo/psa/manual-end-to-end.md

Lines changed: 78 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -38,36 +38,85 @@ sudo apt-get install tmux
3838

3939

4040
* For build to succeed one needs to install following packages:
41-
1. protoc-gen-go with version v1.26
42-
From `https://github.com/protocolbuffers/protobuf/releases` download the `protobuf-all-[VERSION].tar.gz`.
43-
Extract the contents and change in the directory
4441

45-
```sh
46-
./configure
47-
make
48-
make check
49-
sudo make install
50-
```
51-
To check if this works
52-
`protoc --version`
53-
54-
2. protoc-gen-go-grpc version v1.1
55-
`go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1`
56-
3. protoc-gen-go-json version v1.1.0
57-
`go install github.com/mitchellh/protoc-gen-go-json@v1.1.0`
58-
4. mockgen version v1.6.0
59-
`go install github.com/golang/mock/mockgen@v1.6.0`
60-
61-
### Other systems
62-
63-
* One need to install jq and curl.
64-
65-
66-
* For build to succeed one needs to install following packages:
67-
1. protoc-gen-go with version v1.26
68-
2. protoc-gen-go-grpc version v1.1
69-
3. protoc-gen-go-json version v1.1.0
70-
4. mockgen version v1.6.0
42+
1. **Protocol Buffer Compiler (protoc)**
43+
44+
Download the latest pre-compiled `protoc` binary from [Protocol Buffers releases](https://github.com/protocolbuffers/protobuf/releases).
45+
46+
For Ubuntu/Linux x86_64:
47+
```sh
48+
# Download and install protoc (replace VERSION with latest, e.g., 25.1)
49+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-linux-x86_64.zip
50+
unzip protoc-25.1-linux-x86_64.zip -d $HOME/.local
51+
export PATH="$PATH:$HOME/.local/bin"
52+
```
53+
54+
For macOS:
55+
```sh
56+
# Download and install protoc for macOS
57+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.1/protoc-25.1-osx-x86_64.zip
58+
unzip protoc-25.1-osx-x86_64.zip -d $HOME/.local
59+
export PATH="$PATH:$HOME/.local/bin"
60+
```
61+
62+
For Windows:
63+
```powershell
64+
# Download protoc-25.1-win64.zip from the releases page and extract to a directory
65+
# Add the bin directory to your PATH environment variable
66+
```
67+
68+
To verify installation:
69+
```sh
70+
protoc --version
71+
```
72+
73+
2. **Go Protocol Buffer Plugin (protoc-gen-go) version v1.26**
74+
75+
> **Important**: This is separate from protoc and must be installed via Go:
76+
77+
```sh
78+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26.0
79+
```
80+
3. **protoc-gen-go-grpc version v1.1**
81+
```sh
82+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1
83+
```
84+
85+
4. **protoc-gen-go-json version v1.1.0**
86+
```sh
87+
go install github.com/mitchellh/protoc-gen-go-json@v1.1.0
88+
```
89+
90+
5. **mockgen version v1.6.0**
91+
```sh
92+
go install github.com/golang/mock/mockgen@v1.6.0
93+
```
94+
95+
### Troubleshooting
96+
97+
If you encounter issues with the above installation:
98+
99+
**protoc not found:**
100+
- Ensure `$HOME/.local/bin` is in your `$PATH`
101+
- Try `which protoc` to verify installation location
102+
- For system-wide installation, extract to `/usr/local` instead of `$HOME/.local`
103+
104+
**protoc-gen-go not found:**
105+
- Verify Go is properly installed: `go version`
106+
- Ensure `$GOPATH/bin` (or `$HOME/go/bin`) is in your `$PATH`
107+
- Try `which protoc-gen-go` to verify the plugin is available
108+
- If using Go modules, the default GOPATH is `$HOME/go`
109+
110+
**Permission issues:**
111+
- Use `sudo` for system-wide installation of protoc
112+
- For Go packages, avoid `sudo` as they install in user space
113+
114+
**Build failures with "protoc-gen-go: program not found or is not executable":**
115+
- This indicates protoc cannot find the protoc-gen-go plugin
116+
- Verify both protoc and protoc-gen-go are installed and in PATH
117+
- Try running: `protoc-gen-go --version` to test the plugin directly
118+
119+
**Note:** protoc (the compiler) and protoc-gen-go (the Go plugin) are separate tools that must both be installed for Go protocol buffer generation to work.
71120

72121
* Commands below assume execution in a Bourne-compatible shell. Please adjust appropriately in case any other shell is used.
73122

0 commit comments

Comments
 (0)