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

Fails cross-compiled and run under Wine in debug mode. #205

Closed
John-Nagle opened this issue Feb 20, 2023 · 2 comments
Closed

Fails cross-compiled and run under Wine in debug mode. #205

John-Nagle opened this issue Feb 20, 2023 · 2 comments

Comments

@John-Nagle
Copy link

John-Nagle commented Feb 20, 2023

Chasing down a crash in a program that is cross-compiled from Linux to Windows and then run under Wine 8.0.

Tried building rust-embed's examples.

> cargo build --target x86_64-pc-windows-gnu --examples
> wine basic.exe
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:build_joystick_report_descriptor More than 8 absolute axes found, ignoring.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', examples/basic.rs:8:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The failed unwrap is for get("index.html").unwrap().

That's in debug mode. Release mode, where the file actually gets included in the executable, succeeds.

I tried putting a file called "index.html" in the same directory as "basic.exe", but it didn't help.

So there's some confusion over where to look for the embedded files. Where is it looking?

Rust 1.67.1 stable, Ubuntu 20.04 LTS, Wine 8.0.

@John-Nagle
Copy link
Author

Turns out that the macro stores the canonical full path of the embedded file in the executable, for use in debug builds. This is wrong when source host != target host. When source and target are different, debug-embed needs to be set, even in debug mode.

@pyrossh pyrossh closed this as completed Apr 19, 2024
@John-Nagle
Copy link
Author

Thanks!

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