mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-20 01:12:09 +00:00
* feat: native Windows ARM64 build support Builds on the merged DEPS_ARCH=arm64 plumbing (#13424) by adding the dependency and source fixes needed for a green native ARM64 build on the windows-11-arm runner. Validated end-to-end on Snapdragon X Elite hardware (via a downstream fork using the same fixes); see OrcaSlicer/OrcaSlicer#8271 for the full writeup. Dependencies: - OpenEXR 2.5.5: ImfSimd.h hard-codes IMF_HAVE_SSE2 for any MSVC, pulling in <emmintrin.h> (x86-only) -> C1189. Patch the header to require an x86 target and force SSE cache vars off on ARM64. - Boost.Context: use the winfib implementation on ARM64 (Windows Fiber API) to avoid the armasm64 / CMake ASM_ARMASM linker-module bug, while keeping the Boost::context target Boost.Asio needs. - OpenCV: disable WITH_IPP on ARM64 (Intel IPP/IPP-ICV is x86/x64 only; otherwise ~200 unresolved ippicv* externals at link). - OpenSSL: use VC-WIN64-ARM on ARM64. - FindGLEW: add an ARM64 arch branch. Sources: - clipper Int128.hpp: _mul128 is an x64-only intrinsic guarded by _WIN64 (true on ARM64); guard on _M_X64 and use the portable path. - imgui imgui_widgets.cpp: fix va_start(vaList, &text) -> va_start(vaList, text) (the &-form compiled on x64 but is invalid on ARM64). - crash reporter: StackWalker.cpp gains an _M_ARM64 branch; BaseException.cpp uses Cpsr instead of the x86-only EFlags on ARM64. CI: - New build_windows_arm64.yml on windows-11-arm: pins CMake 3.31.x, stages ARM64 GMP/MPFR from MSYS2 clangarm64 (with llvm-dlltool import libs), caches deps with a fixed-depth hashFiles key, builds and uploads the binary. OCCT/STEP, SVG-to-3D and text emboss all build and work on ARM64 (no stubs needed). Full feature parity with x64. * fix(ci): use forward-slash DESTDIR to avoid CMake '\a' escape error deps configure failed at GMP/GMP.cmake: "Invalid character escape '\a'" because DESTDIR carried Windows backslashes (C:\a\...) and is re-parsed when re-set with the /usr/local suffix. Pass DESTDIR (and the slicer's DEPS prefix) with forward slashes via %CD:\=/%. * fix(ci): don't export DESTDIR env var (CMake staged-install doubles paths) Setting a DESTDIR *environment* variable made CMake treat it as the staged install prefix and prepend it to every dependency's install path, so e.g. FreeType installed to <DESTDIR>/a/.../OrcaSlicer_dep/usr/local and OCCT then couldn't find its headers. Compute the forward-slash path into a differently-named var (ORCA_DESTDIR) and pass it only via -DDESTDIR. * ci(windows-arm64): fold ARM64 build into the standard Windows matrix Replace the standalone build_windows_arm64.yml with a matrix entry on the existing build_windows job, so x64 and ARM64 share one reusable workflow chain (build_all -> build_check_cache -> build_deps -> build_orca), per review feedback on #14059. - build_all.yml: build_windows now matrices over {x64: windows-latest, arm64: windows-11-arm} and threads `arch` through. Self-hosted runner stays x64-only. - build_check_cache.yml: cache key and dep-prefix path are now architecture-specific on Windows (deps/build-arm64/OrcaSlicer_dep). - build_release_vs.bat: accept an `arm64` argument (mirrors build_release_vs2022.bat) -> uses `-A ARM64` and the build-arm64 tree. The top-level CMake auto-derives CMAKE_PREFIX_PATH from the build dir, so no explicit prefix is needed. - build_deps.yml / build_orca.yml: gate the ARM64-only prep behind `inputs.arch == 'arm64'` -- pin CMake 3.31.x, and stage MSYS2 clangarm64 GMP/MPFR import libs. NSIS installer/PDB/profile_validator remain x64-only; ARM64 ships the portable zip. Artifact names get an arch suffix to avoid collisions between the two Windows jobs. https://claude.ai/code/session_0164c7ZhCLsYBmCiVN9pWDjK * ci(temp): generate GMP/MPFR win-arm64 blobs to commit to repo * feat(deps): add prebuilt GMP/MPFR win-arm64 blobs The repo ships prebuilt GMP/MPFR import libs + DLLs for win-x64 and win-x86; the Windows ARM64 build path copies from win-${DEPS_ARCH} (CMakeLists.txt) but the win-arm64 blobs were missing, so the slicer configure failed at "file COPY cannot find .../win-arm64/libgmp-10.dll". Add win-arm64 libgmp-10.{dll,lib} and libmpfr-4.{dll,lib}, generated from the MSYS2 clangarm64 gmp/mpfr packages with MSVC-compatible import libs via llvm-dlltool. Headers are shared across arches and unchanged. * simplify OpenEXR.cmake * set default arch * support msix * ship installer * try to fix webview2runtime issue --------- Co-authored-by: Adam Behrman <adam.behrman@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Adam Behrman <abehrman@users.noreply.github.com>
This commit is contained in:
@@ -357,6 +357,12 @@ void CBaseException::ShowRegistorInformation(PCONTEXT pCtx)
|
||||
OutputString(_T("SS:RSP:%04X:%016llX RBP:%016llX\r\n"), pCtx->SegSs, pCtx->Rsp, pCtx->Rbp);
|
||||
OutputString(_T("DS:%04X ES:%04X FS:%04X GS:%04X\r\n"), pCtx->SegDs, pCtx->SegEs, pCtx->SegFs, pCtx->SegGs);
|
||||
OutputString(_T("Flags:%08X\r\n"), pCtx->EFlags);
|
||||
#elif defined(_M_ARM64)
|
||||
OutputString(_T("\nRegisters:\r\n"));
|
||||
OutputString(_T("PC:%016llX SP:%016llX FP:%016llX LR:%016llX\r\n"),
|
||||
(unsigned long long)pCtx->Pc, (unsigned long long)pCtx->Sp,
|
||||
(unsigned long long)pCtx->Fp, (unsigned long long)pCtx->Lr);
|
||||
OutputString(_T("Cpsr:%08X\r\n"), pCtx->Cpsr);
|
||||
#endif
|
||||
|
||||
OutputString( _T("\r\n") );
|
||||
@@ -380,7 +386,11 @@ void CBaseException::ShowExceptionInformation()
|
||||
OutputString(_T("Param %d :0x%x \n"), i, m_pEp->ExceptionRecord->ExceptionInformation[i]);
|
||||
}
|
||||
OutputString(_T("Context :%p \n"), m_pEp->ContextRecord);
|
||||
#if defined(_M_ARM64)
|
||||
OutputString(_T("ContextFlag : 0x%x, Cpsr: 0x%x \n"), m_pEp->ContextRecord->ContextFlags, m_pEp->ContextRecord->Cpsr);
|
||||
#else
|
||||
OutputString(_T("ContextFlag : 0x%x, EFlags: 0x%x \n"), m_pEp->ContextRecord->ContextFlags, m_pEp->ContextRecord->EFlags);
|
||||
#endif
|
||||
|
||||
TCHAR szFaultingModule[MAX_PATH];
|
||||
DWORD section, offset;
|
||||
|
||||
@@ -457,6 +457,15 @@ LPSTACKINFO CStackWalker::StackWalker(HANDLE hThread, const CONTEXT* context)
|
||||
sf.AddrBStore.Mode = AddrModeFlat;
|
||||
sf.AddrStack.Offset = c.IntSp;
|
||||
sf.AddrStack.Mode = AddrModeFlat;
|
||||
// ARM64
|
||||
#elif defined(_M_ARM64)
|
||||
imageType = IMAGE_FILE_MACHINE_ARM64;
|
||||
sf.AddrPC.Offset = c.Pc;
|
||||
sf.AddrPC.Mode = AddrModeFlat;
|
||||
sf.AddrFrame.Offset = c.Fp;
|
||||
sf.AddrFrame.Mode = AddrModeFlat;
|
||||
sf.AddrStack.Offset = c.Sp;
|
||||
sf.AddrStack.Mode = AddrModeFlat;
|
||||
#else
|
||||
#error "Platform not supported!"
|
||||
#endif
|
||||
|
||||
@@ -188,8 +188,9 @@ public:
|
||||
|
||||
static inline Int128 multiply(int64_t lhs, int64_t rhs)
|
||||
{
|
||||
#if defined(_MSC_VER) && defined(_WIN64)
|
||||
// On Visual Studio 64bit, use the _mul128() intrinsic function.
|
||||
#if defined(_MSC_VER) && defined(_M_X64)
|
||||
// On Visual Studio x64, use the _mul128() intrinsic function.
|
||||
// (ARM64 MSVC has no _mul128; it falls through to the portable path.)
|
||||
Int128 result;
|
||||
result.m_lo = (uint64_t)_mul128(lhs, rhs, &result.m_hi);
|
||||
return result;
|
||||
|
||||
@@ -743,6 +743,15 @@ void GUI_App::post_init()
|
||||
if (! this->initialized())
|
||||
throw Slic3r::RuntimeError("Calling post_init() while not yet initialized");
|
||||
|
||||
#if wxUSE_WEBVIEW_EDGE
|
||||
// Ensure the Microsoft WebView2 runtime is installed before any WebView is
|
||||
// created. The setup wizard and several dialogs render entirely through
|
||||
// WebView2; without the runtime they come up blank. This runs here (not in the
|
||||
// constructor) so that wxWidgets is fully initialized and the event loop is
|
||||
// running, and so it precedes the first WebView creation (the setup wizard).
|
||||
init_webview_runtime();
|
||||
#endif
|
||||
|
||||
m_open_method = "double_click";
|
||||
bool switch_to_3d = false;
|
||||
|
||||
@@ -1057,9 +1066,10 @@ GUI_App::GUI_App()
|
||||
//app config initializes early becasuse it is used in instance checking in OrcaSlicer.cpp
|
||||
this->init_app_config();
|
||||
this->init_download_path();
|
||||
#if wxUSE_WEBVIEW_EDGE
|
||||
this->init_webview_runtime();
|
||||
#endif
|
||||
// Note: the WebView2 runtime check (init_webview_runtime) used to run here, but
|
||||
// the constructor executes before wxWidgets is fully initialized and before the
|
||||
// event loop starts, so its modal prompt/installer could silently fail to appear.
|
||||
// It now runs in post_init(), before the first WebView (the setup wizard) is created.
|
||||
|
||||
reset_to_active();
|
||||
}
|
||||
@@ -2301,13 +2311,37 @@ void GUI_App::init_download_path()
|
||||
#if wxUSE_WEBVIEW_EDGE
|
||||
void GUI_App::init_webview_runtime()
|
||||
{
|
||||
// Check WebView Runtime
|
||||
if (!WebView::CheckWebViewRuntime()) {
|
||||
int nRet = wxMessageBox(_L("Orca Slicer requires the Microsoft WebView2 Runtime to operate certain features.\nClick Yes to install it now."),
|
||||
_L("WebView2 Runtime"), wxYES_NO);
|
||||
if (nRet == wxYES) {
|
||||
WebView::DownloadAndInstallWebViewRuntime();
|
||||
}
|
||||
// Check whether the Microsoft WebView2 runtime is already present.
|
||||
if (WebView::CheckWebViewRuntime()) {
|
||||
BOOST_LOG_TRIVIAL(info) << "WebView2 runtime detected.";
|
||||
return;
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(warning) << "WebView2 runtime not found; prompting user to install.";
|
||||
int nRet = wxMessageBox(_L("Orca Slicer requires the Microsoft WebView2 Runtime to operate certain features.\nClick Yes to install it now."),
|
||||
_L("WebView2 Runtime"), wxYES_NO);
|
||||
if (nRet != wxYES) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "User declined WebView2 runtime installation.";
|
||||
return;
|
||||
}
|
||||
|
||||
// The bootstrapper auto-detects the device architecture (x64/x86/ARM64) and
|
||||
// installs the matching runtime. The install is synchronous, and because this
|
||||
// runs before the first WebView is created, a successful install takes effect
|
||||
// in this same process without a restart.
|
||||
bool installed = WebView::DownloadAndInstallWebViewRuntime();
|
||||
|
||||
// Re-check: the install can still fail (declined UAC elevation, no network,
|
||||
// etc.). Without the runtime the setup wizard and other WebView dialogs render
|
||||
// blank, so surface an explicit message rather than failing silently.
|
||||
if (installed && WebView::CheckWebViewRuntime()) {
|
||||
BOOST_LOG_TRIVIAL(info) << "WebView2 runtime installed successfully.";
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(error) << "WebView2 runtime installation failed or still not detected.";
|
||||
wxMessageBox(_L("The Microsoft WebView2 Runtime could not be installed.\n"
|
||||
"Some features, including the setup wizard, may appear blank until it is installed.\n"
|
||||
"Please install it manually from https://developer.microsoft.com/microsoft-edge/webview2/ and restart Orca Slicer."),
|
||||
_L("WebView2 Runtime"), wxOK | wxICON_WARNING);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -77,13 +77,16 @@ DWORD DownloadAndInstallWV2RT() {
|
||||
if (downloaded) {
|
||||
// Either Package the WebView2 Bootstrapper with your app or download it using fwlink
|
||||
// Then invoke install at Runtime.
|
||||
// Keep the path string alive for the duration of the ShellExecuteExW call;
|
||||
// assigning .c_str() of a temporary directly would leave lpFile dangling.
|
||||
const std::wstring installer_path = target_file_path.generic_wstring();
|
||||
SHELLEXECUTEINFOW shExInfo = {0};
|
||||
shExInfo.cbSize = sizeof(shExInfo);
|
||||
shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
|
||||
shExInfo.hwnd = 0;
|
||||
shExInfo.lpVerb = L"runas";
|
||||
shExInfo.lpFile = target_file_path.generic_wstring().c_str();
|
||||
shExInfo.lpParameters = L" /install";
|
||||
shExInfo.lpFile = installer_path.c_str();
|
||||
shExInfo.lpParameters = L" /silent /install";
|
||||
shExInfo.lpDirectory = 0;
|
||||
shExInfo.nShow = 0;
|
||||
shExInfo.hInstApp = 0;
|
||||
@@ -338,7 +341,11 @@ bool WebView::CheckWebViewRuntime()
|
||||
{
|
||||
wxWebViewFactoryEdge factory;
|
||||
auto wxVersion = factory.GetVersionInfo(wxVersionContext::RunTime);
|
||||
return wxVersion.GetMajor() != 0;
|
||||
bool present = wxVersion.GetMajor() != 0;
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": WebView2 runtime "
|
||||
<< (present ? "found, version " : "not found (")
|
||||
<< wxVersion.ToString().ToUTF8().data() << (present ? "" : ")");
|
||||
return present;
|
||||
}
|
||||
|
||||
bool WebView::DownloadAndInstallWebViewRuntime()
|
||||
|
||||
Reference in New Issue
Block a user