| 4 Jul 2025 |
| JacoMalan1 joined the room. | 13:48:28 |
| 5 Jul 2025 |
| PBlue3 joined the room. | 18:02:54 |
| kwiuu joined the room. | 20:42:27 |
| 6 Jul 2025 |
| JacoMalan1 changed their display name from jacom to JacoMalan1. | 12:16:13 |
| JacoMalan1 set a profile picture. | 12:58:03 |
Andrew | I want to build a Dioxus desktop app with webview from GNU/Linux to Windows. So far, this does build
# https://discourse.nixos.org/t/cross-compile-rust-for-windows/9582/10
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
nixpkgs,
rust-overlay,
...
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
crossSystem.config = "x86_64-w64-mingw32";
overlays = [(import rust-overlay)];
};
pkgsLocal = import nixpkgs {inherit system;};
rust-toolchain = pkgs.pkgsBuildHost.rust-bin.stable.latest.default.override {
extensions = ["rust-src" "rust-analyzer" "clippy"];
targets = ["x86_64-pc-windows-gnu"];
};
# rustBuildInputs =
# [
# # pkgs.pthreads
# pkgs.openssl
# pkgs.libiconv
# pkgs.pkg-config
# ]
# ++ lib.optionals pkgs.stdenv.isLinux [
# pkgs.glib
# pkgs.gtk3
# pkgs.libsoup_3
# pkgs.webkitgtk_4_1
# pkgs.xdotool
# ]
# ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
# IOKit
# Carbon
# WebKit
# Security
# Cocoa
# ]);
in
with pkgs; {
devShells.${system}.default = mkShell {
buildInputs = [
pkgs.openssl
pkgs.libiconv
# pkgs.windows.mingw_w64_pthreads
];
nativeBuildInputs = [
rust-toolchain
pkgsLocal.wine64
];
};
};
}
with dx bundle --platform windows --target x86_64-pc-windows-gnu --package-types msi, though bundle isn't being created. But I get an error that the webview 2 loader dll is not found, just like https://stackoverflow.com/questions/74217709/unable-to-load-dll-webview2loader-dll-the-specified-module-could-not-be-found, which links to https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution?tabs=dotnetcsharp.
Does nixpkgs not have the WebView2 runtime-related stuff or do I have to install the runtime on the target OS in order to run my app?
| 15:15:58 |
K900 | You definitely need it on the target | 15:16:24 |
K900 | And we definitely don't have it in nixpkgs | 15:16:29 |
K900 | As it's not redistributable | 15:16:35 |
Andrew | Is there any chance this can be included in the binary somehow? | 15:17:01 |
Marie | Isn't webview2 part of windows? | 15:17:14 |
K900 | No, it's a Microsoft proprietary library | 15:17:16 |
K900 | Only on 11 | 15:17:25 |
K900 | It is optional on 10 and N/A on older versions | 15:17:36 |
K900 | And they are running Wine which most definitely isn't helping | 15:17:47 |
Andrew | Oh, so on that it should just work, if no other dependencies are missing? | 15:17:53 |
K900 | Possibly | 15:18:00 |
Andrew | That's interesting. | 15:18:09 |
K900 | Oh actually no it won't because you're building for MinGW | 15:18:12 |
K900 | So presumably you'll run into Exciting ABI Fuckery | 15:18:18 |
Andrew | OK, is there a better way? | 15:18:36 |
K900 | Build on native Windows | 15:18:43 |
Andrew | Are you saying Nix can't save me? | 15:18:57 |
K900 | We don't really have good Windows support in nixpkgs | 15:18:59 |
K900 | I am saying that nixpkgs, in its current state, can't save you | 15:19:09 |
Andrew | So you're telling there is a chance... | 15:19:22 |
K900 | Maybe if someone puts in a good half a year of work and gets us a working MSVC toolchain | 15:19:24 |
K900 | But you'd need to find someone with nixpkgs AND Windows expertise | 15:19:42 |
K900 | And such people are extremely rare | 15:19:49 |
K900 | If they even exist | 15:19:52 |