From f8e37d21007f20c83fc37c5566890bcfb35a5cce Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 19 Mar 2020 08:18:37 +0000 Subject: [PATCH] Bug 1621845 - Normalize fetch path in fetch-content. r=rstewart The win64-aarch64 have a kind of a nasty trick that makes fetch-content download artifacts of a dependent task directly as artifacts of the task itself. For some reason, while this pattern works on native Windows jobs, it doesn't on Linux. What happens is essentially that: `pathlib.Path(path).joinpath('../foo').mkdir(parents=True, exist=ok=True)` fails when path doesn't exist first. I guess the fetches directory already exists on Windows worker or something. Unfortunately, os.path.normpath doesn't take `pathlib.Path`s in still-supported python 3.5, so we have to convert to str first. Differential Revision: https://phabricator.services.mozilla.com/D66518 --HG-- extra : moz-landing-system : lando --- taskcluster/scripts/misc/fetch-content | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/taskcluster/scripts/misc/fetch-content b/taskcluster/scripts/misc/fetch-content index f142608864c5..664330010f7c 100755 --- a/taskcluster/scripts/misc/fetch-content +++ b/taskcluster/scripts/misc/fetch-content @@ -590,7 +590,8 @@ def command_task_artifacts(args): for fetch in fetches: extdir = pathlib.Path(args.dest) if 'dest' in fetch: - extdir = extdir.joinpath(fetch['dest']) + # Note: normpath doesn't like pathlib.Path in python 3.5 + extdir = pathlib.Path(os.path.normpath(str(extdir.joinpath(fetch['dest'])))) extdir.mkdir(parents=True, exist_ok=True) root_url = os.environ['TASKCLUSTER_ROOT_URL'] if fetch['artifact'].startswith('public/'):