diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index c94515e7..ad844844 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -18,11 +18,18 @@ IS_RUNNING_ON_AZURE = Path('C:\\hostedtoolcache').exists() IS_RUNNING_ON_TRAVIS = os.environ.get('TRAVIS_OS_NAME') == 'windows' +def normalize(x: [Union[str, PathLike]], cwd: Optional[PathLike]) -> str: + if hasattr(x, 'resolve'): + return str((cwd / x if cwd is not None else x).resolve()) + else: + return x + + def shell(args: Sequence[Union[str, PathLike]], env: Optional[Dict[str, str]] = None, cwd: Optional[str] = None) -> int: - command = ' '.join(str(a) for a in args) + command = ' '.join(normalize(a, cwd) for a in args) print(f'+ {command}') - return subprocess.check_call(list(str(a) for a in args), env=env, cwd=cwd) + return subprocess.check_call(list(normalize(a, cwd) for a in args), env=env, cwd=cwd) def get_nuget_args(version: str, arch: str) -> List[str]: