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

Set CARGO_MANIFEST_DIR env var to manifest_dir path #14

Open
Trouv opened this issue Nov 11, 2023 · 0 comments
Open

Set CARGO_MANIFEST_DIR env var to manifest_dir path #14

Trouv opened this issue Nov 11, 2023 · 0 comments

Comments

@Trouv
Copy link

Trouv commented Nov 11, 2023

I've been trying this project out on one of my projects and I ran into this issue. Some of the code snippets in my book use derive macros from bevy like.

use bevy::prelude::*;
#[derive(Default, Component)]
struct ComponentA;

Apparently these macros are written to look for CARGO_MANIFEST_DIR in the env, which wasn't found when compiling with $ mdbook build book, resulting in errors like the following:

- Test: getting-started.md_line_1 (Failed to compile)
--------------- Start of Test Log:  getting-started.md_line_1 ---------------
No stdout was captured.
----- Stderr -----

error: proc-macro derive panicked
  --> /home/trouv/projects/bevy_ecs_ldtk/book/doctest_cache/keeper_u2A0TkIqkB_MFOpJSd2QQMhrWmM5g-Zm2WlddxCS79Q.rs:25:19
   |
25 | #[derive(Default, Component)]
   |                   ^^^^^^^^^
   |
   = help: message: called `Option::unwrap()` on a `None` value

Setting CARGO_MANIFEST_DIR manually seems to fix the issue for me:

$ CARGO_MANIFEST_DIR=. mdbook build book

Curious if setting this could just be a part of mdbook-keeper since I'm already providing a manifest_dir in the book.toml?

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