rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

include_bytes! macro can not find file present in same directory as source file

Open bdalton opened this issue 6 years ago • 2 comments

The documentation for include_bytes! specifies:

Includes a file as a reference to a byte array.

The file is located relative to the current file (similarly to how modules are found). The provided path is interpreted in a platform-specific way at compile time. So, for instance, an invocation with a Windows path containing backslashes \ would not compile correctly on Unix.

When creating a project with rules_rust, compilation produces errors that no such file or directory exists.

This is similar to #79 , except the files are present in the same directory as the source file instead of being the output of a genrule.

bdalton avatar Sep 16 '20 18:09 bdalton

The files need to be included in the data arg of rust_binary/library.

dae avatar Oct 12 '20 07:10 dae

Feel free to reopen if adding to data attr was not the fix.

mfarrugi avatar Oct 21 '20 19:10 mfarrugi