@@ -108,12 +108,17 @@ def _resolve_step_environment(self, ds_root, force=False):
108
108
cached_deps = read_conda_manifest (ds_root , self .flow .name )
109
109
if CondaStepDecorator .conda is None :
110
110
CondaStepDecorator .conda = Conda ()
111
- CondaStepDecorator .environments = CondaStepDecorator .conda .environments (self .flow .name )
111
+ CondaStepDecorator .environments = \
112
+ CondaStepDecorator .conda .environments (self .flow .name )
112
113
if force or env_id not in cached_deps or 'cache_urls' not in cached_deps [env_id ]:
113
114
if force or env_id not in cached_deps :
114
115
deps = self ._step_deps ()
115
116
(exact_deps , urls , order ) = \
116
- self .conda .create (self .step , env_id , deps , architecture = self .architecture )
117
+ self .conda .create (self .step ,
118
+ env_id ,
119
+ deps ,
120
+ architecture = self .architecture ,
121
+ disable_safety_checks = self .disable_safety_checks )
117
122
payload = {
118
123
'explicit' : exact_deps ,
119
124
'deps' : [d .decode ('ascii' ) for d in deps ],
@@ -125,7 +130,8 @@ def _resolve_step_environment(self, ds_root, force=False):
125
130
if self .datastore .TYPE == 's3' and 'cache_urls' not in payload :
126
131
payload ['cache_urls' ] = self ._cache_env ()
127
132
write_to_conda_manifest (ds_root , self .flow .name , env_id , payload )
128
- CondaStepDecorator .environments = CondaStepDecorator .conda .environments (self .flow .name )
133
+ CondaStepDecorator .environments = \
134
+ CondaStepDecorator .conda .environments (self .flow .name )
129
135
return env_id
130
136
131
137
def _cache_env (self ):
@@ -147,13 +153,13 @@ def _download(entry):
147
153
package_info ['fn' ])
148
154
tarball_path = package_info ['package_tarball_full_path' ]
149
155
if tarball_path .endswith ('.conda' ):
150
- #Conda doesn't set the metadata correctly for certain fields
156
+ # Conda doesn't set the metadata correctly for certain fields
151
157
# when the underlying OS is spoofed.
152
158
tarball_path = tarball_path [:- 6 ]
153
159
if not tarball_path .endswith ('.tar.bz2' ):
154
160
tarball_path = '%s.tar.bz2' % tarball_path
155
161
if not os .path .isfile (tarball_path ):
156
- #The tarball maybe missing when user invokes `conda clean`!
162
+ # The tarball maybe missing when user invokes `conda clean`!
157
163
to_download .append ((package_info ['url' ], tarball_path ))
158
164
files .append ((path , tarball_path ))
159
165
if to_download :
@@ -170,10 +176,21 @@ def _prepare_step_environment(self, step_name, ds_root):
170
176
env_id ,
171
177
cached_deps [env_id ]['urls' ],
172
178
architecture = self .architecture ,
173
- explicit = True )
174
- CondaStepDecorator .environments = CondaStepDecorator .conda .environments (self .flow .name )
179
+ explicit = True ,
180
+ disable_safety_checks = self .disable_safety_checks )
181
+ CondaStepDecorator .environments = \
182
+ CondaStepDecorator .conda .environments (self .flow .name )
175
183
return env_id
176
184
185
+ def _disable_safety_checks (self , decos ):
186
+ # Disable conda safety checks when creating linux-64 environments on
187
+ # a macOS. This is needed because of gotchas around inconsistently
188
+ # case-(in)sensitive filesystems for macOS and linux.
189
+ for deco in decos :
190
+ if deco .name == 'batch' and platform .system () == 'Darwin' :
191
+ return True
192
+ return False
193
+
177
194
def _architecture (self , decos ):
178
195
for deco in decos :
179
196
if deco .name == 'batch' :
@@ -205,6 +222,7 @@ def _logger(line, **kwargs):
205
222
self .local_root = LocalDataStore .get_datastore_root_from_config (_logger )
206
223
environment .set_local_root (self .local_root )
207
224
self .architecture = self ._architecture (decos )
225
+ self .disable_safety_checks = self ._disable_safety_checks (decos )
208
226
self .step = step
209
227
self .flow = flow
210
228
self .datastore = datastore
0 commit comments