From 130c9d31f806d0eca886715c86183946aab1ebdd Mon Sep 17 00:00:00 2001 From: Jesper Brynolf Date: Sat, 8 Nov 2025 21:23:28 +0100 Subject: [PATCH] Updates the documentation regarding the bundled feature. Signed-off-by: Jesper Brynolf --- tss-esapi-sys/README.md | 12 ++++++++---- tss-esapi-sys/build.rs | 6 ++---- tss-esapi/README.md | 5 +++++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/tss-esapi-sys/README.md b/tss-esapi-sys/README.md index 82782436..8bdda2d1 100644 --- a/tss-esapi-sys/README.md +++ b/tss-esapi-sys/README.md @@ -18,8 +18,8 @@ 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 `4.1.3` is -required for all of them. +`tss2-sys`, `tss2-esys`, `tss2-tctildr` and `tss2-mu`. A minimum version of `4.1.3` is +required for all of them. On windows `tss2-tcti-tbs` is also required. Having installed the open-source implementation libraries at `/usr/local/lib` (by default), it might happen that `pkg-config` can not find them. Run the following command if that is the @@ -51,8 +51,12 @@ environment variable `TPM_TSS_SOURCE_PATH` or it will be retrieved from Github during the build. The version to retrieve can be controlled by setting the `TPM2_TSS_SOURCE_VERSION` environment variable. [!IMPORTANT] -On windows it might be necessary to manually create the VERSION file -when a local source is being used. +* The `bundled` feature will make it possible to build the crate without + having to worry about the `tpm2-tss` library dependencies. But it is still + necessary to make the shared libraries available to the executable that uses + the library. +* On Windows it might be necessary to manually create the `VERSION` file + when a local source is being used. To enable this feature: diff --git a/tss-esapi-sys/build.rs b/tss-esapi-sys/build.rs index 33478c6e..5d603585 100644 --- a/tss-esapi-sys/build.rs +++ b/tss-esapi-sys/build.rs @@ -869,10 +869,8 @@ pub mod tpm2_tss { "release" => "Release", _ => panic!("Unknown cargo profile: {}", profile), }; - println!( - "cargo:rustc-link-search=dylib={}", - _source_path.join("x64").join(build_string).display() - ); + let lib_out_path: PathBuf = _source_path.join("x64").join(build_string); + println!("cargo:rustc-link-search=all={}", lib_out_path.display()); } } } diff --git a/tss-esapi/README.md b/tss-esapi/README.md index 8edfd434..3ee4a12b 100644 --- a/tss-esapi/README.md +++ b/tss-esapi/README.md @@ -35,6 +35,11 @@ The crate currently offers the following features: * `rustcrypto-full` (disabled by default) - provides conversion from all supported elliptic curves, rsa or hashes. Support for individual hash, rsa or curves can be pulled individually. +* `bundled` - Downloads, builds and dynamically links against the tpm2-tss libraries. + This means that the executable using the crate needs to have the tpm2-tss shared + libraries available to the executable. This can be achieved by copying the shared libraries + to the same folder as the executable or by adding the path to them to the appropriate environmental + variable e.g. `LD_LIBRARY_PATH`, `DYLD_FALLBACK_LIBRARY_PATH` or `PATH`. ## Cross compiling