Skip to content

Commit 15fd6ec

Browse files
eli-schwartznirbheek
authored andcommitted
wrap: catch failure to extract tarball and raise WrapException
This most likely happens when the source archive has files which take advantage of case sensitivity, and someone is unfortunate enough to have to work with broken operating systems that do not have the capacity to use modern technology, like the 1970s invention of case sensitive filesystems. For example, Windows and macOS both have retrocomputing environments, where case sensitive abilities were carefully removed from modern filesystems in order to share the delights of classical computing with the masses. On such systems, innocent tarballs fail to extract with: ``` OSError: [Errno 22] Invalid argument: 'C:\path\to\file' ``` thereby demonstrating Microsoft's unbounded and enthusiastic love for users (who are, universally, retrocomputing fans). n.b. there is, begrudgingly, a secret option for crazy people who hate retrocomputing to enable modern 1970s computing on Windows systems. Naturally, no one with any sense would ever use this, and it is rightly left in its sensible default in for example Github Actions. Fixes mesonbuild#12344
1 parent 361812c commit 15fd6ec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mesonbuild/wrap/wrap.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,10 @@ def get_file(self) -> None:
547547
if 'lead_directory_missing' in self.wrap.values:
548548
os.mkdir(self.dirname)
549549
extract_dir = self.dirname
550-
shutil.unpack_archive(path, extract_dir)
550+
try:
551+
shutil.unpack_archive(path, extract_dir)
552+
except OSError as e:
553+
raise WrapException(f'failed to unpack archive with error: {str(e)}') from e
551554

552555
def get_git(self) -> None:
553556
if not GIT:

0 commit comments

Comments
 (0)