SOF3 / include-flate

A variant of include_bytes!/include_str! with compile-time deflation and runtime lazy inflation
https://docs.rs/include-flate
Apache License 2.0
127 stars 7 forks source link

Allow absolute path again #18

Open stevefan1999-personal opened 1 year ago

stevefan1999-personal commented 1 year ago

This means we can include files from OUT_DIR which is useful for dynamic file generation (I need to merge several folders into one place). Using relative path is simply not enough here.

Possibly related: Tracking Issue for proc_macro::{tracked_env, tracked_path} · Issue #99515 · rust-lang/rust (github.com)

Related: Fix compression with interpolated env · Issue #215 · pyrossh/rust-embed (github.com)

smoelius commented 5 months ago

Can I ask why absolute paths are not allowed?

stevefan1999-personal commented 5 months ago

Can I ask why absolute paths are not allowed?

IIRC it breaks incremental builds, for example, if you have a bunch of C headers in absolute path, and you decided to update the headers, then incremental build won't take that as a change (otherwise they will have to do an exhaustive search for all possible files referenced). You can only rebuild everything from scratch which is not economical given that Rust is still having a slow compile time.

smoelius commented 5 months ago

Interesting. Thanks for the explanation, @stevefan1999-personal.