cargo
cargo copied to clipboard
Plugin defines cargo dependencies to be implicit dependencies
Here is a project graph:
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:
And here is the output of build
The fix is pretty easy, and I am willing to make a PR for the same.
I will make a PR for this once #21 is merged to prevent merge conflicts.
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 I wrote this plugin which solves the above problem. You can install it from NPM https://www.npmjs.com/package/@ignisda/nx-rust.
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.