-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Embed config-relative paths as a substring #12193
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
Comments
Thanks for the report. It's a bit unclear what you want to achieve. Can you share a more complete example for your use case? Will environment variable expansion #10789 helps? Besides, an unstable flag |
I think #10789 might work if it can expand env vars set within the cargo.toml. For this feature request, it is to emulate setting the env var on the command line like |
Slight bikeshed: this seems like it could be written more simply as |
@rhgndf Could you please expand on your use case here? When we discussed this in a Cargo meeting, we weren't clear on exactly what the use case was. In particular, could you explain why this is relative to the config rather than the package root, and why |
It seems like when compiling a dependency's C file the relative path does not start from the cargo.toml path. Maybe it starts from the dependency package root instead? I would like to use this feature to include some header files not present in wasm32-unknown-unknown in order to make the C source files from the dependency compile successfully. |
Where is the Note that Cargo configurations It would be helpful if you could provide a concrete layout of the project or a reproducible example. |
Here's an example: https://github.com/rhgndf/configrelative |
I've stumbled on this issue coming from another use-case: setting the In my case, I have:
and I would like to be able to set [build]
rustdocflags = [
"--html-in-header", ".cargo/katex.header.html",
"--html-after-context", ".cargo/katex.script.html"
] This (as discussed above) does not work, but I think would be a good use-case to relative paths. This is in analogy to the [package.metadata.docs.rs]
rustdoc-args = [
"--html-in-header", ".cargo/katex.header.html",
"--html-after-content", ".cargo/katex.script.html",
] WorkaroundAs a workaround, using export RUSTDOCFLAGS="${RUSTDOCFLAGS:-} --html-in-header $PWD/.cargo/katex.header.html"
export RUSTDOCFLAGS="${RUSTDOCFLAGS:-} --html-after-content $PWD/.cargo/katex.script.html" This of course relies on any contributor having |
Problem
Config env vars as far as I can tell cannot embed relative paths as a substring.
Proposed Solution
It would be useful to be able to set env vars like this for dependencies that need to compile C libraries.
Notes
Useful if needed to modify how a library compiles for wasm32-unknown-unknown
The text was updated successfully, but these errors were encountered: