Skip to content

Commit e8054af

Browse files
committed
[GR-28917] Enable building LLVM runtime installable on Windows.
PullRequest: graal/12683
2 parents d3d8495 + 55e4a4a commit e8054af

File tree

7 files changed

+52
-19
lines changed

7 files changed

+52
-19
lines changed

sulong/mx.sulong/mx_sulong.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ def __init__(self, name, dist, bootstrap_dist, tools, suite):
379379
self.llvm_binutil_tools = [tool.upper() for tool in ToolchainConfig._llvm_tool_map]
380380
self.suite = suite
381381
self.mx_command = self.name + '-toolchain'
382-
self.tool_map = {tool: [_cmd_sub(alias.format(name=name)) for alias in aliases] for tool, aliases in ToolchainConfig._tool_map.items()}
383-
self.path_map = {_cmd_sub(path): tool for tool, aliases in self.tool_map.items() for path in aliases}
382+
self.tool_map = {tool: [_exe_sub(alias.format(name=name)) for alias in aliases] for tool, aliases in ToolchainConfig._tool_map.items()}
383+
self.path_map = {_exe_sub(path): tool for tool, aliases in self.tool_map.items() for path in aliases}
384384
# register mx command
385385
mx.update_commands(_suite, {
386386
self.mx_command: [self._toolchain_helper, 'launch {} toolchain commands'.format(self.name)],
@@ -428,7 +428,11 @@ def _check_tool(self, tool):
428428

429429
def get_toolchain_tool(self, tool):
430430
if tool in self._supported_tools():
431-
return os.path.join(self.bootstrap_provider(), 'bin', self._tool_to_bin(tool))
431+
ret = os.path.join(self.bootstrap_provider(), 'bin', self._tool_to_bin(tool))
432+
if mx.is_windows() and ret.endswith('.exe') and not os.path.exists(ret):
433+
# this might be a bootstrap toolchain without native-image, so we have to replace .exe with .cmd
434+
ret = ret[:-4] + '.cmd'
435+
return ret
432436
elif tool in self.llvm_binutil_tools:
433437
return os.path.join(self.bootstrap_provider(), 'bin', _cmd_sub(tool.lower()))
434438
else:

sulong/mx.sulong/mx_sulong_suite_constituents.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,10 @@ def __init__(self, suite, name, deps, workingSets, theLicense, **kwArgs):
334334
def launchers(self):
335335
for tool in self.suite.toolchain._supported_tools():
336336
for exe in self.suite.toolchain._tool_to_aliases(tool):
337+
cmd = exe
337338
if mx.is_windows() and exe.endswith('.exe'):
338-
exe = exe[:-4] + ".cmd"
339-
result = os.path.join(self.get_output_root(), exe)
339+
cmd = exe[:-4] + ".cmd"
340+
result = os.path.join(self.get_output_root(), cmd)
340341
yield result, tool, exe
341342

342343
def ninja_toolchain_path(self):
@@ -346,7 +347,10 @@ def getArchivableResults(self, use_relpath=True, single=False):
346347
if single:
347348
raise ValueError("Cannot produce single result for BootstrapToolchainLauncherProject")
348349
for result, _, exe in self.launchers():
349-
yield result, os.path.join('bin', exe)
350+
cmd = exe
351+
if mx.is_windows() and exe.endswith('.exe'):
352+
cmd = exe[:-4] + ".cmd"
353+
yield result, os.path.join('bin', cmd)
350354
toolchain_path = self.ninja_toolchain_path()
351355
yield toolchain_path, os.path.basename(toolchain_path)
352356

vm/ce-release-artifacts.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
{
110110
"os": "windows",
111111
"arch": "amd64",
112-
"name_template": "{name}-{version}-macos-{arch}"
112+
"name_template": "{name}-{version}-{os}-{arch}"
113113
}
114114
]
115115
},
@@ -189,6 +189,10 @@
189189
{
190190
"os": "darwin",
191191
"arch": "aarch64"
192+
},
193+
{
194+
"os": "windows",
195+
"arch": "amd64"
192196
}
193197
]
194198
},
@@ -212,6 +216,10 @@
212216
{
213217
"os": "darwin",
214218
"arch": "aarch64"
219+
},
220+
{
221+
"os": "windows",
222+
"arch": "amd64"
215223
}
216224
]
217225
},
@@ -235,6 +243,10 @@
235243
{
236244
"os": "darwin",
237245
"arch": "aarch64"
246+
},
247+
{
248+
"os": "windows",
249+
"arch": "amd64"
238250
}
239251
]
240252
},
@@ -258,6 +270,10 @@
258270
{
259271
"os": "darwin",
260272
"arch": "aarch64"
273+
},
274+
{
275+
"os": "windows",
276+
"arch": "amd64"
261277
}
262278
]
263279
},
@@ -281,6 +297,10 @@
281297
{
282298
"os": "darwin",
283299
"arch": "aarch64"
300+
},
301+
{
302+
"os": "windows",
303+
"arch": "amd64"
284304
}
285305
]
286306
},
@@ -304,6 +324,10 @@
304324
{
305325
"os": "darwin",
306326
"arch": "aarch64"
327+
},
328+
{
329+
"os": "windows",
330+
"arch": "amd64"
307331
}
308332
]
309333
},

vm/ci_common/common.jsonnet

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ local devkits = common_json.devkits;
9595
sulong_linux: common_json.sulong.deps.common + common_json.sulong.deps.linux,
9696
sulong_darwin_amd64: common_json.sulong.deps.common + common_json.sulong.deps.darwin_amd64,
9797
sulong_darwin_aarch64: common_json.sulong.deps.common + common_json.sulong.deps.darwin_aarch64,
98+
sulong_windows: common_json.sulong.deps.common + common_json.sulong.deps.windows,
9899

99100
# TRUFFLERUBY, needs OpenSSL 1.0.2+, so OracleLinux 7+
100101
truffleruby_linux_amd64: self.sulong_linux + common_json.truffleruby.deps.common + common_json.truffleruby.deps.linux + graal_common.ol7,
@@ -665,11 +666,11 @@ local devkits = common_json.devkits;
665666

666667
# Windows/AMD64
667668
deploy_vm_base_java11_windows_amd64: vm.vm_java_11 + self.svm_common_windows_amd64("11") + self.js_windows_jdk11 + self.deploy_daily_vm_windows_jdk11 + self.deploy_graalvm_base_windows_amd64("java11") + {name: 'daily-deploy-vm-base-java11-windows-amd64'},
668-
deploy_vm_installable_java11_windows_amd64: vm.vm_java_11 + self.svm_common_windows_amd64("11") + self.js_windows_jdk11 + self.deploy_daily_vm_windows_jdk11 + self.deploy_graalvm_installables_windows_amd64("java11") + {name: 'daily-deploy-vm-installable-java11-windows-amd64', diskspace_required: "31GB"},
669+
deploy_vm_installable_java11_windows_amd64: vm.vm_java_11 + self.svm_common_windows_amd64("11") + self.js_windows_jdk11 + self.sulong_windows + self.deploy_daily_vm_windows_jdk11 + self.deploy_graalvm_installables_windows_amd64("java11") + {name: 'daily-deploy-vm-installable-java11-windows-amd64', diskspace_required: "31GB"},
669670
deploy_vm_base_java17_windows_amd64: vm.vm_java_17 + self.svm_common_windows_amd64("17") + self.js_windows_jdk17 + self.deploy_daily_vm_windows_jdk17 + self.deploy_graalvm_base_windows_amd64("java17") + {name: 'daily-deploy-vm-base-java17-windows-amd64'},
670-
deploy_vm_installable_java17_windows_amd64: vm.vm_java_17 + self.svm_common_windows_amd64("17") + self.js_windows_jdk17 + self.deploy_daily_vm_windows_jdk17 + self.deploy_graalvm_installables_windows_amd64("java17") + {name: 'daily-deploy-vm-installable-java17-windows-amd64', diskspace_required: "31GB"},
671+
deploy_vm_installable_java17_windows_amd64: vm.vm_java_17 + self.svm_common_windows_amd64("17") + self.js_windows_jdk17 + self.sulong_windows + self.deploy_daily_vm_windows_jdk17 + self.deploy_graalvm_installables_windows_amd64("java17") + {name: 'daily-deploy-vm-installable-java17-windows-amd64', diskspace_required: "31GB"},
671672
deploy_vm_base_java19_windows_amd64: vm.vm_java_19 + self.svm_common_windows_amd64("19") + self.js_windows_jdk19 + self.deploy_daily_vm_windows_jdk19 + self.deploy_graalvm_base_windows_amd64("java19") + {name: 'daily-deploy-vm-base-java19-windows-amd64'},
672-
deploy_vm_installable_java19_windows_amd64: vm.vm_java_19 + self.svm_common_windows_amd64("19") + self.js_windows_jdk19 + self.deploy_daily_vm_windows_jdk19 + self.deploy_graalvm_installables_windows_amd64("java19") + {name: 'daily-deploy-vm-installable-java19-windows-amd64', diskspace_required: "31GB"},
673+
deploy_vm_installable_java19_windows_amd64: vm.vm_java_19 + self.svm_common_windows_amd64("19") + self.js_windows_jdk19 + self.sulong_windows + self.deploy_daily_vm_windows_jdk19 + self.deploy_graalvm_installables_windows_amd64("java19") + {name: 'daily-deploy-vm-installable-java19-windows-amd64', diskspace_required: "31GB"},
673674

674675
#
675676
# Deploy the GraalVM Ruby image (GraalVM Base + ruby - js)

