cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Plugin defines cargo dependencies to be implicit dependencies

Open IgnisDa opened this issue 2 years ago • 3 comments

Here is a project graph: image

As you can see all dependencies declared in apps/esteem/Cargo.toml are added as implicit dependencies. By definition, only in-workspace projects qualify as implicitDependencies.So in the above example only esteem_core should be display in the graph.

I could not find any specific documentation for this, but you can test it easily by adding a random name to your project.json.

As an example: image

And here is the output of build image

The fix is pretty easy, and I am willing to make a PR for the same.

IgnisDa avatar Jul 31 '22 04:07 IgnisDa

I will make a PR for this once #21 is merged to prevent merge conflicts.

IgnisDa avatar Jul 31 '22 04:07 IgnisDa

I think this leads also to an error when using "nx affected":

I guess this came somewhere between nrwl/[email protected] and nrwl/[email protected], because I get the following error, after migrating nrwl/workspace to 14.5.10.

"TypeError: Cannot read properties of undefined (reading 'length')"

in /node_modules/nx/src/project-graph/affected/locators/workspace-projects.js:9:58,

as workaround I temporarily removed "@nxrs/cargo" from plugins in "nx.json", but not sure about the consequences.

Would be great to see this running again soon

ndrsg avatar Aug 24 '22 12:08 ndrsg

@ndrsg I wrote this plugin which solves the above problem. You can install it from NPM https://www.npmjs.com/package/@ignisda/nx-rust.

IgnisDa avatar Aug 24 '22 15:08 IgnisDa

This is fixed now — I was trying to emulate what Nx does with its own tracking of npm dependencies for JavaScript projects, but the way I was going about it was kind of a hack and probably not actually very useful.

External dependency tracking will be fixed properly once this plugin upgrades to Nx v19.x, but that won't happen until I can validate that the new Nx version doesn't cause any issues with my main project that's consuming this plugin.

dannymcgee avatar May 08 '24 02:05 dannymcgee