rust-embed icon indicating copy to clipboard operation
rust-embed copied to clipboard

Fix compression with interpolated env

Open stevefan1999-personal opened this issue 2 years ago • 2 comments

I generated some header files to $OUT_DIR/include and I want to embed them with compression because the nature of source code (at least human readable text) very much suits dictionary compression. But it seems like starting from 6.8.1 I cannot reference $OUT_DIR/include anymore.

I wonder what is blocking this usage and are there any alternatives? (Besides from compressing it manually using tar and bzip2 and use Lazy to deflate them in runtime)

stevefan1999-personal avatar Aug 13 '23 05:08 stevefan1999-personal

Also affected by this:

error: proc-macro derive panicked
  --> src/server.rs:22:10
   |
22 | #[derive(RustEmbed)]
   |          ^^^^^^^^^
   |
   = help: message: `folder` must be a relative path under `compression` feature.

Using:

#[derive(RustEmbed)]
#[folder = "$CARGO_MANIFEST_DIR/target/assets"]
struct Assets;

alucryd avatar Aug 28 '23 14:08 alucryd

Reverted to relative paths, I think I had to use interpolation because of my cross builds, but I'll revisit them, hopefully this is no longer an issue.

alucryd avatar Aug 28 '23 16:08 alucryd