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

[feat] firendly error output when make nsis bundle on linux but got (os error 2) #9221

Closed
LemonNekoGH opened this issue Mar 19, 2024 · 4 comments · Fixed by #9375
Closed

Comments

@LemonNekoGH
Copy link

Describe the problem

I am using tauri cli 1.5.11, i always get Error failed to bundle project: No such file or directory (os error 2) when i build nsis bundle on linux, i don't know why, then i found a issue #6743 about this error, so i think my tauri version is too low, but after i upgraded to 2.0.0-beta.9, this error still exist.

I am so confused, so i debug the tauri cli line by line, i found my binary file name is not nsis needs, just because my package.productionName is BDSM but nsis needs bdsm, the error occoured at:

let mut size = metadata(main)?.len();

Here is the error log:

warning: `bdsm` (bin "bdsm") generated 4 warnings
    Finished release [optimized] target(s) in 4m 08s
    Warn Cross-platform compilation is experimental and does not support all features. Please use a matching host system for full compatibility.
    Info Verifying NSIS package
    Downloading https://github.com/tauri-apps/binary-releases/releases/download/nsis-plugins-v0/NSIS-ApplicationID.zip
    Info extracting NSIS ApplicationID plugin
    Downloading https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.2.2/nsis_tauri_utils.dll
    Info validating hash
    Info Target: x64
    Info Code signing is currently only supported on Windows hosts, skipping...
    Error failed to bundle project: `No such file or directory (os error 2)`

Describe the solution you'd like

I think, can we provide which file name caused No such file or directory like this:

cannot get metadata for /app/src-tauri/target/x86_64-pc-windows-msvc/release/bdsm.exe: Os { code: 2, kind: NotFound, message: "No such file or directory" }

Alternatives considered

No response

Additional context

No response

@FabianLars
Copy link
Member

The issue you linked was fixed before the first nsis release so i doubt it's related.

Is the output you posted with the --verbose flag?

Also please post the output of the tauri info command so we know the versions and OS we're dealing with here :)

Lastly, do you have a minimal reproduction for this, or is your project public?

@LemonNekoGH
Copy link
Author

Yes I used --verbose flag.
My environment is stable because we use Gitlab Pipelines, so the output of tauri info command is always:

[✘] Environment
    - OS: Debian 12.0.0 X64
    ✘ webkit2gtk-4.1: not installed
      Visit https://tauri.app/v1/guides/getting-started/prerequisites to learn more about tauri prerequisites
    ✔ rsvg2: 2.54.7
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: 1.76.0-x86_64-unknown-linux-gnu (default)
    - node: 18.19.1
    - pnpm: 8.11.0
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 2.0.0-beta.12
    - tauri-build [RUST]: 2.0.0-beta.10
    - wry [RUST]: 0.37.0
    - tao [RUST]: 0.26.1
    - @tauri-apps/api [NPM]: 2.0.0-beta.6
    - @tauri-apps/cli [NPM]: 2.0.0-beta.10
#19 5.942
[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:5173/
    - framework: Vue.js
    - bundler: Vite

Here is minimal produce code repository: https://github.com/LemonNekoGH/os-error-2-minimal

This error can be fixed by change product name to lowercase.

@sec-researcher
Copy link

I also have the same problem by running:
cargo tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc

Error failed to bundle project: No such file or directory (os error 2)

Change product name to lowercase solved it.

@FabianLars
Copy link
Member

FabianLars commented Apr 16, 2024

This should be fixed (by accident) in the latest beta cli version (beta.13). Can someone confirm this?

Edit: Correction, this will be fixed in an upcoming v2 release. I still had the CLI from this pr installed in my test...

The implementation won't work for the v1 branch so i'll try to find another fix.

amrbashir pushed a commit that referenced this issue Apr 18, 2024
…piling (#9481)

* fix(bundler): Don't convert product name to snake case when cross compiling

fixes #9221

* Update bundler-cross-uppercase-productname.md

* Update .changes/bundler-cross-uppercase-productname.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants