From 72cc360dcdc0a9048614bf31b859cfaa4c14b51d Mon Sep 17 00:00:00 2001 From: Chris AtLee Date: Thu, 21 May 2020 13:30:54 +0000 Subject: [PATCH] Bug 1637381: Use python3 for repack_rust.py r=glandium repack_rust.py was the only toolchain build using a python script directly. we don't need it to use the `mach python` wrapper, so remove that special casing from the transform. Differential Revision: https://phabricator.services.mozilla.com/D75702 --- taskcluster/docker/toolchain-build/Dockerfile | 2 ++ taskcluster/scripts/misc/repack_rust.py | 8 ++++---- taskcluster/taskgraph/transforms/job/toolchain.py | 10 +--------- 3 files changed, 7 insertions(+), 13 deletions(-) mode change 100644 => 100755 taskcluster/scripts/misc/repack_rust.py diff --git a/taskcluster/docker/toolchain-build/Dockerfile b/taskcluster/docker/toolchain-build/Dockerfile index 12afb759ee87..c638d8d9295d 100644 --- a/taskcluster/docker/toolchain-build/Dockerfile +++ b/taskcluster/docker/toolchain-build/Dockerfile @@ -39,6 +39,8 @@ RUN apt-get update && \ python-setuptools \ python-virtualenv \ python3-distutils-extra \ + python3-requests \ + python3-pytoml \ subversion \ tar \ unzip \ diff --git a/taskcluster/scripts/misc/repack_rust.py b/taskcluster/scripts/misc/repack_rust.py old mode 100644 new mode 100755 index 17fd0470d949..e4937fcdf2ad --- a/taskcluster/scripts/misc/repack_rust.py +++ b/taskcluster/scripts/misc/repack_rust.py @@ -1,4 +1,4 @@ -#!/bin/env python +#!/usr/bin/env python3 # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -70,7 +70,7 @@ def setup_gpg(): signature checks can succeed or fail cleanly.''' keyid = '0x85AB96E6FA1BE5FE' log('Importing signing key %s...' % keyid) - key = ''' + key = b''' -----BEGIN PGP PUBLIC KEY BLOCK----- mQINBFJEwMkBEADlPACa2K7reD4x5zd8afKx75QYKmxqZwywRbgeICeD4bKiQoJZ @@ -159,7 +159,7 @@ Mve696B5tlHyc1KxjHR6w9GRsh4= ''' check_call_with_input(['gpg', '--import'], key) check_call_with_input(['gpg', '--command-fd', '0', '--edit-key', keyid], - 'trust\n5\ny\n') + b'trust\n5\ny\n') def verify_sha(filename, sha): @@ -432,7 +432,7 @@ def args(): if not args.host: args.host = 'linux64' args.host = expand_platform(args.host) - args.targets = map(expand_platform, args.targets) + args.targets = [expand_platform(t) for t in args.targets] return args diff --git a/taskcluster/taskgraph/transforms/job/toolchain.py b/taskcluster/taskgraph/transforms/job/toolchain.py index f5dabc94218b..d57605a29587 100644 --- a/taskcluster/taskgraph/transforms/job/toolchain.py +++ b/taskcluster/taskgraph/transforms/job/toolchain.py @@ -8,7 +8,6 @@ Support for running toolchain-building jobs via dedicated scripts from __future__ import absolute_import, print_function, unicode_literals from mozbuild.shellutil import quote as shell_quote -from mozpack import path from six import text_type from taskgraph.util.schema import Schema @@ -149,17 +148,10 @@ def docker_worker_toolchain(config, job, taskdesc): 'digest-data': get_digest_data(config, run, taskdesc), } - # Use `mach` to invoke python scripts so in-tree libraries are available. - if run['script'].endswith('.py'): - wrapper = [path.join(gecko_path, 'mach'), 'python'] - else: - wrapper = [] - run['using'] = 'run-task' run['cwd'] = run['workdir'] run["command"] = ( - wrapper - + ["workspace/build/src/taskcluster/scripts/misc/{}".format(run.pop("script"))] + ["workspace/build/src/taskcluster/scripts/misc/{}".format(run.pop("script"))] + run.pop("arguments", []) )