So I have a override build script commad with the following:
sudo swig3.0 -python /root/project/lib//mylib.i
sudo gcc -w -fPIC -shared /root/project/lib/mylib_wrap.c -o /root/project/lib/_mylib.so -L. -lpthread -lm -L/root/project/lib/ -l:libmylib32.so.1 -I/usr/include/python3.10
This command works when I run it manually. Source is my repo. However when I build my snap with the snapcraft command I get:
load state file: /root/parts/mylib-build/state/pull
+ sudo swig3.0 -python /root/project/lib/mylib.i
Unable to open file /root/project/lib/mylib_wrap.c: Permission denied
'override-build' in part 'fmyib-build' failed with code 1.
Review the scriptlet and make sure it's correct.
I added in sudo to try and get around it, but I still get the permissions error. Any ideas of how to get this to run in the current folder?