vm/mx.vm/ce-win-19-complete

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DYNAMIC_IMPORTS=/compiler,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/tools,/truffle,/wasm
2-
COMPONENTS=cmp,cov,dap,gu,gvm,gwa,icu4j,ins,insight,insightheap,js,lg,lsp,nfi-libffi,ni,nic,nil,njs,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm,vvm
3-
NATIVE_IMAGES=gu,lib:jsvm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image,wasm
1+
DYNAMIC_IMPORTS=/compiler,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,/wasm
2+
COMPONENTS=cmp,cov,dap,gu,gvm,gwa,icu4j,ins,insight,insightheap,js,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,nfi,ni,nic,nil,njs,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm,vvm
3+
NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,gu,lib:jsvm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lib:llvmvm,native-image,wasm
44
DISABLE_INSTALLABLES=False

vm/mx.vm/ce-win-complete

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DYNAMIC_IMPORTS=/compiler,/espresso,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/tools,/truffle,/wasm
2-
COMPONENTS=cmp,cov,dap,ejvm,gu,gvm,gwa,icu4j,ins,insight,insightheap,java,js,lg,lsp,nfi-libffi,ni,nic,nil,njs,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm,vvm
3-
NATIVE_IMAGES=gu,lib:jsvm,lib:javavm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,native-image,wasm
1+
DYNAMIC_IMPORTS=/compiler,/espresso,/graal-js,/graal-nodejs,/regex,/sdk,/substratevm,/sulong,/tools,/truffle,/wasm
2+
COMPONENTS=cmp,cov,dap,ejvm,gu,gvm,gwa,icu4j,ins,insight,insightheap,java,js,lg,llp,llrc,llrl,llrn,lsp,nfi-libffi,nfi,ni,nic,nil,njs,poly,polynative,pro,rgx,sdk,svm,svmnfi,svmsl,tfl,tflm,vvm
3+
NATIVE_IMAGES=graalvm-native-binutil,graalvm-native-clang,graalvm-native-clang-cl,graalvm-native-clang++,graalvm-native-ld,gu,lib:jsvm,lib:javavm,lib:graal-nodejs,lib:jvmcicompiler,lib:native-image-agent,lib:native-image-diagnostics-agent,lib:llvmvm,native-image,wasm
44
DISABLE_INSTALLABLES=False

vm/mx.vm/mx_vm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@
162162

163163
# pylint: disable=line-too-long
164164
ce_components = ['bpolyglot', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'icu4j', 'ins', 'insight', 'insightheap', 'lg', 'libpoly', 'lsp', 'nfi-libffi', 'nfi', 'poly', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'tfl', 'tflm']
165-
ce_win_19_complete_components = ['bnative-image-configure', 'bpolyglot', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'gwa', 'icu4j', 'ins', 'insight', 'insightheap', 'js', 'lg', 'libpoly', 'lsp', 'nfi-libffi', 'nfi', 'ni', 'nic', 'nil', 'njs', 'poly', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'svm', 'svmnfi', 'svmsl', 'tfl', 'tflm', 'vvm']
165+
ce_win_19_complete_components = ['bnative-image-configure', 'bpolyglot', 'cmp', 'cov', 'dap', 'gu', 'gvm', 'gwa', 'icu4j', 'ins', 'insight', 'insightheap', 'js', 'lg', 'libpoly', 'llp', 'llrc', 'llrl', 'llrn', 'lsp', 'nfi-libffi', 'nfi', 'ni', 'nic', 'nil', 'njs', 'poly', 'polynative', 'pro', 'rgx', 'sdk', 'spolyglot', 'svm', 'svmnfi', 'svmsl', 'tfl', 'tflm', 'vvm']
166166
ce_win_complete_components = ce_win_19_complete_components + ['ejvm', 'java']
167-
ce_aarch64_19_complete_components = ce_win_19_complete_components + ['llp', 'llrc', 'llrl', 'llrn', 'pyn', 'pynl', 'rby', 'rbyl', 'svml']
168-
ce_aarch64_complete_components = ce_win_complete_components + ['llp', 'llrc', 'llrl', 'llrn', 'pyn', 'pynl', 'rby', 'rbyl', 'svml']
167+
ce_aarch64_19_complete_components = ce_win_19_complete_components + ['pyn', 'pynl', 'rby', 'rbyl', 'svml']
168+
ce_aarch64_complete_components = ce_win_complete_components + ['pyn', 'pynl', 'rby', 'rbyl', 'svml']
169169
ce_19_complete_components = ce_aarch64_19_complete_components + ['R', 'bRMain']
170170
ce_complete_components = ce_aarch64_complete_components + ['ellvm', 'R', 'bRMain']
171171
ce_darwin_aarch64_complete_components = list(ce_aarch64_complete_components)

0 commit comments

Comments
 (0)