Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRelative paths #11
Comments
This comment has been minimized.
This comment has been minimized.
|
The crux here seems to be that I don't know how to implement relative include paths. My preference is to relative paths as well. Leading I have not been able to figure out which rust source file is currently being compiled when the procedural macro gets executed, so the only thing I have to go by is the current working directory, which is the crate root. |
maghoff
added
the
help wanted
label
Feb 8, 2017
maghoff
changed the title
Feedback: relative paths
Relative paths
Feb 8, 2017
This comment has been minimized.
This comment has been minimized.
|
Hm, maybe https://www.reddit.com/r/rust/comments/a3fgp6/procmacro_determining_the_callers_module_path/ is a lead. I would first need to get hold of a Note: |
anowell commentedFeb 8, 2017
When I move modules around, I end up breaking Bart rendered components because of the path being relative to crate root. It might just be that I also happen to be using a lot of
include_str!which has me used to using paths relative to the file that invokes the macro, but I find relative paths to be a bit nicer. On the flip side, someone with all their templates in a roottemplatesdir would probably feel the opposite, so take this with a grain of salt. I wonder if you could use a prefix/to indicate crate root.(feel free to disregard/close.. just sharing feedback)