[image_spec]: copy Cargo path deps for maturin packages into Docker context#32
Open
summer-exa wants to merge 1 commit intomasterfrom
Open
[image_spec]: copy Cargo path deps for maturin packages into Docker context#32summer-exa wants to merge 1 commit intomasterfrom
summer-exa wants to merge 1 commit intomasterfrom
Conversation
…er context Co-Authored-By: summer@exa.ai <summer@exa.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
anca-loo
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
When building Flyte container images for packages that use maturin (Rust crates with Python bindings via
cdylib), the image build fails because Cargo path dependencies declared inCargo.tomlare not copied into the Docker build context._copy_local_packages_and_update_lockonly copies Python packages listed inuv.lock. Rust-only crates referenced viapath = "..."inCargo.tomlare invisible to uv, so maturin/cargo fails at build time with:What changes were proposed in this pull request?
Adds
_copy_cargo_path_deps()which, after copying a local package into the Docker build context, checks if it contains aCargo.tomland recursively copies any Rust path dependencies ([dependencies],[build-dependencies],[dev-dependencies]) intolocal_packages/preserving their relative directory structure so that Cargo path references continue to resolve.The function:
.gitignore/.dockerignorepatternsHow was this patch tested?
ruff checkpassespy_compilepassesuv.lockreferencing themHuman review checklist
set[str] | Nonetype hint uses 3.10+ syntax — verify this matches flytekit's minimum supported Python version (may needOptional[Set[str]]fromtypinginstead)except Exception: returnon Cargo.toml parse — should this warn/log instead of silently skipping?dev-dependenciespath deps too, which may pull unnecessary crates into the image. Intentional for safety but worth confirming.Check all the applicable boxes
Link to Devin run | Requested by: @summer-exa