diff --git a/src/test/py/bazel/runfiles_test.py b/src/test/py/bazel/runfiles_test.py index f5bb9b2ff66adb..633548d2580a2f 100644 --- a/src/test/py/bazel/runfiles_test.py +++ b/src/test/py/bazel/runfiles_test.py @@ -47,13 +47,9 @@ def _AssertRunfilesLibraryInBazelToolsRepo(self, family, lang_name): self.AssertExitCode(exit_code, 0, stderr) bazel_bin = stdout[0] - # TODO(brandjon): (Issue #8169) Make this test compatible with Python - # toolchains. Blocked on the fact that there's no PY3 environment on our Mac - # workers (bazelbuild/continuous-integration#578). exit_code, _, stderr = self.RunBazel([ "build", "--verbose_failures", - "--incompatible_use_python_toolchains=false", "//foo:runfiles-" + family ]) self.AssertExitCode(exit_code, 0, stderr) diff --git a/tools/python/pywrapper_test.py b/tools/python/pywrapper_test.py index 14fd0d70e41c62..f5eacd54c6ce61 100644 --- a/tools/python/pywrapper_test.py +++ b/tools/python/pywrapper_test.py @@ -86,7 +86,12 @@ def setup_tool(self, cmd): path = which(cmd) self.assertIsNotNone( path, msg="Could not locate '%s' command on PATH" % cmd) - self.CopyFile(path, os.path.join("dir", cmd), executable=True) + # On recent MacOs versions, copying the coreutils tools elsewhere doesn't + # work -- they simply fail with "Killed: 9". To workaround that, just + # re-exec the actual binary. + self.ScratchFile("dir/" + cmd, + ["#!/bin/sh", 'exec {} "$@"'.format(cmd)], + executable=True) def locate_runfile(self, runfile_path): resolved_path = self.Rlocation(runfile_path)