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

blocker: relative paths involving parent directory in a workspace don't work when deploying to crates.io #22

Open
sam0x17 opened this issue Nov 1, 2023 · 0 comments
Assignees

Comments

@sam0x17
Copy link
Owner

sam0x17 commented Nov 1, 2023

Originally docify operated on workspace-relative paths, because this often makes the most sense when working in a large workspace. I switched this to be current-crate-relative because apparently when cargo deploys to crates.io, it completely isolates the current crate being compiled (even it if is part of a workspace) such that parent directories are inaccessible. This means any docify embeds that attempt to embed something that is relative to a parent directory of the current directory in a workspace will fail when you go to deploy to crates.io

This would be fine if we could cfg gate docify embed, but because we operate in #[doc = ..] position, this is also impossible because conditional compilation is impossible from that position. A possible workaround for this would be switching to #4 which uses an "outer attribute" approach that would allow gating docify embed such that they do not try to run during crates.io deploys. It has yet to be shown, however, whether this will still function correctly when docs.rs goes to deploy, since we've never gotten a build that far that uses parent directory relative paths.

The other potential workaround is to do a git integration as outlined in #14 and use this as a fallback for situations where the parent directory can't be accessed.

All attempts to detect whether we are cfg(doc) from within the docify::embed proc macro have also failed -- this is not detectable directly from the context of a proc macro, though this could change in the future if some of the proc macro diagnostics features get merged into stable.

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