-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update debian folder for hwlib client to follow the recent MIR policy #209
base: main
Are you sure you want to change the base?
Conversation
* Add CARGO_VENDOR_DIR env variable to the rules file * Add XS-Vendored-Sources-Rust header to the debian/control file (see https://github.com/ubuntu/authd/blob/c6bb3bd/debian/control#L22 as reference)
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments inline.
My suggestions for the whole structure is to split/recombine some patches so things like touching .lock files is done only once, and that related changes, like rust-vendor are done in one patch.
Overall it looks okay. Does autopkgtest pass? :)
@@ -9,12 +9,8 @@ cat > /tmp/.cargo/config.toml << EOL | |||
replace-with = "vendored-sources" | |||
[source.vendored-sources] | |||
directory = "/tmp/vendor" | |||
directory = "$(pwd)/rust-vendor" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be combined with the other patch that touches the same path?
@@ -5,4 +5,4 @@ | |||
replace-with = "vendored-sources" | |||
|
|||
[source.vendored-sources] | |||
directory = "vendor" | |||
directory = "rust-vendor" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this also belongs with the other patches that touch rust-vendor.
@zyga Sure, the links were added to the PR description, you can check them to make sure the tests pass |
…apping in README.md-s
This PR resolves C3-777. The key changes include the following:
Added autopkgtests to ensure proper validation of the Rust library.
Included a README.source file as per packaging guidelines:
Updated
debian/rules
with theCARGO_VENDOR_DIR
environment variable and added theXS-Vendored-Sources-Rust
header to thedebian/control
file for proper vendoring of dependencies.Changed the vendor folder name from
vendor/
torust-vendor/
to follow the ubuntu-mir Rust policyI also updated the
debian/changelog
file to prepare the package updated version0.0.1~ppa2
for publishing to the hwcert ppa.autopkgtests
The autopkgtests are designed to run the existing Rust tests using the library after installation. While the Ubuntu MIR Rust policy does not provide explicit guidelines for writing autopkgtests for Rust packages with vendoring, it references ubuntu/authd as an example of how vendoring can be implemented in tests. I adopted a similar approach to write the autopkgtests, following the model outlined in this example.
Cargo vendoring changes
In accordance with the latest Ubuntu MIR Rust policy, the
CARGO_VENDOR_DIR
environment variable must be set indebian/rules
(see here). This informsdh-cargo
that vendored dependencies are in use. When this variable is set,dh-cargo
uses/usr/share/cargo/bin/dh-cargo-vendored-sources
to verify that the dependencies listed in theXS-Vendored-Sources-Rust
header in thedebian/control
file match the actual dependencies located inCARGO_VENDOR_DIR
. Consequently, theXS-Vendored-Sources-Rust
header has been added todebian/control
(as demonstrated in the authd example).Testing
The changes were verified in the testppa, and the build passes for all the supported architectures. The autopkgtests were run for this PPA with no failure, the results are available here:
• Log: https://autopkgtest.ubuntu.com/results/autopkgtest-oracular-nhutsko-testppa/oracular/amd64/r/rust-hwlib/20241009_142019_1d8df@/log.gz
• Log: https://autopkgtest.ubuntu.com/results/autopkgtest-oracular-nhutsko-testppa/oracular/arm64/r/rust-hwlib/20241009_142102_15418@/log.gz
• Log: https://autopkgtest.ubuntu.com/results/autopkgtest-oracular-nhutsko-testppa/oracular/armhf/r/rust-hwlib/20241009_142247_8decd@/log.gz
• Log: https://autopkgtest.ubuntu.com/results/autopkgtest-oracular-nhutsko-testppa/oracular/i386/r/rust-hwlib/20241009_141936_ea055@/log.gz
• Log: https://autopkgtest.ubuntu.com/results/autopkgtest-oracular-nhutsko-testppa/oracular/s390x/r/rust-hwlib/20241009_142045_e9a5c@/log.gz