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

Unable to build with embed-resource dependency #86

Closed
pashokitsme opened this issue Dec 4, 2023 · 1 comment
Closed

Unable to build with embed-resource dependency #86

pashokitsme opened this issue Dec 4, 2023 · 1 comment

Comments

@pashokitsme
Copy link

Host machine: aarch64-apple-darwin

Context: I trying to cross-compile tauri, which uses winres (and embed-resource), tauri-apps/tauri#7816

Minimal repro with only embed_resource as build-dependency:
Following code

// build.rs

fn main() {
    embed_resource::compile(
        "/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore", // Absolute path includes */U*
        embed_resource::NONE,
    )
}

With build command

cargo xwin build --target x86_64-pc-windows-msvc

Causes compile error; stderr:

The following warnings were emitted during compilation:

�[1m�[33mwarning�[0m�[1m:�[0m clang-cl: warning: unknown argument ignored in clang-cl: '-xc' [-Wunknown-argument]
�[1m�[33mwarning�[0m�[1m:�[0m clang-cl: warning: '/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore' treated as the '/U' option [-Wslash-u-filename]
�[1m�[33mwarning�[0m�[1m:�[0m clang-cl: note: use '--' to treat subsequent arguments as filenames
�[1m�[33mwarning�[0m�[1m:�[0m clang-cl: error: no input files

�[1m�[31merror�[0m�[1m:�[0m failed to run custom build command for `embed-resources v0.1.0 (/Users/pavel.smirnov/Source/temp/embed-resources)`

Caused by:
  process didn't exit successfully: `/Users/pavel.smirnov/Source/temp/embed-resources/target/debug/build/embed-resources-e8182c710fae58ac/build-script-build` (exit status: 1)
  --- stdout
  running: "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-I" "/Users/pavel.smirnov/Source/temp/embed-resources/target/x86_64-pc-windows-msvc/debug/build/embed-resources-4f8e1beb062f0e0a/out" "-xc" "-DRC_INVOKED" "-E" "/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore"
  cargo:warning=clang-cl: warning: unknown argument ignored in clang-cl: '-xc' [-Wunknown-argument]

  cargo:warning=clang-cl: warning: '/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore' treated as the '/U' option [-Wslash-u-filename]

  cargo:warning=clang-cl: note: use '--' to treat subsequent arguments as filenames

  cargo:warning=clang-cl: error: no input files

  exit status: 1

  --- stderr


  error occurred: Command "clang-cl" "-nologo" "-MD" "-Z7" "-Brepro" "-m64" "--target=x86_64-pc-windows-msvc" "-Wno-unused-command-line-argument" "-fuse-ld=lld-link" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/crt/include" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/ucrt" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/um" "/imsvc/Users/pavel.smirnov/Library/Caches/cargo-xwin/xwin/sdk/include/shared" "-I" "/Users/pavel.smirnov/Source/temp/embed-resources/target/x86_64-pc-windows-msvc/debug/build/embed-resources-4f8e1beb062f0e0a/out" "-xc" "-DRC_INVOKED" "-E" "/Users/pavel.smirnov/Source/temp/embed-resources/.gitignore" with args "clang-cl" did not execute successfully (status code exit status: 1).
@messense
Copy link
Member

This should have been fixed in cc-rs: rust-lang/cc-rs#514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants