Skip to content

CI: use cargo-chef for dependency build caching#97

Draft
ezdac wants to merge 5 commits intodevelopfrom
ezdac/cargo-chef
Draft

CI: use cargo-chef for dependency build caching#97
ezdac wants to merge 5 commits intodevelopfrom
ezdac/cargo-chef

Conversation

@ezdac
Copy link
Copy Markdown

@ezdac ezdac commented Jan 7, 2026

Try out if cargo-chef can be used for two-stage rust builds in order to cache the first dependency-only build.

Currently we are doing this manually by copying individual folders and files in the docker-file.
This is coupled to the source-code, and will drift and potentially break when file-changes in source are not reflected in the
docker file and thus it's layer caches.

cargo-chef promises to automate this process by constructing a build-recipe and later consuming it in a dependency-only build step that can be individually layer-cached.

This PR tries out wether that will work with our codebase.

ezdac added 2 commits January 7, 2026 09:55
Due to an incorrectly changed caching behavior (inline without push) in
the underlying docker-build composite action, the reusable-workflow
using an older action is reverted to.
@ezdac
Copy link
Copy Markdown
Author

ezdac commented Jan 9, 2026

It seems that the cargo build step after the cargo chef cook (dependency-only build) rebuilds all dependencies again, although it shouldn't.
It's possible that our specific cargo build structure (patch etc.) is not compatible with cargo chef.

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.

1 participant