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

Git crates seem to be unreliable #399

Open
purkhusid opened this issue Mar 16, 2021 · 0 comments
Open

Git crates seem to be unreliable #399

purkhusid opened this issue Mar 16, 2021 · 0 comments

Comments

@purkhusid
Copy link

purkhusid commented Mar 16, 2021

It seems like git crates are not very reliable compared to crates pulled from crate registries.

I have 2 examples where I needed to use unpublished crates and cargo-raze and they both failed to build with cargo-raze

Example 1:
I needed to use https://github.com/async-graphql/async-graphql/tree/actix-web-v4 to resolve transitive dependency issues in my workspace.
I tried adding the packages to my Cargo.toml file:

[dependencies]
async-graphql = { git = "https://github.com/async-graphql/async-graphql", branch = "actix-web-v4", package = "async-graphql" }
async-graphql-actix-web = { git = "https://github.com/async-graphql/async-graphql", branch = "actix-web-v4", package = "async-graphql-actix-web" }
async-graphql-parser = { git = "https://github.com/async-graphql/async-graphql", branch = "actix-web-v4", package = "async-graphql-parser" }
async-graphql-value = { git = "https://github.com/async-graphql/async-graphql", branch = "actix-web-v4", package = "async-graphql-value" }
async-graphql-derive = { git = "https://github.com/async-graphql/async-graphql", branch = "actix-web-v4", package = "async-graphql-derive" }

[package.metadata.raze.crates.async-graphql-parser.'*']
compile_data_attr = "glob([\"**/graphql.pest\"])"

It fails because the graphql.pest file is expected to be relative to the src directory of the async-graphql-parser package.
I believe the issue here is simply that cargo-raze always generates the rust_library target at the root of the repo.

I worked around this by forking the project and copying the graphql.pest file into the root src directory.

Example 2:
I need to use https://github.com/Azure/azure-sdk-for-rust but they have not published them to crates.io yet.
I tried adding them to my Cargo.toml:

azure_core = { git = "https://github.com/Azure/azure-sdk-for-rust", rev = "0b62407f099ff82ff9089a152541e42f00151ac3", package = "azure_core" }
azure_storage = { git = "https://github.com/Azure/azure-sdk-for-rust", rev = "0b62407f099ff82ff9089a152541e42f00151ac3", package = "azure_storage" }

But the build of the azure_storage crate fails with:

error[E0412]: cannot find type `AzureError` in this scope
  --> external/raze__azure_storage__0_1_0/sdk/storage/src/core/client.rs:37:41
   |
37 |     ) -> Result<PerformRequestResponse, AzureError>;
   |                                         ^^^^^^^^^^ not found in this scope
   |
help: consider importing one of these items
   |
1  | use azure_core::prelude::AzureError;
   |
1  | use crate::core::AzureError;

I have not figured out how I can work around this issue.

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