`touch ./__init__.py: Permission denied` errors on generate
beatthat opened this issue · 0 comments
I'm trying to use namely:protoc-all
to generate pb classes for python. It seems like a great tool, but I'm getting permissions errors about the python init.py module files every time I run it. Oddly, the generation seems to succeed, but then only the touch fails.
My intention is to have the generated files and directories owned by the shell user as if they'd run everything locally, so I'm using roughly this make rule:
PROJECT=$(shell git rev-parse --show-toplevel 2> /dev/null)
DIR=$(shell pwd)
DOCKER_PROTOC=namely/protoc-all:1.23_0
UID=$(shell id -u)
GID=$(shell id -g)
.PHONY: types-python
types-python:
cd proto && \
docker run \
-u $(UID):$(GID) \
-v $(DIR)/proto:/defs \
-v $(DIR)/pose_detection/protobuf:/pose_detection/protobuf \
$(DOCKER_PROTOC) -l python -f poses.proto -o /pose_detection/protobuf
...when I run the above, it succeeds in generated the python classes, but I get an error message too:
make types-python
cd proto && \
docker run \
-u 1001:1001 \
-v /home/larry/projects/pose-detection/protobuf/proto:/defs \
-v /home/larry/projects/pose-detection/protobuf/pose_detection/protobuf:/pose_detection/protobuf \
namely/protoc-all:1.23_0 -l python -f poses.proto -o /pose_detection/protobuf
touch: /pose_detection/__init__.py: Permission denied
Makefile:9: recipe for target 'types-python' failed
make: *** [types-python] Error 1
I'm assuming generating compiled protobuf classes to a local directory is a common purpose for this tool, so maybe I'm just doing something wrong? If that's the case and there's a correction, I would volunteer to update the README with the details.
Thanks,
Larry