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

Debug builds more lenient when loading relative paths #228

Open
949f45ac opened this issue Dec 21, 2023 · 0 comments
Open

Debug builds more lenient when loading relative paths #228

949f45ac opened this issue Dec 21, 2023 · 0 comments

Comments

@949f45ac
Copy link

Hey there, cool library that is working very well for me!

I only ran into one confusing corner case. When loading paths that have (silly) inner relative segments, like foo/bar/baz/../../other, the debug loader will happily resolve and load this path from disk. The bundled (release) loader though will fail, presumably because each bundled file is only mapped to its canonical path string.
I think the bundled loader’s behavior is very sensible - it would only be nice if the debug loader also failed to load these relative paths. Or at least printed a fat warning that it would have failed to resolve that path in the release build.


After figuring out the cause for my release build’s issue, I solved it by using https://github.com/danreeves/path-clean on the paths before passing them to rust_embed, which is simple enough.
I think it’s sensible that rust_embed doesn’t do this automatically.
My feature request is only that the debug builds should also fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant