Skip to content

Commit faa4e35

Browse files
committed
Revert "[lit] Implement builtin umask (llvm#94621)"
This reverts commit 9f6dd1f. Reverting to investigate buildbot failures e.g.: "new failure on builder ppc64le-mlir-rhel-clang running on ppc64le-mlir-rhel-test"
1 parent 1f238ea commit faa4e35

File tree

9 files changed

+7
-58
lines changed

9 files changed

+7
-58
lines changed

llvm/test/tools/llvm-dwarfutil/ELF/X86/mirror-permissions-unix.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Setting the umask to 0 ensures deterministic permissions across
44
## test environments.
55
# UNSUPPORTED: system-windows
6+
# REQUIRES: shell
67

78
# RUN: touch %t
89
# RUN: chmod 0777 %t

llvm/test/tools/llvm-objcopy/ELF/mirror-permissions-unix.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
## Setting the umask to 0 ensures deterministic permissions across
77
## test environments.
88
# UNSUPPORTED: system-windows
9+
# REQUIRES: shell
910

1011
# RUN: touch %t
1112
# RUN: chmod 0777 %t

llvm/test/tools/llvm-objcopy/ELF/respect-umask.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
## This tests that the umask is respected when
22
## assigning permissions of output files.
33

4-
## Windows has no umask so this test makes no sense.
4+
## Windows has no umask so this test makes no sense, nor would
5+
## it work because there is no umask(1) in a Windows environment
56
# UNSUPPORTED: system-windows
7+
# REQUIRES: shell
68

79
# RUN: rm -f %t
810
# RUN: touch %t

llvm/utils/lit/lit/TestRunner.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ class ShellEnvironment(object):
8787
we maintain a dir stack for pushd/popd.
8888
"""
8989

90-
def __init__(self, cwd, env, umask=-1):
90+
def __init__(self, cwd, env):
9191
self.cwd = cwd
9292
self.env = dict(env)
93-
self.umask = umask
9493
self.dirStack = []
9594

9695
def change_dir(self, newdir):
@@ -566,20 +565,6 @@ class SHFILEOPSTRUCTW(Structure):
566565
return ShellCommandResult(cmd, "", stderr.getvalue(), exitCode, False)
567566

568567

569-
def executeBuiltinUmask(cmd, shenv):
570-
"""executeBuiltinUmask - Change the current umask."""
571-
if os.name != "posix":
572-
raise InternalShellError(cmd, "'umask' not supported on this system")
573-
if len(cmd.args) != 2:
574-
raise InternalShellError(cmd, "'umask' supports only one argument")
575-
try:
576-
# Update the umask in the parent environment.
577-
shenv.umask = int(cmd.args[1], 8)
578-
except ValueError as err:
579-
raise InternalShellError(cmd, "Error: 'umask': %s" % str(err))
580-
return ShellCommandResult(cmd, "", "", 0, False)
581-
582-
583568
def executeBuiltinColon(cmd, cmd_shenv):
584569
"""executeBuiltinColon - Discard arguments and exit with status 0."""
585570
return ShellCommandResult(cmd, "", "", 0, False)
@@ -734,7 +719,6 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
734719
"popd": executeBuiltinPopd,
735720
"pushd": executeBuiltinPushd,
736721
"rm": executeBuiltinRm,
737-
"umask": executeBuiltinUmask,
738722
":": executeBuiltinColon,
739723
}
740724
# To avoid deadlock, we use a single stderr stream for piped
@@ -756,7 +740,7 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
756740
# env FOO=1 llc < %s | env BAR=2 llvm-mc | FileCheck %s
757741
# env FOO=1 %{another_env_plus_cmd} | FileCheck %s
758742
if cmd_shenv is shenv:
759-
cmd_shenv = ShellEnvironment(shenv.cwd, shenv.env, shenv.umask)
743+
cmd_shenv = ShellEnvironment(shenv.cwd, shenv.env)
760744
args = updateEnv(cmd_shenv, args)
761745
if not args:
762746
raise InternalShellError(j, "Error: 'env' requires a" " subcommand")
@@ -900,7 +884,6 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
900884
close_fds=kUseCloseFDs,
901885
universal_newlines=True,
902886
errors="replace",
903-
umask=cmd_shenv.umask,
904887
)
905888
)
906889
proc_not_counts.append(not_count)

llvm/utils/lit/tests/Inputs/shtest-umask/lit.cfg

Lines changed: 0 additions & 7 deletions
This file was deleted.

llvm/utils/lit/tests/Inputs/shtest-umask/umask-bad-arg.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

llvm/utils/lit/tests/Inputs/shtest-umask/umask-ok.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

llvm/utils/lit/tests/Inputs/shtest-umask/umask-too-many-args.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

llvm/utils/lit/tests/shtest-umask.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)