Skip to content
Snippets Groups Projects
Commit b9489551 authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

BrainScaleS: Fail earlier

Until now we used a lot of try/except to keep going when preparing the
environment for the build; it should just work now, so let's fail early.
parent 06b55c28
No related branches found
No related tags found
3 merge requests!253update branch,!252create new experimental release,!244Update BrainScaleS packages and py-torch
......@@ -62,47 +62,45 @@ class Hxtorch(WafPackage):
include = []
include_exclude_dirs = set(['/usr/include'])
for dep in self.spec.traverse(deptype='build'):
for dep in self.spec.traverse(deptype='build', root=False):
query = self.spec[dep.name]
if dep.name in ['pthreadpool', 'fxdiv']:
print('skipping {} in SPACK_INCLUDE_DIRS/CPATH/C{{,_PLUS}}_INCLUDE_PATH\n'.format(dep.name))
for d in query.headers.directories:
if os.path.exists(d):
env.remove_path('SPACK_INCLUDE_DIRS', d)
continue
try:
if dep.name in ['pthreadpool', 'fxdiv']:
print('skipping {} in SPACK_INCLUDE_DIRS/CPATH/C{{,_PLUS}}_INCLUDE_PATH\n'.format(dep.name))
for d in query.headers.directories:
if os.path.exists(d):
env.remove_path('SPACK_INCLUDE_DIRS', d)
continue
assert(isinstance(query.headers.directories, list))
include_dirs = set(query.headers.directories)
include_dirs -= include_exclude_dirs
print('headers (', dep.name, '):', include_dirs, "\n")
include.extend(list(include_dirs))
except:
except error.NoHeadersError:
# we don't care if no header directories are found
pass
library = []
library_exclude_dirs = set(['/lib', '/lib64', '/usr/lib', '/usr/lib64'])
for dep in self.spec.traverse(deptype=('link', 'run')):
for dep in self.spec.traverse(deptype=('link', 'run'), root=False):
query = self.spec[dep.name]
try:
assert(isinstance(query.libs.directories, list))
library_dirs = set(query.libs.directories)
library_dirs -= library_exclude_dirs
print('libs (', dep.name, '):', library_dirs, "\n")
library.extend(list(library_dirs))
except:
except error.NoLibrariesError:
# we don't care if no library directories are found
pass
path = []
for dep in self.spec.traverse(deptype=('build', 'link', 'run')):
for dep in self.spec.traverse(deptype=('build', 'link', 'run'), root=False):
if dep.name in ['pthreadpool', 'fxdiv']:
print('skipping {} for bin'.format(dep.name))
continue
query = self.spec[dep.name]
try:
if os.path.exists(self.prefix.bin):
path.append(query.prefix.bin)
print('bin (', dep.name, '):', query.prefix.bin, "\n")
except:
pass
# llvm might be built with ~shared_libs but still builds shared libs
if not any('llvm' in lib for lib in library):
......
......@@ -61,38 +61,36 @@ class PynnBrainscales(WafPackage):
include = []
include_exclude_dirs = set(['/usr/include'])
for dep in self.spec.traverse(deptype='build'):
for dep in self.spec.traverse(deptype='build', root=False):
query = self.spec[dep.name]
try:
assert(isinstance(query.headers.directories, list))
include_dirs = set(query.headers.directories)
include_dirs -= include_exclude_dirs
print('headers (', dep.name, '):', include_dirs, "\n")
include.extend(list(include_dirs))
except:
except error.NoHeadersError:
# we don't care if no header directories are found
pass
library = []
library_exclude_dirs = set(['/lib', '/lib64', '/usr/lib', '/usr/lib64'])
for dep in self.spec.traverse(deptype=('link', 'run')):
for dep in self.spec.traverse(deptype=('link', 'run'), root=False):
query = self.spec[dep.name]
try:
assert(isinstance(query.libs.directories, list))
library_dirs = set(query.libs.directories)
library_dirs -= library_exclude_dirs
print('libs (', dep.name, '):', library_dirs, "\n")
library.extend(list(library_dirs))
except:
except error.NoLibrariesError:
# we don't care if no library directories are found
pass
path = []
for dep in self.spec.traverse(deptype=('build', 'link', 'run')):
for dep in self.spec.traverse(deptype=('build', 'link', 'run'), root=False):
query = self.spec[dep.name]
try:
if os.path.exists(self.prefix.bin):
path.append(query.prefix.bin)
print('bin (', dep.name, '):', query.prefix.bin, "\n")
except:
pass
# llvm might be built with ~shared_libs but still builds shared libs
if not any('llvm' in lib for lib in library):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment