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

Support relative assets like include_str!() #59

Open
jkelleyrtp opened this issue Aug 6, 2024 · 0 comments
Open

Support relative assets like include_str!() #59

jkelleyrtp opened this issue Aug 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@jkelleyrtp
Copy link
Member

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 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.

Ideas to get around this include:

rust-lang/rust#103812
rust-lang/rust#65818
rust-lang/rust#103812 (comment)

@jkelleyrtp jkelleyrtp added the enhancement New feature or request label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant