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

Provide a lightweight runtime crate to remove all the build time dependencies #204

Open
tisonkun opened this issue Feb 3, 2025 · 1 comment

Comments

@tisonkun
Copy link

tisonkun commented Feb 3, 2025

Currently, the idiom to use shadow-rs is depending on it for both build-dependencies and dependencies.

However, the code necessary in build time is not always used in runtime, such as git2, tzdb, extra.

I suppose we can provide a runtime-only crate for users.

I currently try inline the shadow! macro:

pub mod build {
    include!(concat!(env!("OUT_DIR"), "/shadow.rs"));
}

and get the compile error:

    |
252 | pub const VERSION:&str = shadow_rs::formatcp!(r#"
    |                          ^^^^^^^^^ use of unresolved module or unlinked crate `shadow_rs`

So perhaps we can provide a shadow-lib crate that contains only the macro and reexport formatcp!?

cc @baoyachi

@tisonkun
Copy link
Author

tisonkun commented Feb 3, 2025

Work it around now with:

pub mod build {
    mod shadow_rs {
        pub use const_format::formatcp;
    }

    include!(concat!(env!("OUT_DIR"), "/shadow.rs"));
}

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