Skip to content

feat: vendor dependencies of rust packages #87

Open
kgilmer wants to merge 8 commits intomainfrom
feat/auto-vendor-rust
Open

feat: vendor dependencies of rust packages #87
kgilmer wants to merge 8 commits intomainfrom
feat/auto-vendor-rust

Conversation

@kgilmer
Copy link
Copy Markdown
Member

@kgilmer kgilmer commented Feb 16, 2025

Using vendoring technique described at https://blog.shadura.me/2020/12/22/vendoring-rust-in-debian-derivative/

This change is to enable building/packaging Rust programs that do not have (all) dependencies already in Debian. This will cause cargo to dowload all dependency source and provide it to the Debian builder's version of the cargo repo.

@kgilmer kgilmer requested a review from khos2ow February 16, 2025 23:27
@kgilmer
Copy link
Copy Markdown
Member Author

kgilmer commented Feb 16, 2025

This package/branch should be buildable against this PR: https://github.com/kgilmer/elbey/tree/experiment/vendored-debian-pkg

@kgilmer
Copy link
Copy Markdown
Member Author

kgilmer commented Feb 17, 2025

@kgilmer
Copy link
Copy Markdown
Member Author

kgilmer commented Feb 17, 2025

I want to change the detection to presence of the cargo checksum file, other cleanup

@kgilmer
Copy link
Copy Markdown
Member Author

kgilmer commented Feb 26, 2025

this is ready for a pass when you have time @khos2ow

Copy link
Copy Markdown
Member

@khos2ow khos2ow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have completely missed this PR!! Sorry. A question below, otherwise LGTM, in terms of the green pipeline.

[ -d vendor ] && rm -rf vendor
rm -rf Cargo.lock || true
cargo vendor
tar Jcf ../${debian_package_name}_${debian_version}.orig-vendor.tar.xz vendor/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, in the blog post, that new stanza is added in rules, but I don't get how does this tarball being used? Do we also need to push this tarball to deb archive?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature requires an integration on the package side. In the build script of a rust package we'd like to "autovendor", we update the cargo configuration to include the packages. See here for the example that was tested:

https://github.com/kgilmer/elbey/pull/12/files#diff-889c5495b68d2a0c0d1f238818716a71939918499efbc0fc6d2994319624fc67R13

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some basic docs, please LMK if there is still ambiguity or questions

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