mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Mock Java 8 toolchain so sibling test works on arm runners
This commit is contained in:
@@ -14,11 +14,19 @@ try_use_java11()
|
||||
toolchains_dir = tempfile.mkdtemp(prefix="integration-tests-toolchains-")
|
||||
toolchains_file = os.path.join(toolchains_dir, "toolchains.xml")
|
||||
|
||||
def none_or_blank(s):
|
||||
return s is None or s == ""
|
||||
|
||||
with open(toolchains_file, "w") as f:
|
||||
f.write('<?xml version="1.0" encoding="UTF-8"?>\n<toolchains>\n')
|
||||
|
||||
for v in [8, 11, 17, 21]:
|
||||
homedir = os.getenv("JAVA_HOME_%d_X64" % v)
|
||||
if none_or_blank(homedir):
|
||||
homedir = os.getenv("JAVA_HOME_%d_arm64" % v)
|
||||
if none_or_blank(homedir) and v == 8 and not none_or_blank(os.getenv("JAVA_HOME_11_arm64")):
|
||||
print("Mocking a toolchain entry using Java 11 install as a fake Java 8 entry, so this test behaves the same on x64 and arm64 runners", file = sys.stderr)
|
||||
homedir = os.getenv("JAVA_HOME_11_arm64")
|
||||
if homedir is not None and homedir != "":
|
||||
f.write("""
|
||||
<toolchain>
|
||||
|
||||
Reference in New Issue
Block a user