Ignore install as non-existent user or group

'test cases/common/12 data' and 'test cases/common/66 install subdir' both
try to install something as 'root'.  This user doesn't exist on Cygwin.

Perhaps we should automatically convert this to some other user, but it's
not clear which. For real projects, it's possibly better for the meson.build
to explicitly handle this...

'test cases/common/12 data' also tries to install something with GID 0.
There's no guarantee this group exists.
pull/1567/head
Jon Turney 8 years ago
parent 6c9260c47f
commit 320490cd00
  1. 11
      mesonbuild/scripts/meson_install.py

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import sys, pickle, os, shutil, subprocess, gzip, platform import sys, pickle, os, shutil, subprocess, gzip, platform, errno
from glob import glob from glob import glob
from . import depfixer from . import depfixer
from . import destdir_join from . import destdir_join
@ -34,6 +34,15 @@ def set_mode(path, mode):
except PermissionError as e: except PermissionError as e:
msg = '{!r}: Unable to set owner {!r} and group {!r}: {}, ignoring...' msg = '{!r}: Unable to set owner {!r} and group {!r}: {}, ignoring...'
print(msg.format(path, mode.owner, mode.group, e.strerror)) print(msg.format(path, mode.owner, mode.group, e.strerror))
except LookupError as e:
msg = '{!r}: Non-existent owner {!r} or group {!r}: ignoring...'
print(msg.format(path, mode.owner, mode.group))
except OSError as e:
if e.errno == errno.EINVAL:
msg = '{!r}: Non-existent numeric owner {!r} or group {!r}: ignoring...'
print(msg.format(path, mode.owner, mode.group))
else:
raise
# Must set permissions *after* setting owner/group otherwise the # Must set permissions *after* setting owner/group otherwise the
# setuid/setgid bits will get wiped by chmod # setuid/setgid bits will get wiped by chmod
# NOTE: On Windows you can set read/write perms; the rest are ignored # NOTE: On Windows you can set read/write perms; the rest are ignored

Loading…
Cancel
Save