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

Chore: Cyclical dev-dependency breaks dx #2649

Closed
greyscaled opened this issue Feb 15, 2024 · 0 comments · Fixed by #2674
Closed

Chore: Cyclical dev-dependency breaks dx #2649

greyscaled opened this issue Feb 15, 2024 · 0 comments · Fixed by #2674
Assignees

Comments

@greyscaled
Copy link
Contributor

In VS Code, using rust-analyzer, cyclical dev-dependencies break IDE features including "clicking" on items to go to them, getting type & docstring information, finding references and implementations etc.

According to rust-analyzer

the real issue here is that cargo even allows this kind of cycle

That issue has a lot of useful back-and-forth on the impact of cycles in such tests - including compilation time. Regardless, the point here is that development with rust-analyzer won't work for the cycled items in the crates with the cycle.

For example, I can't get any information on the following symbols:

use datafusion_ext::errors::ExtensionError;
use datafusion_ext::functions::{FuncParamValue, TableFuncContextProvider};
use datasources::bson::table::bson_streaming_table;
use datasources::common::url::{DatasourceUrl, DatasourceUrlType};
use datasources::object_store::generic::GenericStoreAccess;

in the file crates/sqlbuiltins/src/functions/table/bson.rs, and the bson_streaming_table function is left without a highlight

bson_import

The cycle:

  • sqlbuiltins has items that depend on catalog (datasources, datafusion_ext)

  • catalog depends on metastore for tests:

metastore = { path = "../metastore" }

use metastore::local::start_inprocess;

  • metastore depends on sqlbuiltins

use sqlbuiltins::builtins::{
BuiltinDatabase,
BuiltinSchema,
BuiltinTable,
BuiltinView,
DATABASE_DEFAULT,
DEFAULT_SCHEMA,
FIRST_NON_STATIC_OID,
SCHEMA_DEFAULT,
};


The full output from rust-analyzer is here:

2024-02-15T05:08:02.640789Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> catalog(Idx::<CrateData>(119)), alternative path: catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
2024-02-15T05:08:02.640846Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> datafusion_ext(Idx::<CrateData>(199)), alternative path: datafusion_ext(Idx::<CrateData>(199)) -> catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
2024-02-15T05:08:02.640876Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> datasources(Idx::<CrateData>(200)), alternative path: datasources(Idx::<CrateData>(200)) -> datafusion_ext(Idx::<CrateData>(199)) -> catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
2024-02-15T05:08:03.361310Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> catalog(Idx::<CrateData>(119)), alternative path: catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
2024-02-15T05:08:03.361363Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> datafusion_ext(Idx::<CrateData>(199)), alternative path: datafusion_ext(Idx::<CrateData>(199)) -> catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
2024-02-15T05:08:03.361393Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> datasources(Idx::<CrateData>(200)), alternative path: datasources(Idx::<CrateData>(200)) -> datafusion_ext(Idx::<CrateData>(199)) -> catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
2024-02-15T05:08:06.237341Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> catalog(Idx::<CrateData>(119)), alternative path: catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
2024-02-15T05:08:06.237389Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> datafusion_ext(Idx::<CrateData>(199)), alternative path: datafusion_ext(Idx::<CrateData>(199)) -> catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
2024-02-15T05:08:06.237412Z ERROR project_model::workspace: cyclic deps: sqlbuiltins(Idx::<CrateData>(642)) -> datasources(Idx::<CrateData>(200)), alternative path: datasources(Idx::<CrateData>(200)) -> datafusion_ext(Idx::<CrateData>(199)) -> catalog(Idx::<CrateData>(119)) -> metastore(Idx::<CrateData>(397)) -> sqlbuiltins(Idx::<CrateData>(642))
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

Successfully merging a pull request may close this issue.

2 participants