Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate go codes on making dashboard-backend #84

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

makiuchi-d
Copy link
Member

fix: #82

dashboardのbackendのMakefileから、serverのコード生成を呼び出せるようにしました。
コード生成に必要なgo1.22とprotocをDockerfileでインストールするようにもしてあります。

gopherjs_go="go1.19.13" \
protoc_ver="24.2"
ENV PATH=/root/go/bin:/go/bin:$PATH \
GOPHERJS_GOROOT=/root/sdk/${gopherjs_go}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARGやENVってRUNみたいに \ で複数行繋いだ方がいいんでしたっけ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

レイヤーキャッシュが作られるわけじゃないのでどちらでも良いと思います。
ただ、ENVは複数書けるのですが、ARG複数は正式な書式じゃないみたいなので直します。

@superkerokero
Copy link
Collaborator

wsnet2-dashboard-backend   | mkdir -p ./src/pb
wsnet2-dashboard-backend   | npx grpc_tools_node_protoc \
wsnet2-dashboard-backend   |   --plugin=protoc-gen-ts="node_modules/.bin/protoc-gen-ts" \
wsnet2-dashboard-backend   |   --js_out="import_style=commonjs,binary:./src/pb" \
wsnet2-dashboard-backend   |   --grpc_out="grpc_js:./src/pb" \
wsnet2-dashboard-backend   |   --ts_out="service=grpc-node,mode=grpc-js:./src/pb" \
wsnet2-dashboard-backend   |   -I ../../server/pb ../../server/pb/app.proto ../../server/pb/clientinfo.proto ../../server/pb/gameservice.proto ../../server/pb/roominfo.proto ../../server/pb/roomoption.proto ../../server/pb/timestamp.proto
wsnet2-dashboard-backend   | make -C ../../server generate
wsnet2-dashboard-backend   | make[1]: Entering directory '/repo/server'
wsnet2-dashboard-backend   | make[1]: git: No such file or directory
wsnet2-dashboard-backend   | go install google.golang.org/protobuf/cmd/protoc-gen-go
wsnet2-dashboard-backend   | go: errors parsing go.mod:
wsnet2-dashboard-backend   | /repo/server/go.mod:3: invalid go version '1.22.0': must match format 1.23
wsnet2-dashboard-backend   | make[1]: Leaving directory '/repo/server'
wsnet2-dashboard-backend   | make[1]: *** [Makefile:45: install-deps] Error 1
wsnet2-dashboard-backend   | make: *** [Makefile:43: ../../server/pb/app.pb.go] Error 2
wsnet2-dashboard-backend   | 2024/03/12 07:51:28 [ARELO] command error: process exit: exit status 2

指定されたprotoc-gen-goのバージョンがGo1.23のものっぽい?

@makiuchi-d
Copy link
Member Author

@superkerokero
たぶんイメージが古いままで、古いgoでgo installを呼んでいるときのエラーです。
(go 1.21.0から、go.modの書式が微妙に変わりました)
docker compose build backend でビルドし直すかdocker rmi wsnet2-dashboard-backend してから試してみてください。

@makiuchi-d makiuchi-d merged commit 2821274 into main Mar 15, 2024
2 checks passed
@makiuchi-d makiuchi-d deleted the dashboard-backend-go-generate branch March 15, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dashboard backend error
3 participants