nabijaczleweli / rust-embed-resource

A Cargo build script library to handle compilation and inclusion of Windows resources, in the most resilient fashion imaginable
MIT License
173 stars 29 forks source link

Failed to build with Tauri 1.2 #58

Closed Massimiliano-solutiontech closed 1 year ago

Massimiliano-solutiontech commented 1 year ago

I created both the files app-name-manifest.rc and app-name.exe.manifest in the root of Rust ./src-tauri when I launch npm run tauri build I get the following error

  = note: CVTRES : fatal error CVT1100: duplicate resource. Type: MANIFEST, name: 1, language: 0x0409
          LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
nabijaczleweli commented 1 year ago

cool. tarball to repro?

Massimiliano-solutiontech commented 1 year ago

test-app.tar.gz

nabijaczleweli commented 1 year ago

Works for me under stable-x86_64-pc-windows-gnu by running cargo build in test-app/src-tauri, but I see both the requestedPrivileges sample manifest and the icon in the resulting executable. Notably, the sample manifest does not include an icon (and you haven't added it there), so I'm assuming the linker merges these for me.

I even see in target/debug/build/test-app-2c1454acc47ad2b2/output:

cargo:rustc-link-arg-bins=T:\test-app\src-tauri\target\debug\build\test-app-2c1454acc47ad2b2\out/libresource.a
cargo:rustc-link-arg-bins=T:\test-app\src-tauri\target\debug\build\test-app-2c1454acc47ad2b2\out/libtest-app-manifest.a 

and a corresponding https://github.com/tauri-apps/winres/blob/db468ecc70ba7f47b01e7d289c12cd7ca3b381f6/lib.rs#L641 (I think it's corresponding, the layout is hell).

I'm therefore concluding that (a) LINK.EXE cannot deal with multiple manifests, (b) r-e-r works as expected here, and (c) you should either find a way to give the tauri build system a manifest instead of using r-e-r or disable its own manifest injection.