Skip to content
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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 30 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ hwlib/debian/hwlib/
cargo_home
.cargo-checksum.json
vendor/
rust-vendor/
__pycache__/

# In a workspace, packages should share the same Cargo.lock file.
Expand Down
2 changes: 1 addition & 1 deletion client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Then you need to vendor the Rust dependencies:
```

`dh-cargo` requires the `debian/cargo-checksum.json` file to be present in the archive. Until the package
is not published to crates.io, we need to generate it manually:
is not published to crates.io, we need to generate it ourselves:

```bash
# under client/hwlib/ dir
Expand Down
2 changes: 1 addition & 1 deletion client/hwlib/debian/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
directory = "rust-vendor"
Copy link
Collaborator

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.

1 change: 1 addition & 0 deletions client/hwlib/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Build-Depends: debhelper (>= 12),
Maintainer: Canonical Hardware Certification <canonical-hw-cert@lists.launchpad.net>
Uploaders: Nadzeya Hutsko <nadzeya.hutsko@canonical.com>
Standards-Version: 4.6.2
XS-Vendored-Sources-Rust: addr2line@0.24.2, adler2@2.0.0, aho-corasick@1.1.3, anyhow@1.0.89, atomic-waker@1.1.2, autocfg@1.4.0, backtrace@0.3.74, base64@0.22.1, bitflags@2.6.0, bumpalo@3.16.0, bytes@1.7.2, cc@1.1.28, cfg-if@1.0.0, core-foundation-sys@0.8.7, core-foundation@0.10.0, core-foundation@0.9.4, deranged@0.3.11, either@1.13.0, encoding_rs@0.8.34, equivalent@1.0.1, errno@0.3.9, fastrand@2.1.1, fnv@1.0.7, foreign-types-shared@0.1.1, foreign-types@0.3.2, form_urlencoded@1.2.1, futures-channel@0.3.31, futures-core@0.3.31, futures-sink@0.3.31, futures-task@0.3.31, futures-util@0.3.31, getopts@0.2.21, getrandom@0.2.15, gimli@0.31.1, h2@0.4.6, hashbrown@0.15.0, heck@0.5.0, hermit-abi@0.3.9, http-body-util@0.1.2, http-body@1.0.1, http@1.1.0, httparse@1.9.5, hyper-rustls@0.27.3, hyper-tls@0.6.0, hyper-util@0.1.9, hyper@1.4.1, idna@0.5.0, indexmap@2.6.0, indoc@2.0.5, io-kit-sys@0.4.1, ipnet@2.10.1, itertools@0.13.0, itoa@1.0.11, js-sys@0.3.70, lazy_static@1.5.0, libc@0.2.159, linux-raw-sys@0.4.14, log@0.4.22, mach2@0.4.2, memchr@2.7.4, memoffset@0.9.1, mime@0.3.17, miniz_oxide@0.8.0, mio@1.0.2, native-tls@0.2.12, num-conv@0.1.0, object@0.36.5, once_cell@1.20.2, openssl-macros@0.1.1, openssl-probe@0.1.5, openssl-sys@0.9.103, openssl@0.10.66, percent-encoding@2.3.1, pin-project-lite@0.2.14, pin-utils@0.1.0, pkg-config@0.3.31, portable-atomic@1.9.0, powerfmt@0.2.0, proc-macro2@1.0.87, pyo3-build-config@0.22.3, pyo3-ffi@0.22.3, pyo3-macros-backend@0.22.3, pyo3-macros@0.22.3, pyo3@0.22.3, quote@1.0.37, regex-automata@0.4.8, regex-syntax@0.8.5, regex@1.11.0, reqwest@0.12.8, ring@0.17.8, rustc-demangle@0.1.24, rustix@0.38.37, rustls-pemfile@2.2.0, rustls-pki-types@1.9.0, rustls-webpki@0.102.8, rustls@0.23.14, ryu@1.0.18, schannel@0.1.26, security-framework-sys@2.12.0, security-framework@2.11.1, serde@1.0.210, serde_derive@1.0.210, serde_json@1.0.128, serde_urlencoded@0.7.1, shlex@1.3.0, slab@0.4.9, smallvec@1.13.2, smbios-lib@0.9.2, socket2@0.5.7, spin@0.9.8, subtle@2.6.1, syn@2.0.79, sync_wrapper@1.0.1, system-configuration-sys@0.6.0, system-configuration@0.6.1, target-lexicon@0.12.16, tempfile@3.13.0, time-core@0.1.2, time-macros@0.2.18, time@0.3.36, tinyvec@1.8.0, tinyvec_macros@0.1.1, tokio-macros@2.4.0, tokio-native-tls@0.3.1, tokio-rustls@0.26.0, tokio-util@0.7.12, tokio@1.40.0, tower-service@0.3.3, tracing-core@0.1.32, tracing@0.1.40, try-lock@0.2.5, unicode-bidi@0.3.17, unicode-ident@1.0.13, unicode-normalization@0.1.24, unicode-width@0.1.14, unindent@0.2.3, untrusted@0.9.0, url@2.5.2, vcpkg@0.2.15, want@0.3.1, wasi@0.11.0+wasi-snapshot-preview1, wasm-bindgen-backend@0.2.93, wasm-bindgen-futures@0.4.43, wasm-bindgen-macro-support@0.2.93, wasm-bindgen-macro@0.2.93, wasm-bindgen-shared@0.2.93, wasm-bindgen@0.2.93, web-sys@0.3.70, windows-registry@0.2.0, windows-result@0.2.0, windows-strings@0.1.0, windows-sys@0.52.0, windows-sys@0.59.0, windows-targets@0.52.6, windows_aarch64_gnullvm@0.52.6, windows_aarch64_msvc@0.52.6, windows_i686_gnu@0.52.6, windows_i686_gnullvm@0.52.6, windows_i686_msvc@0.52.6, windows_x86_64_gnu@0.52.6, windows_x86_64_gnullvm@0.52.6, windows_x86_64_msvc@0.52.6, zeroize@1.8.1
nadzyah marked this conversation as resolved.
Show resolved Hide resolved
Vcs-Git: https://github.com/canonical/hardware-api.git [client/hwlib/src]
Vcs-Browser: https://github.com/canonical/hardware-api/tree/main/client/hwlib/src
Homepage: https://github.com/canonical/hardware-api
Expand Down
2 changes: 1 addition & 1 deletion client/hwlib/debian/generate_checksums.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


