Fix the Windows 32-bit and macOS release builds

On 32-bit Windows SetWindowLongPtrW is SetWindowLongW, which takes and
returns i32, so the window-procedure hook didn't compile for i686.
The macOS app bundle now signs the bundled solidcraft-cli before the
bundle itself; codesign refuses a bundle with an unsigned helper.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-15 20:34:03 +00:00
1 parent 843c548589
commit 94e76cd97e
2 files changed
+8 -4

No files matched your search

+5 -3
View File
@@ -48,11 +48,13 @@ pub fn install(window: &impl HasWindowHandle) -> bool {
// SAFETY: `hwnd` is the live window eframe just created on this thread; `frame_proc` has the
// WNDPROC signature and stays valid for the life of the process. SetWindowLongPtrW returns
// the previous procedure, which `frame_proc` calls for every other message.
let previous = unsafe { SetWindowLongPtrW(hwnd, GWLP_WNDPROC, frame_proc as *const () as isize) };
let previous = unsafe { SetWindowLongPtrW(hwnd, GWLP_WNDPROC, frame_proc as *const () as isize as _) };
// `as _`: on 32-bit Windows SetWindowLongPtrW is SetWindowLongW, which takes and
// returns i32.
if previous == 0 {
return false;
}
PREVIOUS.store(previous, Ordering::SeqCst);
PREVIOUS.store(previous as _, Ordering::SeqCst);
true
}
@@ -97,7 +99,7 @@ unsafe extern "system" fn frame_proc(hwnd: HWND, msg: u32, wparam: WPARAM, lpara
// Hand the window back to winit's procedure for its last message.
if prev.is_some() {
// SAFETY: restores the procedure this window had before `install`.
unsafe { SetWindowLongPtrW(hwnd, GWLP_WNDPROC, PREVIOUS.load(Ordering::SeqCst)) };
unsafe { SetWindowLongPtrW(hwnd, GWLP_WNDPROC, PREVIOUS.load(Ordering::SeqCst) as _) };
}
call_previous()
}
+3 -1
View File
@@ -73,7 +73,9 @@ copy_docs "$APP/Contents/Resources/Licenses"
sed -e "s/@VERSION@/$VERSION/g" -e "s/@SHORT_VERSION@/$SHORT_VERSION/g" "$ROOT/assets/platforms/macos/Info.plist.in" >"$APP/Contents/Info.plist"
plutil -lint "$APP/Contents/Info.plist"
printf 'APPL????' >"$APP/Contents/PkgInfo"
# Ad-hoc signature over the whole bundle (Apple silicon refuses unsigned code).
# Ad-hoc signature over the whole bundle (Apple silicon refuses unsigned code). Nested code is
# signed first: the bundle signature refuses an unsigned helper in Contents/MacOS.
codesign --force --sign - --timestamp=none --identifier "$MACOS_BUNDLE_ID-cli" "$APP/Contents/MacOS/solidcraft-cli"
codesign --force --sign - --timestamp=none "$APP"
codesign --verify --strict --deep --verbose=2 "$APP"
test -x "$APP/Contents/MacOS/solidcraft-cli" || { echo "solidcraft-cli is missing from $APP" >&2; exit 1; }