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

[bug] Compile on Linux (Debian). Target : Windows #10013

Closed
ezawadzki opened this issue Jun 7, 2024 · 13 comments
Closed

[bug] Compile on Linux (Debian). Target : Windows #10013

ezawadzki opened this issue Jun 7, 2024 · 13 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@ezawadzki
Copy link

ezawadzki commented Jun 7, 2024

Describe the bug

I am trying to build a Nuxt application, from Debian, and try to make an exe for Windows.

Reproduction

I am following this tutorial in official documentation :
https://tauri.app/v1/guides/building/cross-platform#experimental-build-windows-apps-on-linux-and-macos

Expected behavior

Make an executable for Windows.

Full tauri info output

[✔] Environment
    - OS: Debian 12 X64
    ✔ webkit2gtk-4.0: 2.44.2
    ✔ rsvg2: 2.54.7
    ✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
    ✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 18.20.3
    - pnpm: 9.1.4
    - npm: 10.7.0

[-] Packages
    - tauri [RUST]: 1.6.8
    - tauri-build [RUST]: 1.5.2
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - @tauri-apps/api [NPM]: 1.5.6
    - @tauri-apps/cli [NPM]: 1.5.14

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../.output/public
    - devPath: http://localhost:3000/
    - framework: Vue.js (Nuxt)
    - bundler: Webpack

Stack trace

Compiling webview2-com-sys v0.19.0
   Compiling tao v0.16.9
   Compiling app v0.1.0 (/media/emilie/7769912a-08ae-4a9e-b298-0104c2821d2a/emilie/Devel/my-project/src-tauri)
warning: app@0.1.0: clang: warning: unknown argument ignored in clang-cl: '-xc' [-Wunknown-argument]
   Compiling webview2-com v0.19.1
   Compiling tauri-runtime v0.14.3
   Compiling wry v0.24.10
   Compiling tauri-runtime-wry v0.14.8
   Compiling tauri v1.6.8
    Finished `release` profile [optimized] target(s) in 1m 22s
        Warn Cross-platform compilation is experimental and does not support all features. Please use a matching host system for full compatibility.
        Warn ignoring msi
        Info Verifying NSIS package
 Downloading https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.3.0/nsis_tauri_utils.dll
        Info validating hash
       Error failed to bundle project: `No such file or directory (os error 2)`

Additional context

I tried this command clang -xc hello.c on a hello world code :

#include <stdio.h>
int main() {
   // printf() displays the string inside quotation
   printf("Hello, World!");
   return 0;
}

I got no error, no output.

Debian clang version 14.0.6
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

I also could create a .deb file for the same project and it works.

@ezawadzki ezawadzki added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jun 7, 2024
@FabianLars
Copy link
Member

I tried this command clang -xc hello.c on a hello world code :

The error is happening after compilation when it tries to create the installer from your app binary. Can you share your tauri.conf.json file? Or at least your productName for now.

@ItsCentric
Copy link

I am also having this issue with my SvelteKit application, trying to build for windows on Ubuntu:

tauri info:

[Γ£ö] Environment
    - OS: Ubuntu 22.4.0 X64
    Γ£ö webkit2gtk-4.1: 2.44.2
    Γ£ö rsvg2: 2.52.5
    Γ£ö rustc: 1.78.0 (9b00956e5 2024-04-29)
    Γ£ö cargo: 1.78.0 (54d8815d0 2024-03-26)
    Γ£ö rustup: 1.27.1 (54dd3d00f 2024-04-24)
    Γ£ö Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.14.0
    - yarn: 1.22.19
    - npm: 10.7.0
    - bun: 1.0.23

[-] Packages
    - tauri [RUST]: 2.0.0-beta.22
    - tauri-build [RUST]: 2.0.0-beta.17
    - wry [RUST]: 0.40.0
    - tao [RUST]: 0.28.0
    - tauri-cli [RUST]: 2.0.0-beta.20
    - @tauri-apps/api [NPM]: 2.0.0-beta.13
    - @tauri-apps/cli [NPM]: 2.0.0-beta.20

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../build
    - devUrl: http://localhost:5173/
    - framework: Svelte
    - bundler: Vite

tauri.conf.json:

