Skip to content

Commit

Permalink
dont filter out compilers that lack binary support
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf committed Oct 14, 2023
1 parent 8d6aef8 commit 2944309
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 43 deletions.
43 changes: 22 additions & 21 deletions bin/lib/amazon_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_specific_library_version_details(libraries, libid, library_version):
COMPILEROPT_RE = re.compile(r"(\w*)\.(.*)\.(\w*)")


def get_properties_compilers_and_libraries(language, logger):
def get_properties_compilers_and_libraries(language, logger, filter_binary_support: bool = True):
_compilers: Dict[str, Dict[str, Any]] = defaultdict(lambda: {})
_libraries: Dict[str, Dict[str, Any]] = defaultdict(lambda: {})

Expand Down Expand Up @@ -124,26 +124,27 @@ def get_properties_compilers_and_libraries(language, logger):
else:
_compilers[compiler][key] = val

logger.debug("Removing compilers that are not available or do not support binaries")
keys_to_remove = set()
for compiler in _compilers:
if "supportsBinary" in _compilers[compiler] and not _compilers[compiler]["supportsBinary"]:
logger.debug("%s does not supportsBinary", compiler)
keys_to_remove.add(compiler)
elif "compilerType" in _compilers[compiler] and _compilers[compiler]["compilerType"] == "wine-vc":
keys_to_remove.add(compiler)
logger.debug("%s is wine", compiler)
elif "exe" in _compilers[compiler]:
exe = _compilers[compiler]["exe"]
if not os.path.exists(exe):
if filter_binary_support:
logger.debug("Removing compilers that are not available or do not support binaries")
keys_to_remove = set()
for compiler in _compilers:
if "supportsBinary" in _compilers[compiler] and not _compilers[compiler]["supportsBinary"]:
logger.debug("%s does not supportsBinary", compiler)
keys_to_remove.add(compiler)
logger.debug("%s does not exist (looked for %s)", compiler, exe)
else:
keys_to_remove.add(compiler)
logger.debug("%s didn't have the required config keys", compiler)

for compiler in keys_to_remove:
logger.debug("removing %s", compiler)
del _compilers[compiler]
elif "compilerType" in _compilers[compiler] and _compilers[compiler]["compilerType"] == "wine-vc":
keys_to_remove.add(compiler)
logger.debug("%s is wine", compiler)
elif "exe" in _compilers[compiler]:
exe = _compilers[compiler]["exe"]
if not os.path.exists(exe):
keys_to_remove.add(compiler)
logger.debug("%s does not exist (looked for %s)", compiler, exe)
else:
keys_to_remove.add(compiler)
logger.debug("%s didn't have the required config keys", compiler)

for compiler in keys_to_remove:
logger.debug("removing %s", compiler)
del _compilers[compiler]

return [_compilers, _libraries]
44 changes: 22 additions & 22 deletions bin/lib/nightly_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,28 @@ def __init__(self, logger):

def load_ce_properties(self):
if not self.props_loaded:
[self.ada, _] = get_properties_compilers_and_libraries("ada", self.logger)
[self.assembly, _] = get_properties_compilers_and_libraries("assembly", self.logger)
[self.c, _] = get_properties_compilers_and_libraries("c", self.logger)
[self.circle, _] = get_properties_compilers_and_libraries("circle", self.logger)
[self.circt, _] = get_properties_compilers_and_libraries("circt", self.logger)
[self.clean, _] = get_properties_compilers_and_libraries("clean", self.logger)
[self.cpp_for_opencl, _] = get_properties_compilers_and_libraries("cpp_for_opencl", self.logger)
[self.cpp, _] = get_properties_compilers_and_libraries("c++", self.logger)
[self.cppx, _] = get_properties_compilers_and_libraries("cppx", self.logger)
[self.d, _] = get_properties_compilers_and_libraries("d", self.logger)
[self.dart, _] = get_properties_compilers_and_libraries("dart", self.logger)
[self.fortran, _] = get_properties_compilers_and_libraries("fortran", self.logger)
[self.go, _] = get_properties_compilers_and_libraries("go", self.logger)
[self.hlsl, _] = get_properties_compilers_and_libraries("hlsl", self.logger)
[self.ispc, _] = get_properties_compilers_and_libraries("ispc", self.logger)
[self.javascript, _] = get_properties_compilers_and_libraries("javascript", self.logger)
[self.mlir, _] = get_properties_compilers_and_libraries("mlir", self.logger)
[self.nim, _] = get_properties_compilers_and_libraries("nim", self.logger)
[self.pony, _] = get_properties_compilers_and_libraries("pony", self.logger)
[self.rust, _] = get_properties_compilers_and_libraries("rust", self.logger)
[self.swift, _] = get_properties_compilers_and_libraries("swift", self.logger)
[self.zig, _] = get_properties_compilers_and_libraries("zig", self.logger)
[self.ada, _] = get_properties_compilers_and_libraries("ada", self.logger, False)
[self.assembly, _] = get_properties_compilers_and_libraries("assembly", self.logger, False)
[self.c, _] = get_properties_compilers_and_libraries("c", self.logger, False)
[self.circle, _] = get_properties_compilers_and_libraries("circle", self.logger, False)
[self.circt, _] = get_properties_compilers_and_libraries("circt", self.logger, False)
[self.clean, _] = get_properties_compilers_and_libraries("clean", self.logger, False)
[self.cpp_for_opencl, _] = get_properties_compilers_and_libraries("cpp_for_opencl", self.logger, False)
[self.cpp, _] = get_properties_compilers_and_libraries("c++", self.logger, False)
[self.cppx, _] = get_properties_compilers_and_libraries("cppx", self.logger, False)
[self.d, _] = get_properties_compilers_and_libraries("d", self.logger, False)
[self.dart, _] = get_properties_compilers_and_libraries("dart", self.logger, False)
[self.fortran, _] = get_properties_compilers_and_libraries("fortran", self.logger, False)
[self.go, _] = get_properties_compilers_and_libraries("go", self.logger, False)
[self.hlsl, _] = get_properties_compilers_and_libraries("hlsl", self.logger, False)
[self.ispc, _] = get_properties_compilers_and_libraries("ispc", self.logger, False)
[self.javascript, _] = get_properties_compilers_and_libraries("javascript", self.logger, False)
[self.mlir, _] = get_properties_compilers_and_libraries("mlir", self.logger, False)
[self.nim, _] = get_properties_compilers_and_libraries("nim", self.logger, False)
[self.pony, _] = get_properties_compilers_and_libraries("pony", self.logger, False)
[self.rust, _] = get_properties_compilers_and_libraries("rust", self.logger, False)
[self.swift, _] = get_properties_compilers_and_libraries("swift", self.logger, False)
[self.zig, _] = get_properties_compilers_and_libraries("zig", self.logger, False)

self.props_loaded = True

Expand Down
5 changes: 5 additions & 0 deletions bin/test/amazon_properties_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ def test_googletest_should_have_versions():
# def test_should_contain_optionsforclang800():
# [_compilers, _libraries] = get_properties_compilers_and_libraries('c++', logger)
# assert '--gcc-toolchain=/opt/compiler-explorer/gcc-8.3.0' in _compilers['clang800']['options']

# def test_should_contain_mrustc():
# [_compilers, _libraries] = get_properties_compilers_and_libraries('rust', logger, False)
# print(_compilers)
# assert 'mrustc-master' in _compilers

0 comments on commit 2944309

Please sign in to comment.