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

Issue importing axum with raze 0.15.0 #480

Open
snowp opened this issue Apr 12, 2022 · 2 comments
Open

Issue importing axum with raze 0.15.0 #480

snowp opened this issue Apr 12, 2022 · 2 comments

Comments

@snowp
Copy link

snowp commented Apr 12, 2022

Using 0.15.0 cargo-raze to pull in axum (as a transitive dep of tonic) I run into the following compilation issue:

error: couldn't read external/raze__axum__0_5_1/src/routing/../docs/routing/into_make_service_with_connect_info.md: No such file or directory (os error 2)
   --> external/raze__axum__0_5_1/src/routing/mod.rs:407:13
    |
407 |     #[doc = include_str!("../docs/routing/into_make_service_with_connect_info.md")]
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I was able to fix this locally by applying the following patch:

diff --git a/cargo/remote/BUILD.axum-0.5.1.bazel b/cargo/remote/BUILD.axum-0.5.1.bazel
index c992d4e..c397f2b 100644
--- a/cargo/remote/BUILD.axum-0.5.1.bazel
+++ b/cargo/remote/BUILD.axum-0.5.1.bazel
@@ -40,7 +40,7 @@ rust_library(
     crate_features = [
     ],
     crate_root = "src/lib.rs",
-    data = [],
+    data = glob(["**/*.md"]),
     edition = "2018",
     proc_macro_deps = [
         "@raze__async_trait__0_1_53//:async_trait",

I'm fairly new to raze so I could be missing something, but in general I'd expect this to "just work"

@sayrer
Copy link
Contributor

sayrer commented Jun 20, 2022

I'm fairly new to raze so I could be missing something, but in general I'd expect this to "just work"

You can fix it with something like this in Cargo.toml in the raze section:

[workspace.metadata.raze.crates.axum.'0.5.1']
data_attr = 'glob(["**/*.md"])'

I am not sure if it's possible to determine this dependency under Cargo without actually doing a build. In Bazel, this dependency would need to be determined in the "analysis" phase.

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

3 participants
@sayrer @snowp and others