Skip to content

Commit 045d8d7

Browse files
committed
chore(cosmos): attempt to work around fs perms
1 parent 014da25 commit 045d8d7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

golang/cosmos/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,17 @@ endif
9393

9494
protoVer=0.15.3
9595
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
96-
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
96+
#protoUserFlags=-e HOME=/tmp \
97+
# --user=$(shell id -u):$(shell id -g) \
98+
# $(shell id -G | xargs -n1 printf -- ' --group-add %s')
99+
protoImage=$(DOCKER) run --rm $(protoUserFlags) \
100+
-v $(CURDIR):/workspace:z --workdir /workspace $(protoImageName)
97101

98102
proto-all: proto-format proto-lint proto-gen
99103

104+
proto-sh:
105+
$(protoImage) sh
106+
100107
proto-gen:
101108
@echo "Generating Protobuf files"
102109
@$(protoImage) sh ./scripts/protocgen.sh

golang/cosmos/scripts/protocgen.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55
# docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh
66

77
set -eo pipefail
8+
cd proto
9+
10+
if touch .permtest; then
11+
rm -f .permtest
12+
else
13+
echo "ERROR: Cannot write to the current directory. Please check the permissions for this user."
14+
id || true
15+
ls -ald . || true
16+
exit 1
17+
fi
818

919
echo "Generating gogo proto code"
10-
cd proto
1120
proto_dirs=$(find . -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
1221
for dir in $proto_dirs; do
1322
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do

0 commit comments

Comments
 (0)