# Directories to exclude from the root dir
DIRS_TO_EXCLUDE = ["debian", "vendor"]
DIRS_TO_EXCLUDE = ["debian", "rust-vendor"]


def calculate_sha256sum(file_path):
Expand Down
1 change: 1 addition & 0 deletions client/hwlib/debian/rules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/make -f

export CARGO_HOME=$(CURDIR)/debian/
export CARGO_VENDOR_DIR=$(CURDIR)/rust-vendor/

%:
dh $@ --buildsystem cargo
Expand Down
4 changes: 2 additions & 2 deletions client/hwlib/debian/tests/control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Test-Command: /usr/share/cargo/bin/cargo-auto-test hwlib 0.0.1-ppa1 --all-targets --all-features
Test-Command: debian/tests/run-tests.sh
Features: test-name=rust-hwlib:@
Depends: dh-cargo (>= 23), cargo, rustc, libssl-dev, pkg-config, @
Depends: @builddeps@
Restrictions: allow-stderr
20 changes: 20 additions & 0 deletions client/hwlib/debian/tests/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
nadzyah marked this conversation as resolved.
Show resolved Hide resolved

nadzyah marked this conversation as resolved.
Show resolved Hide resolved
# Create cargo config directory
mkdir -p /tmp/.cargo
nadzyah marked this conversation as resolved.
Show resolved Hide resolved

# Create config.toml
cat > /tmp/.cargo/config.toml << EOL
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "/tmp/vendor"
EOL

# Run the actual test
ls -la
pwd
CARGO_HOME=/tmp cargo test --offline \
--manifest-path ../../Cargo.toml \
--all-targets --all-features
5 changes: 4 additions & 1 deletion client/hwlib/debian/vendor-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Reference: https://github.com/ubuntu/authd/blob/86d9d82/debian/vendor-rust.sh
set -eu

CARGO_VENDOR_DIR="${CARGO_VENDOR_DIR:-vendor}"
CARGO_VENDOR_DIR="${CARGO_VENDOR_DIR:-rust-vendor}"

# We need a filtered vendored directory
if [ ! $(which cargo-vendor-filterer) ]; then
Expand All @@ -11,6 +11,9 @@ if [ ! $(which cargo-vendor-filterer) ]; then
exit 3
fi

[ -e /usr/bin/jq ] || (echo "jq is required to run this script. Try installing it with 'sudo apt install jq'" && exit 1);
nadzyah marked this conversation as resolved.
Show resolved Hide resolved


cargo vendor-filterer "$CARGO_VENDOR_DIR"

# Delete .sh and .a files in the vendor/vcpkg directory if it exists
Expand Down
50 changes: 25 additions & 25 deletions server/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.