{
        "build": {
                "beforeBuildCommand": "bun run build",
                "beforeDevCommand": "bun run dev",
                "frontendDist": "../build",
                "devUrl": "http://localhost:5173"
        },
        "bundle": {
                "active": true,
                "category": "DeveloperTool",
                "copyright": "",
                "targets": "all",
                "externalBin": [],
                "icon": [
                        "icons/32x32.png",
                        "icons/128x128.png",
                        "icons/128x128@2x.png",
                        "icons/icon.icns",
                        "icons/icon.ico"
                ],
                "windows": {
                        "certificateThumbprint": null,
                        "digestAlgorithm": "sha256",
                        "timestampUrl": ""
                },
                "longDescription": "",
                "macOS": {
                        "entitlements": null,
                        "exceptionDomain": "",
                        "frameworks": [],
                        "providerShortName": null,
                        "signingIdentity": null
                },
                "resources": [],
                "shortDescription": "",
                "linux": {
                        "deb": {
                                "depends": []
                        }
                }
        },
        "productName": "Game Chronicle",
        "version": "0.8.0",
        "identifier": "com.gamechronicle.www",
        "plugins": {
                "updater": {
                        "endpoints": ["https://github.com/ItsCentric/game-chronicle/releases"],
                        "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEM3OTUyQjJEMjA5Q0VFMzAKUldRdzdwd2dMU3VWeCswV21RQ1Vkd256TzhCN0l4STJ1M0d3Y1YwYzVYYnR1NVFaekxmS1RocGsK"
                }
        },
        "app": {
                "windows": [
                        {
                                "height": 600,
                                "resizable": true,
                                "title": "Game Chronicle",
                                "width": 800,
                                "minHeight": 600,
                                "minWidth": 800,
                                "label": "main"
                        },
                        {
                                "title": "Game Chronicle Updater",
                                "label": "updater",
                                "url": "/updater",
                                "height": 400,
                                "width": 600,
                                "resizable": false,
                                "decorations": false,
                                "hiddenTitle": true,
                                "center": true,
                                "visible": false
                        }
                ],
                "security": {
                        "csp": null
                }
        }
}

@FabianLars
Copy link
Member

Hmm, i downloaded your repo and can compile it fine 🤔 Can you rerun it with the -vvv flag? Maybe it tells us a bit more.

@ItsCentric
Copy link

Strange, shortly after running the tauri info command it somehow fixed it even though I didn't change anything

@ezawadzki
Copy link
Author

Tnaks @FabianLars for your quick reply. Here is my tauri.conf.json :

{
  "build": {
    "beforeBuildCommand": "pnpm run generate",
    "beforeDevCommand": "pnpm run dev",
    "devPath": "http://localhost:3000",
    "distDir": "../.output/public"
  },
  "package": {
    "productName": "MyProject-XR",
    "version": "0.1.0"
  },
  "tauri": {
    "allowlist": {
      "all": false
    },
    "bundle": {
      "active": true,
      "category": "DeveloperTool",
      "copyright": "",
      "deb": {
        "depends": []
      },
      "externalBin": [],
      "icon": [
        "icons/32x32.png",
        "icons/128x128.png",
        "icons/128x128@2x.png",
        "icons/icon.icns",
        "icons/icon.ico"
      ],
      "identifier": "com.MyProject",
      "longDescription": "",
      "macOS": {
        "entitlements": null,
        "exceptionDomain": "",
        "frameworks": [],
        "providerShortName": null,
        "signingIdentity": null
      },
      "resources": [],
      "shortDescription": "",
      "targets": "all",
      "windows": {
        "certificateThumbprint": null,
        "digestAlgorithm": "sha256",
        "timestampUrl": ""
      }
    },
    "security": {
      "csp": null
    },
    "updater": {
      "active": false
    },
    "windows": [
      {
        "fullscreen": false,
        "height": 600,
        "resizable": true,
        "title": "MyProject-XR Virtual",
        "width": 800
      }
    ]
  }
}

@ezawadzki
Copy link
Author

ezawadzki commented Jun 10, 2024

@FabianLars don't you think it is because of this warning ?
@ItsCentric do you have the same warning ?

app@0.1.0: clang: warning: unknown argument ignored in clang-cl: '-xc'

@FabianLars
Copy link
Member

No, this warning comes from compiling the rust part but the error where it fails is from the nsis installer bundler which happens way after. Also, this warning is "normal" (as in everyone should start seeing it now).

Can you remove the productName and test again? The productName caused issues in cross compiling before so maybe i missed something...

@ezawadzki
Copy link
Author

@FabianLars I deleted the key productName in tauri.conf.json. I got the same issue.

@ezawadzki
Copy link
Author

Whow ! But I have an .exe ! I will test it.

@ezawadzki
Copy link
Author

IT WORKS !

@FabianLars
Copy link
Member

Well, the exe should have been there the whole time (if you mean the one in target/release/ not in bundle/nsis/).

That's the rust app the cl warning came from. It can be enough for usecase but for many it isn't as it doesn't support all of Tauris features and won't make sure the webview is installed (not a problem on win11).

@FabianLars
Copy link
Member

I'll see if I can reproduce the error on my end today

@FabianLars
Copy link
Member

FabianLars commented Jun 10, 2024

Ah, i see. The No such file error was already fixed on the 1.x branch and will be part of the next release.

You can use it via cargo install tauri-cli --git https://github.com/tauri-apps/tauri --branch 1.x before that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants