You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In theory, we might be able to support the same relative path approach of include_str!() by delaying canonicalization of paths until the link phase. We have enough information to reconstruct the path from the link table.
The only thing holding this back is giving proper compile-time checks of assets. You can do this with include_bytes!() but that causes an std::fs::read() as well as LLVM hashing it byte-by-byte. For small assets, this might not matter, and unused bytes might not even make it to LLVM. For larger assets though, the load will affect compile times and memory usage.
Specific Demand
In theory, we might be able to support the same relative path approach of include_str!() by delaying canonicalization of paths until the link phase. We have enough information to reconstruct the path from the link table.
The only thing holding this back is giving proper compile-time checks of assets. You can do this with
include_bytes!()
but that causes anstd::fs::read()
as well as LLVM hashing it byte-by-byte. For small assets, this might not matter, and unused bytes might not even make it to LLVM. For larger assets though, the load will affect compile times and memory usage.Ideas to get around this include:
rust-lang/rust#103812
rust-lang/rust#65818
rust-lang/rust#103812 (comment)
The text was updated successfully, but these errors were encountered: