Skip to content

Conversation

@ueno
Copy link
Contributor

@ueno ueno commented Dec 16, 2023

This allows us to define several crate dependencies in a single place: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table

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 <ueno@gnu.org>
@ueno ueno force-pushed the wip/dueno/workspace-dependencies branch from 68ec566 to 2a2de2d Compare January 10, 2024 00:02
@codecov
Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (946cd08) 66.51% compared to head (2a2de2d) 66.51%.

Additional details and impacted files
Flag Coverage Δ
e2e-testsuite 60.21% <ø> (ø)
upstream-unit-tests 54.01% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

# 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}
Copy link
Contributor

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?

Copy link
Contributor

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)

Copy link
Contributor Author

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

Copy link
Contributor

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.

@ansasaki ansasaki merged commit dfda770 into keylime:master Jan 10, 2024
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 this pull request may close these issues.

5 participants