Skip to content

Commit

Permalink
Merge pull request parallaxsecond#544 from Superhepper/rust-2021-edition
Browse files Browse the repository at this point in the history
Dependency Update
  • Loading branch information
Superhepper authored Sep 25, 2024
2 parents 1d8337c + 8533d67 commit 97ccc11
Show file tree
Hide file tree
Showing 20 changed files with 4,857 additions and 9,635 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.66.0"
msrv = "1.74.0"
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tools
- name: Run the container
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
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
# All in one job as I think it is a big overhead to build and run the Docker
# container?
tests-ubuntu:
Expand All @@ -52,7 +52,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build the container
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
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
- name: Run the container
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

Expand Down Expand Up @@ -118,6 +118,6 @@ jobs:
- name: Build the container
run: docker build -t ubuntucontainer tss-esapi/tests/ --file tss-esapi/tests/Dockerfile-ubuntu --target tpm2-tss
- name: Check Clippy lints MSRV
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
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
- name: Check Clippy lints latest
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
members = ["tss-esapi", "tss-esapi-sys"]
resolver = "2"
members = ["tss-esapi", "tss-esapi-sys"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ At the moment we test (via CI) and support the following Rust compiler versions:

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

If you need support for other versions of the compiler, get in touch with us to see what we can do!
Expand Down
6 changes: 3 additions & 3 deletions tss-esapi-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "tss-esapi-sys"
version = "0.5.0"
authors = ["Parsec Project Contributors"]
edition = "2018"
edition = "2021"
description = "FFI wrapper around TSS 2.0 Enhanced System API"
readme = "README.md"
keywords = ["tpm", "tss", "esys", "esapi"]
Expand All @@ -11,10 +11,10 @@ license = "Apache-2.0"
repository = "https://github.com/parallaxsecond/rust-tss-esapi"
documentation = "https://docs.rs/crate/tss-esapi-sys"
links = "tss2-esys"
rust-version = "1.66.0"
rust-version = "1.74.0"

[build-dependencies]
bindgen = { version = "0.66.1", optional = true }
bindgen = { version = "0.70.1", optional = true }
pkg-config = "0.3.18"
target-lexicon = "0.12.0"
cfg-if = "1.0.0"
Expand Down
2 changes: 1 addition & 1 deletion tss-esapi-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ must therefore link to all of them at build time.

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

Having installed the open-source implementation libraries at `/usr/local/lib` (by default), it
Expand Down
11 changes: 10 additions & 1 deletion tss-esapi-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,20 @@ pub mod tpm2_tss {
fs::read_dir,
path::{Path, PathBuf},
};
const MINIMUM_VERSION: &str = "3.2.2";
const MINIMUM_VERSION: &str = "4.0.1";
const PATH_ENV_VAR_NAME: &str = "TPM2_TSS_PATH";

/// The installed tpm2-tss libraries that are of
/// interest.
pub struct Installation {
_tss2_sys: Library,
#[allow(unused)]
tss2_esys: Library,
#[allow(unused)]
tss2_tctildr: Library,
#[allow(unused)]
tss2_mu: Library,
#[allow(unused)]
tss2_tcti_tbs: Option<Library>,
}

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

/// Struct holding the information for a library.
struct Library {
#[allow(unused)]
header_file: Option<PathBuf>,
version: String,
#[allow(unused)]
name: String,
}

Expand Down Expand Up @@ -333,6 +340,7 @@ pub mod tpm2_tss {
/// - If the library was probe without requiring header files.
/// - If the library specifies a header file does not have a parent directory.
/// - If the library specifies a header file path that contain invalid utf-8 characters.
#[allow(unused)]
pub fn include_dir_arg(&self) -> String {
self.header_file
.as_ref()
Expand All @@ -356,6 +364,7 @@ pub mod tpm2_tss {
///
/// # Panics
/// - If the library specifies a header file path that contain invalid utf-8 characters.
#[allow(unused)]
pub fn header_file_arg(&self) -> &str {
self.header_file.as_ref().map_or_else(
|| {
Expand Down
4 changes: 2 additions & 2 deletions tss-esapi-sys/regenerate-bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -euf -o pipefail
OPENSSL_GIT="https://github.com/openssl/openssl.git"
OPENSSL_VERSION="OpenSSL_1_1_1j"
TPM2_TSS_GIT="https://github.com/tpm2-software/tpm2-tss.git"
TPM2_TSS_VERSION="3.2.2"
TPM2_TSS_VERSION="4.0.1"

export SYSROOT="/tmp/sysroot"

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

0 comments on commit 97ccc11

Please sign in to comment.