-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Optional CARGO_MANIFEST_DIR #477
Comments
What do you think it should do if the manifest dit is not available? |
Looking at the code now, doesn't seem like it is reasonable to be able to have optional "Root" path; but maybe we can provide it through a template parameter or something; currently we can provide path relative to the manifest root dir, but maybe alternatively we can provide an absolute path? which I guess will be way less portable -_- |
What is your use case anyway? What build system are you using if not Cargo? It doesn't seem too big of a deal to just set CARGO_MANIFEST_DIR in your environment in some other way. |
We are using BUCK; there is away to set the env variables in there; but it felt bit hacky; yet I can't think for better solution; the absolute path doesn't seem like an improvement |
If there is some other environment variable in a Buck context that we can work off of, I'd be open to having that as a fallback. |
doesn't seem like we have an equivalent really, for some reason. The only way that worked just fine, is to create a filegroup buck target, set its location is the value of |
few folks suggested to use include_str instead. Also another approach might be to avoid invoking this code path if one uses |
Now I'm wondering if include_str!() works in attribute values... |
I'm not entirely up to date on this, but as far as I recall using e.g. |
You can use |
In askama_shared/src/lib.rs#L36 this will cause the Template macro to fail if the
CARGO_MANIFEST_DIR
doesn't exist;This works well with the default rustc tool chain; however, this also means if for whatever reason
CARGO_MANIFEST_DIR
doesn't exist, the crate won't work. (proc-macro panic)Any chance this can be optional instead?
The text was updated successfully, but these errors were encountered: