Skip to content

Commit 67a59e0

Browse files
authored
Merge pull request #267 from bgilbert/meson
Drop workaround for sdist failure on stale work tree
2 parents cb400c4 + 15a11c5 commit 67a59e0

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

bintool

+17-7
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ from common.meson import (
5050
)
5151
from common.software import Project
5252

53+
WINDOWS_API_VERS = (4,)
54+
LINUX_API_VERS = (3,)
55+
# we have a higher minimum than the underlying meson.build
56+
MESON_MIN_VER = (1, 5, 0)
57+
5358
CACHEDIR_TAG_CONTENTS = '''Signature: 8a477f597d28d172789f06886806bc55
5459
# This file is a cache directory tag created by openslide-bin.
5560
# For information about cache directory tags, see https://bford.info/cachedir/
@@ -147,16 +152,26 @@ class BuildParams:
147152
return False
148153

149154
with self.lock():
150-
if has_api('winbuild', [1, 2, 3]):
155+
if has_api('winbuild', WINDOWS_API_VERS):
151156
plat: Platform = MesonPlatform(
152157
self, 'windows', 'x64', cross=True
153158
)
154-
elif has_api('linux', [1, 2]):
159+
elif has_api('linux', LINUX_API_VERS):
155160
plat = MesonPlatform(
156161
self, 'linux', platform.machine(), cross=False
157162
)
158163
elif sys.platform == 'darwin':
159164
# no container image to check for
165+
meson_ver = (
166+
subprocess.check_output(['meson', '--version'])
167+
.decode()
168+
.strip()
169+
)
170+
if tuple(int(c) for c in meson_ver.split('.')) < MESON_MIN_VER:
171+
raise Exception(
172+
f'Meson version {meson_ver} < '
173+
f'{".".join(str(c) for c in MESON_MIN_VER)}'
174+
)
160175
plat = MacPlatform(self, ['arm64', 'x86_64'])
161176
else:
162177
raise Exception(
@@ -344,11 +359,6 @@ class MesonPlatform(Platform):
344359
cwd=self.params.root,
345360
)
346361
dir = self._setup('sdist', ['-Dall_systems=true'])
347-
# avoid spurious complaints about a dirty work tree
348-
# https://github.com/mesonbuild/meson/pull/13152
349-
subprocess.check_call(
350-
['git', 'update-index', '-q', '--refresh'], cwd=self.params.root
351-
)
352362
subprocess.check_call(
353363
[
354364
# xz compresses better, but PyPI requires tar.gz, and there's

0 commit comments

Comments
 (0)