Skip to content

Commit 97ccc11

Browse files
authored
Merge pull request #544 from Superhepper/rust-2021-edition
Dependency Update
2 parents 1d8337c + 8533d67 commit 97ccc11

20 files changed

+4857
-9635
lines changed

.clippy.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.66.0"
1+
msrv = "1.74.0"

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Build the container
3232
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
3333
- name: Run the container
34-
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.66.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
34+
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.74.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
3535
# All in one job as I think it is a big overhead to build and run the Docker
3636
# container?
3737
tests-ubuntu:
@@ -52,7 +52,7 @@ jobs:
5252
steps:
5353
- uses: actions/checkout@v2
5454
- name: Build the container
55-
run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=4.0.1 --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
55+
run: docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=4.1.3 --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
5656
- name: Run the container
5757
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/all-ubuntu.sh
5858

@@ -118,6 +118,6 @@ jobs:
118118
- name: Build the container
119119
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tss
120120
- name: Check Clippy lints MSRV
121-
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.66.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh
121+
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi --env RUST_TOOLCHAIN_VERSION=1.74.0 ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh
122122
- name: Check Clippy lints latest
123123
run: docker run -v $(pwd):/tmp/rust-tss-esapi -w /tmp/rust-tss-esapi/tss-esapi ubuntucontainer /tmp/rust-tss-esapi/tss-esapi/tests/lint-checks.sh

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[workspace]
2-
members = ["tss-esapi", "tss-esapi-sys"]
32
resolver = "2"
3+
members = ["tss-esapi", "tss-esapi-sys"]

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ At the moment we test (via CI) and support the following Rust compiler versions:
99

1010
* On Ubuntu we test with:
1111
- The latest stable compiler version, as accessible through `rustup`.
12-
- The 1.66 compiler version.
13-
* On Fedora we test with the compiler version included with the Fedora 36 release.
12+
- The 1.74.0 compiler version.
13+
* On Fedora we test with the compiler version included with the Fedora 38 release.
1414
* On Fedora rawhide we test with the compiler version included.
1515

1616
If you need support for other versions of the compiler, get in touch with us to see what we can do!

tss-esapi-sys/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "tss-esapi-sys"
33
version = "0.5.0"
44
authors = ["Parsec Project Contributors"]
5-
edition = "2018"
5+
edition = "2021"
66
description = "FFI wrapper around TSS 2.0 Enhanced System API"
77
readme = "README.md"
88
keywords = ["tpm", "tss", "esys", "esapi"]
@@ -11,10 +11,10 @@ license = "Apache-2.0"
1111
repository = "https://github.com/parallaxsecond/rust-tss-esapi"
1212
documentation = "https://docs.rs/crate/tss-esapi-sys"
1313
links = "tss2-esys"
14-
rust-version = "1.66.0"
14+
rust-version = "1.74.0"
1515

1616
[build-dependencies]
17-
bindgen = { version = "0.66.1", optional = true }
17+
bindgen = { version = "0.70.1", optional = true }
1818
pkg-config = "0.3.18"
1919
target-lexicon = "0.12.0"
2020
cfg-if = "1.0.0"

tss-esapi-sys/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ must therefore link to all of them at build time.
1818

1919
The paths to the libraries are discovered using `pkg-config` - make sure they
2020
are discoverable in this way on your system. Our build script looks for
21-
`tss2-esys`, `tss2-tctildr` and `tss2-mu`. A minimum version of `3.2.2` is
21+
`tss2-esys`, `tss2-tctildr` and `tss2-mu`. A minimum version of `4.0.1` is
2222
required for all of them.
2323

2424
Having installed the open-source implementation libraries at `/usr/local/lib` (by default), it

tss-esapi-sys/build.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,20 @@ pub mod tpm2_tss {
5353
fs::read_dir,
5454
path::{Path, PathBuf},
5555
};
56-
const MINIMUM_VERSION: &str = "3.2.2";
56+
const MINIMUM_VERSION: &str = "4.0.1";
5757
const PATH_ENV_VAR_NAME: &str = "TPM2_TSS_PATH";
5858

5959
/// The installed tpm2-tss libraries that are of
6060
/// interest.
6161
pub struct Installation {
6262
_tss2_sys: Library,
63+
#[allow(unused)]
6364
tss2_esys: Library,
65+
#[allow(unused)]
6466
tss2_tctildr: Library,
67+
#[allow(unused)]
6568
tss2_mu: Library,
69+
#[allow(unused)]
6670
tss2_tcti_tbs: Option<Library>,
6771
}
6872

@@ -119,6 +123,7 @@ pub mod tpm2_tss {
119123
fn bindgen_builder(&self) -> bindgen::Builder {
120124
let mut builder = bindgen::Builder::default()
121125
.size_t_is_usize(false)
126+
.rust_target(bindgen::RustTarget::Stable_1_73) // lower or equal to MSRV.
122127
.clang_arg(self.tss2_esys.include_dir_arg())
123128
.clang_arg(self.tss2_tctildr.include_dir_arg())
124129
.clang_arg(self.tss2_mu.include_dir_arg())
@@ -261,8 +266,10 @@ pub mod tpm2_tss {
261266

262267
/// Struct holding the information for a library.
263268
struct Library {
269+
#[allow(unused)]
264270
header_file: Option<PathBuf>,
265271
version: String,
272+
#[allow(unused)]
266273
name: String,
267274
}
268275

@@ -333,6 +340,7 @@ pub mod tpm2_tss {
333340
/// - If the library was probe without requiring header files.
334341
/// - If the library specifies a header file does not have a parent directory.
335342
/// - If the library specifies a header file path that contain invalid utf-8 characters.
343+
#[allow(unused)]
336344
pub fn include_dir_arg(&self) -> String {
337345
self.header_file
338346
.as_ref()
@@ -356,6 +364,7 @@ pub mod tpm2_tss {
356364
///
357365
/// # Panics
358366
/// - If the library specifies a header file path that contain invalid utf-8 characters.
367+
#[allow(unused)]
359368
pub fn header_file_arg(&self) -> &str {
360369
self.header_file.as_ref().map_or_else(
361370
|| {

tss-esapi-sys/regenerate-bindings.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set -euf -o pipefail
1111
OPENSSL_GIT="https://github.com/openssl/openssl.git"
1212
OPENSSL_VERSION="OpenSSL_1_1_1j"
1313
TPM2_TSS_GIT="https://github.com/tpm2-software/tpm2-tss.git"
14-
TPM2_TSS_VERSION="3.2.2"
14+
TPM2_TSS_VERSION="4.0.1"
1515

1616
export SYSROOT="/tmp/sysroot"
1717

@@ -48,7 +48,7 @@ cross-compile-openssl() {
4848
cross-compile-tpm2-tss() {
4949
pushd /tmp/tpm2-tss
5050
[ ! -f configure ] && ./bootstrap
51-
./configure --enable-fapi=no --prefix=/ --build=x86_64-pc-linux-gnu --host=$1 --target=$1 CC=$1-gcc
51+
./configure --disable-fapi --disable-policy --prefix=/ --build=x86_64-pc-linux-gnu --host=$1 --target=$1 CC=$1-gcc
5252
make clean
5353
make -j$(nproc)
5454
make DESTDIR="$SYSROOT" install

0 commit comments

Comments
 (0)