@@ -81,41 +81,6 @@ def replace_module_prefixes(match):
81
81
f .truncate ()
82
82
83
83
84
- def _read_output_file_map (command ):
85
- for i in range (len (command )):
86
- if command [i ] == "-output-file-map" :
87
- with open (command [i + 1 ]) as f :
88
- return json .load (f )
89
-
90
- return None
91
-
92
-
93
- def _validate_file_type_of_incremental_output (command ):
94
- output_file_map = _read_output_file_map (command )
95
- if output_file_map is None :
96
- print ("Failed to read output file map" , file = sys .stderr )
97
- sys .exit (1 )
98
-
99
- for _ , outputs in output_file_map .items ():
100
- swiftdeps = outputs .get ("swift-dependencies" , None )
101
- if swiftdeps :
102
- with open (swiftdeps , "rb" ) as f :
103
- magic = f .read (4 )
104
- if not (magic == b"DDEP" or magic == b"DEPS" ):
105
- print (
106
- f"Invalid magic number in { swiftdeps } : { magic } " , file = sys .stderr
107
- )
108
- sys .exit (1 )
109
-
110
- obj = outputs .get ("object" , None )
111
- if obj :
112
- with open (obj , "rb" ) as f :
113
- magic = f .read (4 )
114
- if magic != b"\xcf \xfa \xed \xfe " :
115
- print (f"Invalid magic number in { obj } : { magic } " , file = sys .stderr )
116
- sys .exit (1 )
117
-
118
-
119
84
def main ():
120
85
env = os .environ .copy ()
121
86
if "INSIDE_RE_WORKER" in env and _RE_TMPDIR_ENV_VAR in env :
@@ -190,9 +155,6 @@ def main():
190
155
if should_remove_module_prefixes :
191
156
_remove_swiftinterface_module_prefixes (command )
192
157
193
- if "-incremental" in command :
194
- _validate_file_type_of_incremental_output (command )
195
-
196
158
sys .exit (result .returncode )
197
159
198
160
0 commit comments