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

touch ./__init__.py: Permission denied errors on generate #148

Open
beatthat opened this issue Nov 11, 2019 · 0 comments
Open

touch ./__init__.py: Permission denied errors on generate #148

beatthat opened this issue Nov 11, 2019 · 0 comments

Comments

@beatthat
Copy link

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

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

No branches or pull requests

1 participant