pypa / cibuildwheel

🎡 Build Python wheels for all the platforms with minimal configuration.
https://cibuildwheel.pypa.io
Other
1.78k stars 227 forks source link

Issue with file permissions in tests on Linux GHA build #1882

Open larsoner opened 2 weeks ago

larsoner commented 2 weeks ago

Description

In h5py tests, we do:

os.chmod(fname, stat.S_IREAD)  # Make file read-only

where fname comes from tempfile.mktemp(..., dir=None), and then check that trying to append to this file raises a PermissionError. However, on the Linux build on GHA (only) it does not. This was found as part of a migration from Azure over to GHA -- Azure did not seem to have this problem. None of our other non-cibuildwheel CIs have shown this problem.

Is it possible that this is related to the containerized structure where permissions aren't set on temp files properly for some reason? With a debug statement from https://github.com/h5py/h5py/pull/2444/commits/4e6738802a0554912a40dc5fa7bb1842cef1394a, though, I can see that at least Python thinks the permissions have changed properly from 33188 to 33024.

We do also use

manylinux-x86_64-image = "ghcr.io/h5py/manylinux2014_x86_64-hdf5"
manylinux-aarch64-image = "ghcr.io/h5py/manylinux2014_aarch64-hdf5"

so maybe we have some issue with our custom images somehow.

So not 100% sure this is a cibuildwheel problem but wanted to open the issue in case it is.

Build log

https://github.com/h5py/h5py/actions/runs/9517645998/job/26236715157?pr=2444#step:11:2400

CI config

https://github.com/larsoner/h5py/blob/gha/.github/workflows/build_wheels.yml