From e05dc996facd11d77f64f6d00ce70a5d72db000e Mon Sep 17 00:00:00 2001 From: Ben Hearsum Date: Thu, 30 Oct 2025 12:51:18 -0400 Subject: [PATCH] fix: support windows in `run-task` Taskgraph's version of `run-task` does not currently support Windows. After some investigation, it looks like much of https://bugzilla.mozilla.org/show_bug.cgi?id=1459737 was already ported to it - the only thing that we need to change is to relocate the POSIX-specific imports into a POSIX-specific function. --- src/taskgraph/run-task/run-task | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/taskgraph/run-task/run-task b/src/taskgraph/run-task/run-task index 2265fadf5..17c4f02e8 100755 --- a/src/taskgraph/run-task/run-task +++ b/src/taskgraph/run-task/run-task @@ -16,12 +16,10 @@ current time to improve log usefulness. import argparse import datetime import errno -import grp import io import json import os import platform -import pwd import re import shutil import socket @@ -311,6 +309,9 @@ def run_command(prefix, args, *, extra_env=None, cwd=None): def get_posix_user_group(user, group): + import grp # noqa: PLC0415 + import pwd # noqa: PLC0415 + try: user_record = pwd.getpwnam(user) except KeyError: