diff --git a/dhpython/build/plugin_distutils.py b/dhpython/build/plugin_distutils.py index ed139aa..7512cc8 100644 --- a/dhpython/build/plugin_distutils.py +++ b/dhpython/build/plugin_distutils.py @@ -107,7 +107,20 @@ class BuildSystem(Base): fpath = join(args['build_dir'], fname) rmtree(fpath) if isdir(fpath) else remove(fpath) - return '{interpreter.binary_dv} {setup_py} install --root {destdir} {args}' + # We pass --force to remove non-determinstic behaviour caused by us + # building multiple Python versions into separate directories under + # {build_dir} but then installing them to the *same* {destdir}. + # + # If any of these builds complete in under 1 second, distutils may + # decide to skip copying files to {destdir} as it incorrectly believes + # them to be up-to-date. This will result in a package arbitrarily + # containing scripts with different version shebangs and, by extension, + # binary dependencies. + # + # Passing --force here avoids the underling calls to distutils's + # `dep_util.newer` and always updates {destdir}. + # + return '{interpreter.binary_dv} {setup_py} install --force --root {destdir} {args}' @shell_command @create_pydistutils_cfg