Add ability to change the paths used in build containers
Description
When running in a custom image, the user may not have permissions to write to / including /project. To solve this, we could extract out these pre-defined paths and make them configurable.
Alternatively (for my case), we could allow arbitrary arguments to be passed to docker run, which would allow me to set --user root
As a side benefit, this would allow us to address https://github.com/pypa/cibuildwheel/issues/1310 by running as non-root rather than hiding the error.
Build log
No response
CI config
No response
The manylinux images have the docker WORKDIR set to /. So we could change our logic to have cibuildwheel use the paths $(workdir)/project and $(workdir)/output etc. That would avoid an extra option. We might have to change how cwd works in OCIContainer, but it does make sense that if a container sets a WORKDIR, we should use it. Would that fix the issue for you @bplotnick ?
@joerick yeah that would work. It might break backwards compatibility per Hyrum's Law - if anyone is using a custom image and relying on what's cwd. Maybe that's OK though.