-
Notifications
You must be signed in to change notification settings - Fork 57
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
Make use of workspace dependencies #692
Make use of workspace dependencies #692
Conversation
This allows us to define several crate dependencies in a single place: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table Signed-off-by: Daiki Ueno <[email protected]>
68ec566
to
2a2de2d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
tokio.workspace = true | ||
tss-esapi.workspace = true | ||
thiserror.workspace = true | ||
uuid.workspace = true | ||
zmq = {version = "0.9.2", optional = true} | ||
# wiremock was moved to be a regular dependency because optional | ||
# dev-dependencies are not supported | ||
# see: https://github.com/rust-lang/cargo/issues/1596 | ||
wiremock = {version = "0.5", optional = true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why zmq and wiremock are out of the inheritance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think because they are used only in keylime-agent
, not shared with the other parts (keylime
and keylime-ima-emulator
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason behind this is that the top-level workspace.dependencies can't include optional dependencies, as described at https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ueno I can be confused here, so bare with me. But IIUC this is valid:
zmq = {workspace = ture, optional = true}
See for example https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#inheriting-a-dependency-from-a-workspace
You are right that we cannot do this in the top level, in [workspace.dependencies]
, where all the dependencies are listed, but I am not sure how relevant is that. For example, if a consequence of doing this is that during vendoring the optional crates will always be included.
This allows us to define several crate dependencies in a single place: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table