Skip to content

Preserve the workspace lockfile in Python source distributions - #254

Merged
beinan merged 1 commit into
lance-format:mainfrom
YangjunZ:2026-09-17_lance-context_publish-lockfile
Sep 17, 2026
Merged

beinan merged 1 commit into
lance-format:mainfrom
YangjunZ:2026-09-17_lance-context_publish-lockfile

Conversation

@YangjunZ

Copy link
Copy Markdown
Contributor

Summary

Fix the dependency-resolution failure in the x86_64 sdist build of #253 (failed run), independently of its wheel-size fix.

  • Remove the obsolete python/Cargo.lock. Python is a member of the root workspace, but Maturin 1.15 prefers the nested lock when packaging. The resulting sdist contains python/Cargo.lock and no root lock, so Cargo resolves fresh dependencies from the extracted workspace.
  • Verify the sdist contains the exact workspace lock and no obsolete nested lock before uploading artifacts. Include packaging/lockfile changes in the PR workflow trigger.
  • Document why --locked is not a solution for the combined --sdist build: Maturin removes unused workspace members, requiring Cargo to prune their lock entries.

The failed build selected aws-smithy-types 1.7.0 with aws-smithy-json 0.63.0 and failed with E0308/E0004. The repaired sdist retains the checked-in 1.4.9 / 0.62.7 versions. No dependency upgrades or runtime-code changes; most deleted lines are the unused generated lockfile.

Validation

  • Reproduced the old archive with Maturin 1.15.0 and confirmed the workspace lock is missing.
  • Rebuilt the archive after removing the nested lock: packaged root lock matches the checked-in file byte-for-byte.
  • Ran Cargo metadata resolution offline from the extracted archive: no package versions added or upgraded; only unused workspace packages/features pruned.
  • Built a real macOS ARM64 native wheel from the repaired sdist with maturin build --sdist --strip --offline (debug profile). Imported that wheel and exercised Datagen append, item/root history and folded codec metadata.
  • Executed the exact workflow guard against six cases: valid, missing root lock, stale root lock, nested lock, empty directory and multiple source archives. Also checked the real before/after sdists.
  • Actionlint and git diff --check passed. No pre-commit configuration/hook is installed in this checkout.

Linux release builds still need CI verification. This complements rather than replaces #253's stripping/size gate. No publishing was triggered, and the already-published v0.6.6 macOS artifact must not be replaced by the locally rebuilt wheel.

🤖 Generated with MAI Agents

Remove the obsolete nested Cargo.lock that makes maturin omit the root workspace lock. Check the packaged lock before uploading artifacts and cover packaging inputs in the publishing PR trigger. Keep the existing build commands compatible with workspace pruning in sdist builds.

Generated with MAI Agents: https://github.com/infinity-microsoft/mai-agents

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a563b220-9ce6-4724-97e4-601ec8ffd89a
@beinan
beinan marked this pull request as ready for review September 17, 2026 19:38
@beinan
beinan merged commit dd39999 into lance-format:main Sep 17, 2026
9 checks passed
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.

2 participants