On a Fedora 36 VM with podman and running pre-commit against a folder mounted using parallels from macos, it not possible to use pre-commit because the mount fails:
ShellCheck v0.8.0........................................................Failed
- hook id: shellcheck
- duration: 0.48s
- exit code: 126
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: lsetxattr /media/psf/c/a/creator-ee/.cache: operation not supported
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Error: lsetxattr /media/psf/c/a/creator-ee/.cache: operation not supported
This is happening because macos filesystem does not allow extended attributes, so podman will not be able to call lsetxattr. If the :Z would be omitted when running the container engine, the issue would not appear.
I would be happy to contribute a fix for this but I should probably wait for some feedback regarding the direction in which this should go, especially as you will want to minimize the impact on current users.
I guess that testing if extended attributes on current directory are working should not be too hard and if this fails, we could avoid adding the :Z to the volume mounts. This should minimize the behavior change IMHO.
I will try using shellcheck-py, not sure why I did not pick it at that time, probably I will find-out soon.
FYI, I already started with podman team on making some changes to improve the podman experience and I have a PR related to this podman-container-tools/podman#16261 but I have the impression that we will not be able to address an explicitly added :Z even when that PR will merge. What made me raise the linked PR on podman was bit different and was related to podman-machine on macos (the vm that is installed by podman on mac). On Fedora VM, the situation is different. Still, both issues are related to drive mounts that do not support extended attributes and selinux.
I am wondering why a linter would need to make use of extended attribute volume mounts? Some might even say that the mounts could be ro if they don't want to use auto-fix ability.
It did not take me long to find why I did not use the wheel. It does not come with arm64 build, but the container does, and that is not something to be ignored.
Activity
asottile commented on Oct 26, 2022
didn't think to search "docker Z" ? duplicate: #2509
I'd recommend using shellcheck-py instead -- it installs natively and generally fits better with the framework
ssbarnea commented on Oct 26, 2022
I will try using shellcheck-py, not sure why I did not pick it at that time, probably I will find-out soon.
FYI, I already started with podman team on making some changes to improve the podman experience and I have a PR related to this podman-container-tools/podman#16261 but I have the impression that we will not be able to address an explicitly added :Z even when that PR will merge. What made me raise the linked PR on podman was bit different and was related to podman-machine on macos (the vm that is installed by podman on mac). On Fedora VM, the situation is different. Still, both issues are related to drive mounts that do not support extended attributes and selinux.
I am wondering why a linter would need to make use of extended attribute volume mounts? Some might even say that the mounts could be ro if they don't want to use auto-fix ability.
asottile commented on Oct 26, 2022
you're free to git blame and find out the reason it was changed to include :Z
ssbarnea commented on Oct 26, 2022
It did not take me long to find why I did not use the wheel. It does not come with arm64 build, but the container does, and that is not something to be ignored.
asottile commented on Oct 26, 2022
there's no wheel involved either way so that's not relevant
Replace docker container shellcheck with python based hook