Skip to content

Workspace with Multiple interdependent crates #314

Description

@cetra3

We have a workspace that has a few crates we use as libraries. I.e, a layout like so:

  • library1/lib.rs
  • library2/lib.rs <-- depends on library1
  • binary/main.rs <-- depends on library1 & library2

With cargo chef cook & prepare, both the libraries and binary are all skeleton files, so we can never cache library1 & library2, they are built each time.

One possible solution is to layer it, so we run cargo chef cook a couple of times to build up the cache layers. However, we'd need an option to ensure that cargo chef does not create/overwrite skeleton files for certain crates within the workspace.

I.e, you could imagine:

  • prepare
  • copy over the recipe.json
  • copy over just library1
  • cook, but exclude skeletons for library1
  • copy over library2
  • cook, but exclude skeletons for library1 & library2
  • full build

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions