Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32-bit windows support? #3067

Closed
liudonghua123 opened this issue Dec 14, 2021 · 13 comments
Closed

32-bit windows support? #3067

liudonghua123 opened this issue Dec 14, 2021 · 13 comments
Labels
platform: Windows scope: bundler The bundler used in our cli to make installers type: bug

Comments

@liudonghua123
Copy link

I want to build a 32-bit tauri app, but it failed with the following errors.

error[E0308]: mismatched types
    --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\tao-0.5.2\src\platform_impl\windows\window.rs:1051:20
     |
1051 |         userdata = createstruct.lpCreateParams as LONG_PTR;
     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `isize`

For more information about this error, try `rustc --explain E0308`.
error: could not compile `tao` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: failed to build app

Caused by:
    Result of `cargo build` operation was unsuccessful: exit code: 101

 app:spawn Command "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe" failed with exit code: 1 +0mserror Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

also tauri-apps/tao#203.

@amrbashir
Copy link
Member

can you try our next branch, I believe we fixed it already.

tao = { git = "https://github.com/tauri-apps/tao", branch = "next" }

@liudonghua123
Copy link
Author

can you try our next branch, I believe we fixed it already.

tao = { git = "https://github.com/tauri-apps/tao", branch = "next" }

Thanks, I will try this solution.

@liudonghua123
Copy link
Author

@amrbashir Hi, I tried to add tao = { git = "https://github.com/tauri-apps/tao", branch = "next" } in dependencies section of src-tauri/Cargo.toml. However when I run yarn tauri build, the same errors appeared.

src-tauri/Cargo.toml:

[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2018"
build = "src/build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.0.0-beta.4" }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-beta.8", features = ["api-all"] }
tao = { git = "https://github.com/tauri-apps/tao", branch = "next" }

[features]
default = [ "custom-protocol" ]
custom-protocol = [ "tauri/custom-protocol" ]

package.json:

{
  "name": "tauri-app",
  "scripts": {
    "tauri": "tauri"
  },
  "devDependencies": {
    "@tauri-apps/cli": "^1.0.0-beta.10"
  },
  "dependencies": {
    "@tauri-apps/api": "^1.0.0-beta.8"
  }
}

I am new to rust, how can I overwrite the tao dependence?

@liudonghua123
Copy link
Author

I tried to update src-tauri/Cargo.toml according to the docs on https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html.

[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
default-run = "app"
edition = "2018"
build = "src/build.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[build-dependencies]
tauri-build = { version = "1.0.0-beta.4" }

[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.0-beta.8", features = ["api-all"] }

[patch.crates-io]
tao = { git = "https://github.com/tauri-apps/tao", branch = "next" }

[features]
default = [ "custom-protocol" ]
custom-protocol = [ "tauri/custom-protocol" ]

Now I got some other errors.

`yarn tauri build`
D:\code\rust\tauri-app>yarn tauri build
yarn run v1.22.17
warning package.json: No license field
$ tauri build
 app:spawn Running "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe tauri build" +0ms

   Compiling winapi v0.3.9
   Compiling tao v0.5.2 (https://github.com/tauri-apps/tao?branch=next#dce2d529)
   Compiling windows v0.25.0
   Compiling app v0.1.0 (D:\code\rust\tauri-app\src-tauri)
   Compiling parking_lot_core v0.8.5
   Compiling webview2-sys v0.1.1
   Compiling winapi-util v0.1.5
   Compiling schannel v0.1.19
   Compiling dirs-sys-next v0.1.2
   Compiling remove_dir_all v0.5.3
   Compiling time v0.1.43
   Compiling filetime v0.2.15
   Compiling rfd v0.4.4
   Compiling shared_child v0.3.5
   Compiling os_info v3.0.8
   Compiling os_pipe v0.9.2
   Compiling open v2.0.2
   Compiling dirs-next v2.0.0
   Compiling tempfile v3.2.0
   Compiling same-file v1.0.6
   Compiling parking_lot v0.11.2
   Compiling tar v0.4.37
   Compiling native-tls v0.2.8
   Compiling zip v0.5.13
   Compiling webview2 v0.1.4
   Compiling walkdir v2.3.2
   Compiling string_cache v0.8.2
   Compiling attohttpc v0.17.0
   Compiling ignore v0.4.18
   Compiling markup5ever v0.10.1
   Compiling html5ever v0.25.1
   Compiling kuchiki v0.8.1
   Compiling tauri-utils v1.0.0-beta.3
   Compiling tauri-runtime v0.2.1
   Compiling wry v0.12.2
error[E0433]: failed to resolve: could not find `ole2` in `um`
  --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\file_drop.rs:72:22
   |
72 |       if winapi::um::ole2::RevokeDragDrop(hwnd) != winapi::shared::winerror::DRAGDROP_E_INVALIDHWND
   |                      ^^^^ could not find `ole2` in `um`

error[E0433]: failed to resolve: could not find `ole2` in `um`
  --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\file_drop.rs:73:24
   |
73 |         && winapi::um::ole2::RegisterDragDrop(hwnd, handler_interface_ptr) == S_OK
   |                        ^^^^ could not find `ole2` in `um`

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:146:21
    |
145 |               let cursor = match result {
    |                                  ------ this expression has type `windows::Windows::Win32::Foundation::LRESULT`
146 |                     HTLEFT => CursorIcon::WResize,
    |                     ^^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`
    |
help: you might have meant to use field `0` whose type is `isize`
    |
145 |               let cursor = match result.0 {
    |                                  ~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:147:21
    |
145 |               let cursor = match result {
    |                                  ------ this expression has type `windows::Windows::Win32::Foundation::LRESULT`
146 |                     HTLEFT => CursorIcon::WResize,
147 |                     HTTOP => CursorIcon::NResize,
    |                     ^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`
    |
help: you might have meant to use field `0` whose type is `isize`
    |
145 |               let cursor = match result.0 {
    |                                  ~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:148:21
    |
145 |               let cursor = match result {
    |                                  ------ this expression has type `windows::Windows::Win32::Foundation::LRESULT`
...
148 |                     HTRIGHT => CursorIcon::EResize,
    |                     ^^^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`
    |
help: you might have meant to use field `0` whose type is `isize`
    |
145 |               let cursor = match result.0 {
    |                                  ~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:149:21
    |
145 |               let cursor = match result {
    |                                  ------ this expression has type `windows::Windows::Win32::Foundation::LRESULT`
...
149 |                     HTBOTTOM => CursorIcon::SResize,
    |                     ^^^^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`
    |
help: you might have meant to use field `0` whose type is `isize`
    |
145 |               let cursor = match result.0 {
    |                                  ~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:150:21
    |
145 |               let cursor = match result {
    |                                  ------ this expression has type `windows::Windows::Win32::Foundation::LRESULT`
...
150 |                     HTTOPLEFT => CursorIcon::NwResize,
    |                     ^^^^^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`
    |
help: you might have meant to use field `0` whose type is `isize`
    |
145 |               let cursor = match result.0 {
    |                                  ~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:151:21
    |
145 |               let cursor = match result {
    |                                  ------ this expression has type `windows::Windows::Win32::Foundation::LRESULT`
...
151 |                     HTTOPRIGHT => CursorIcon::NeResize,
    |                     ^^^^^^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`
    |
help: you might have meant to use field `0` whose type is `isize`
    |
145 |               let cursor = match result.0 {
    |                                  ~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:152:21
    |
145 |               let cursor = match result {
    |                                  ------ this expression has type `windows::Windows::Win32::Foundation::LRESULT`
...
152 |                     HTBOTTOMLEFT => CursorIcon::SwResize,
    |                     ^^^^^^^^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`
    |
help: you might have meant to use field `0` whose type is `isize`
    |
145 |               let cursor = match result.0 {
    |                                  ~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:153:21
    |
145 |               let cursor = match result {
    |                                  ------ this expression has type `windows::Windows::Win32::Foundation::LRESULT`
...
153 |                     HTBOTTOMRIGHT => CursorIcon::SeResize,
    |                     ^^^^^^^^^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`
    |
help: you might have meant to use field `0` whose type is `isize`
    |
145 |               let cursor = match result.0 {
    |                                  ~~~~~~~~

error[E0308]: mismatched types
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:164:30
    |
164 |                 if result != HTCLIENT {
    |                              ^^^^^^^^ expected struct `windows::Windows::Win32::Foundation::LRESULT`, found `isize`

error[E0061]: this function takes 4 arguments but 1 argument was supplied
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:165:27
    |
165 |                   window_.begin_resize_drag(result);
    |                           ^^^^^^^^^^^^^^^^^ ------ supplied 1 argument
    |                           |
    |                           expected 4 arguments
    |
note: associated function defined here
   --> C:\Users\Liu.D.H\.cargo\git\checkouts\tao-b2c91e21b396bd53\dce2d52\src\platform\windows.rs:114:6
    |
114 |   fn begin_resize_drag(&self, edge: isize, button: u32, x: i32, y: i32);
    |      ^^^^^^^^^^^^^^^^^

error[E0605]: non-primitive cast: `*mut c_void` as `windows::Windows::Win32::Foundation::HWND`
   --> C:\Users\Liu.D.H\.cargo\registry\src\github.com-1285ae84e5963aae\wry-0.12.2\src\webview\webview2\mod.rs:144:37
    |
144 |               let result = hit_test(window_.hwnd() as _, cx, cy);
    |                                     ^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object

Some errors have detailed explanations: E0061, E0308, E0433, E0605.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `wry` due to 13 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
Error: failed to build app

Caused by:
    Result of `cargo build` operation was unsuccessful: exit code: 101

 app:spawn Command "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe" failed with exit code: 1 +0ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

D:\code\rust\tauri-app>

@amrbashir
Copy link
Member

@liudonghua123 didn't know you're using Tauri and not tao directly.

Remove the tao patch and try changing tauri under dependencies to

tauri = { git = "https://github.com/tauri-apps/tauri", branch = "next" }

and tauri-build under build-dependencies

tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "next" }

and don't remove the features from both and keep them as is.

@liudonghua123
Copy link
Author

@liudonghua123 didn't know you're using Tauri and not tao directly.

Remove the tao patch and try changing tauri under dependencies to

tauri = { git = "https://github.com/tauri-apps/tauri", branch = "next" }

and tauri-build under build-dependencies

tauri-build = { git = "https://github.com/tauri-apps/tauri", branch = "next" }

and don't remove the features from both and keep them as is.

Thanks for the guidance. Now I can compile 32-bit windows executable, but it failed to create msi bundle.

logs
D:\code\rust\tauri-app>yarn tauri build
yarn run v1.22.17
warning package.json: No license field
$ tauri build
 app:spawn Running "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe tauri build" +0ms

    Updating git repository `https://github.com/tauri-apps/tauri`
    Updating crates.io index
    Updating git repository `https://github.com/tauri-apps/wry`
    Updating git repository `https://github.com/tauri-apps/tao`
  Downloaded attohttpc v0.18.0
  Downloaded minisign-verify v0.2.0
  Downloaded serde_urlencoded v0.7.0
  Downloaded os_pipe v1.0.0
  Downloaded shared_child v1.0.0
  Downloaded wildmatch v2.1.0
  Downloaded webview2-com v0.7.0
  Downloaded webview2-com-macros v0.4.0
  Downloaded windows-sys v0.28.0
  Downloaded windows_i686_msvc v0.28.0
  Downloaded rfd v0.6.1
  Downloaded webview2-com-sys v0.7.0
  Downloaded windows v0.28.0
  Downloaded 13 crates (18.5 MB) in 12.90s (largest was `windows` at 12.1 MB)
   Compiling winapi v0.3.9
   Compiling windows_i686_msvc v0.28.0
   Compiling wry v0.12.2 (https://github.com/tauri-apps/wry?rev=11557f15cf759fcf3008598b684c009f03a8c645#11557f15)
   Compiling rfd v0.6.1
   Compiling wildmatch v2.1.0
   Compiling minisign-verify v0.2.0
   Compiling windows_i686_msvc v0.25.0
   Compiling tauri v1.0.0-beta.8 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling webview2-com-macros v0.4.0
   Compiling windows-sys v0.28.0
   Compiling windows v0.25.0
   Compiling serde_urlencoded v0.7.0
   Compiling windows v0.28.0
   Compiling parking_lot_core v0.8.5
   Compiling winapi-util v0.1.5
   Compiling schannel v0.1.19
   Compiling filetime v0.2.15
   Compiling remove_dir_all v0.5.3
   Compiling time v0.1.43
   Compiling dirs-sys-next v0.1.2
   Compiling os_pipe v1.0.0
   Compiling os_info v3.0.8
   Compiling shared_child v1.0.0
   Compiling open v2.0.2
   Compiling same-file v1.0.6
   Compiling tempfile v3.2.0
   Compiling tar v0.4.37
   Compiling parking_lot v0.11.2
   Compiling native-tls v0.2.8
   Compiling dirs-next v2.0.0
   Compiling zip v0.5.13
   Compiling walkdir v2.3.2
   Compiling attohttpc v0.18.0
   Compiling string_cache v0.8.2
   Compiling ignore v0.4.18
   Compiling markup5ever v0.10.1
   Compiling html5ever v0.25.1
   Compiling kuchiki v0.8.1
   Compiling tauri-utils v1.0.0-beta.3 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling tauri-build v1.0.0-beta.4 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling tauri-codegen v1.0.0-beta.4 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling app v0.1.0 (D:\code\rust\tauri-app\src-tauri)
   Compiling tauri-macros v1.0.0-beta.5 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling tao v0.5.2 (https://github.com/tauri-apps/tao?branch=next#dce2d529)
   Compiling webview2-com-sys v0.7.0
   Compiling webview2-com v0.7.0
   Compiling tauri-runtime v0.2.1 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling tauri-runtime-wry v0.2.1 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
    Finished release [optimized] target(s) in 5m 17s
info: Target: x86
info: Wix settings not found. Using `en-US` as language.
info: running candle for "main.wxs"
info: running candle.exe
info: running light to produce D:\code\rust\tauri-app\src-tauri\target\release\bundle/msi/tauri-app_0.1.0_x86.msi
Error: failed to bundle project

Caused by:
    Shell Scripting Error:`error running light.exe, try running with --verbose to see command output`

 app:spawn Command "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe" failed with exit code: 1 +1ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

D:\code\rust\tauri-app>yarn tauri build --verbose
yarn run v1.22.17
warning package.json: No license field
$ tauri build --verbose
 app:spawn Running "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe tauri build --verbose" +0ms

   Compiling app v0.1.0 (D:\code\rust\tauri-app\src-tauri)
    Finished release [optimized] target(s) in 38.42s
info: Target: x86
info: Wix settings not found. Using `en-US` as language.
info: running candle for "main.wxs"
info: running candle.exe
Windows Installer XML Toolset Compiler version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

main.wxs
info: running light to produce D:\code\rust\tauri-app\src-tauri\target\release\bundle/msi/tauri-app_0.1.0_x86.msi
Windows Installer XML Toolset Linker version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

D:\code\rust\tauri-app\src-tauri\target\release\wix\x86\main.wxs(113) : error LGHT0345 : 'D:\code\rust\tauri-app\src-tauri\target\release\Microsoft_VC142_CRT_x64.msm' is a 64-bit merge module but the product consuming it is 32-bit. 32-bit products can consume only 32-bit merge modules.
Error: failed to bundle project

Caused by:
    Shell Scripting Error:`error running light.exe`

 app:spawn Command "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe" failed with exit code: 1 +0ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

D:\code\rust\tauri-app>

@amrbashir
Copy link
Member

I will transfer the issue to Tauri then, this is an issue with the bundler

@amrbashir amrbashir transferred this issue from tauri-apps/tao Dec 15, 2021
@amrbashir amrbashir added scope: bundler The bundler used in our cli to make installers platform: Windows type: bug labels Dec 15, 2021
@liudonghua123
Copy link
Author

Yes, I found the errors related to error LGHT0345 : 'src-tauri\target\release\Microsoft_VC142_CRT_x64.msm' is a 64-bit merge module but the product consuming it is 32-bit. 32-bit products can consume only 32-bit merge modules.

image

@liudonghua123
Copy link
Author

Does it seem fixed just now? I tried it a few minutes ago.

D:\code\rust\tauri-app>rustup target add x86_64-pc-windows-msvc
info: component 'rust-std' for target 'x86_64-pc-windows-msvc' is up to date

D:\code\rust\tauri-app>rustup target add i686-pc-windows-msvc
info: component 'rust-std' for target 'i686-pc-windows-msvc' is up to date

D:\code\rust\tauri-app>
D:\code\rust\tauri-app>yarn tauri build -t i686-pc-windows-msvc
yarn run v1.22.17
warning package.json: No license field
$ tauri build -t i686-pc-windows-msvc
 app:spawn Running "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe tauri build -t i686-pc-windows-msvc" +0ms

   Compiling windows_gen v0.25.0
   Compiling zstd-sys v1.6.1+zstd.1.5.0
   Compiling bzip2-sys v0.1.11+1.0.8
   Compiling windows v0.24.0
   Compiling parking_lot v0.11.2
   Compiling same-file v1.0.6
   Compiling native-tls v0.2.8
   Compiling dirs-next v2.0.0
   Compiling tar v0.4.37
   Compiling tokio v1.14.0
   Compiling infer v0.4.0
   Compiling rand v0.8.4
   Compiling regex v1.5.4
   Compiling windows v0.28.0
   Compiling walkdir v2.3.2
   Compiling num-iter v0.1.42
   Compiling tempfile v3.2.0
   Compiling globset v0.4.8
   Compiling serde v1.0.131
   Compiling thiserror v1.0.30
   Compiling cssparser v0.27.2
   Compiling html5ever v0.25.1
   Compiling strum v0.22.0
   Compiling futures-util v0.3.18
   Compiling png v0.11.0
   Compiling windows v0.25.0
   Compiling ignore v0.4.18
   Compiling winrt-notification v0.5.0
   Compiling string_cache v0.8.2
   Compiling url v2.2.2
   Compiling serde_json v1.0.72
   Compiling serde_urlencoded v0.7.0
   Compiling os_info v3.0.8
   Compiling bincode v1.3.3
   Compiling phf v0.10.0
   Compiling ico v0.1.0
   Compiling futures-executor v0.3.18
   Compiling notify-rust v4.5.5
   Compiling rfd v0.6.1
   Compiling attohttpc v0.18.0
   Compiling phf v0.8.0
   Compiling futures v0.3.18
   Compiling webview2-com-sys v0.7.0
   Compiling selectors v0.22.0
   Compiling markup5ever v0.10.1
   Compiling app v0.1.0 (D:\code\rust\tauri-app\src-tauri)
   Compiling kuchiki v0.8.1
   Compiling bzip2 v0.4.3
   Compiling zip v0.5.13
   Compiling zstd-safe v4.1.1+zstd.1.5.0
   Compiling zstd v0.9.0+zstd.1.5.0
   Compiling tauri-utils v1.0.0-beta.3 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling tao v0.5.2 (https://github.com/tauri-apps/tao?branch=next#dce2d529)
   Compiling webview2-com v0.7.0
   Compiling tauri-runtime v0.2.1 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling wry v0.12.2 (https://github.com/tauri-apps/wry?rev=11557f15cf759fcf3008598b684c009f03a8c645#11557f15)
   Compiling tauri-runtime-wry v0.2.1 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
   Compiling tauri v1.0.0-beta.8 (https://github.com/tauri-apps/tauri?branch=next#d56a7fc7)
    Finished release [optimized] target(s) in 4m 37s
info: Target: x86
info: Wix settings not found. Using `en-US` as language.
info: running candle for "main.wxs"
info: running candle.exe
info: running light to produce D:\code\rust\tauri-app\src-tauri\target\i686-pc-windows-msvc\release\bundle/msi/tauri-app_0.1.0_x86.msi
    Finished 1 bundle at:
        D:\code\rust\tauri-app\src-tauri\target\i686-pc-windows-msvc\release\bundle/msi/tauri-app_0.1.0_x86.msi

Done in 290.21s.

D:\code\rust\tauri-app>

If I use --target option, the output directory structure changed.

image

@amrbashir
Copy link
Member

I'll let @lucasfernog decide since he knows about this process more than anyone.

@lucasfernog
Copy link
Member

I can fix this issue, I think the CLI is doing a compile-time check for 32 vs 64bit instead of a runtime check.

@liudonghua123
Copy link
Author

@lucasfernog @amrbashir Hi, I tested again just now. It was the same error.

D:\code\rust\tauri-app>rustup toolchain list
stable-aarch64-pc-windows-msvc
stable-i686-pc-windows-msvc
stable-x86_64-pc-windows-msvc (default)

D:\code\rust\tauri-app>rustup default stable-i686-pc-windows-msvc
info: using existing install for 'stable-i686-pc-windows-msvc'
info: default toolchain set to 'stable-i686-pc-windows-msvc'

  stable-i686-pc-windows-msvc unchanged - rustc 1.57.0 (f1edd0429 2021-11-29)


D:\code\rust\tauri-app>
D:\code\rust\tauri-app>rustup toolchain list
stable-aarch64-pc-windows-msvc
stable-i686-pc-windows-msvc (default)
stable-x86_64-pc-windows-msvc

D:\code\rust\tauri-app>yarn tauri build --verbose
yarn run v1.22.17
warning package.json: No license field
$ tauri build --verbose
 app:spawn Running "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe tauri build --verbose" +0ms

   Compiling app v0.1.0 (D:\code\rust\tauri-app\src-tauri)
    Finished release [optimized] target(s) in 35.79s
info: Target: x86
info: Wix settings not found. Using `en-US` as language.
info: running candle for "main.wxs"
info: running candle.exe
Windows Installer XML Toolset Compiler version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

main.wxs
info: running light to produce D:\code\rust\tauri-app\src-tauri\target\release\bundle/msi/tauri-app_0.1.0_x86.msi
Windows Installer XML Toolset Linker version 3.11.2.4516
Copyright (c) .NET Foundation and contributors. All rights reserved.

D:\code\rust\tauri-app\src-tauri\target\release\wix\x86\main.wxs(113) : error LGHT0345 : 'D:\code\rust\tauri-app\src-tauri\target\release\Microsoft_VC142_CRT_x64.msm' is a 64-bit merge module but the product consuming it is 32-bit. 32-bit products can consume only 32-bit merge modules.
Error: failed to bundle project

Caused by:
    Shell Scripting Error:`error running light.exe`

 app:spawn Command "D:\code\rust\tauri-app\node_modules\@tauri-apps\cli\bin\tauri-cli.exe" failed with exit code: 1 +0mserror Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

D:\code\rust\tauri-app>

\src-tauri\target\release\Microsoft_VC142_CRT_x64.msm is the wrong file generated.

If I use yarn tauri build -t i686-pc-windows-msvc, it was worked well.

@lucasfernog
Copy link
Member

It will be fixed on the next release. For now you can install the Cargo CLI subcommand directly or use the target option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Windows scope: bundler The bundler used in our cli to make installers type: bug
Projects
None yet
Development

No branches or pull requests

3 participants