parallaxsecond / rust-tss-esapi

TSS 2.0 Enhanced System API (ESAPI) Rust wrapper
https://docs.rs/tss-esapi/
Apache License 2.0
86 stars 51 forks source link

Adds support for non pkg-config tpm2-tss installs. #477

Closed Superhepper closed 5 months ago

Superhepper commented 9 months ago

This adds support for specifying an install path of tpm2-tss libraries and header files in order to make it possible to build crate without having to relay on pkg-config.

wiktor-k commented 9 months ago

Very interesting development!

By the way Github supports windows CI runners so maybe it would be useful to at least run cargo build there?

Superhepper commented 9 months ago

Yeah this is just a test. I would really like to be able run the tests before committing anything.

Superhepper commented 5 months ago

Very interesting development!

By the way Github supports windows CI runners so maybe it would be useful to at least run cargo build there?

If you would have any idea how to set that up I would be really happy to add that.

wiktor-k commented 5 months ago

I've just recently added it to my other crate, maybe you can take a look here: https://github.com/wiktor-k/ssh-agent-lib/blob/main/.github/workflows/ci.yml#L58

I'm using matrix there to build on several OSes at once but you can just use windows-latest to write a job for windows only.

You might have to use vcpkg for tss libs (I'm not an expert in this matter) like openssl bindings do: https://github.com/sfackler/rust-openssl/blob/master/.github/workflows/ci.yml#L95

Hope this helps!

Superhepper commented 5 months ago

I've just recently added it to my other crate, maybe you can take a look here: https://github.com/wiktor-k/ssh-agent-lib/blob/main/.github/workflows/ci.yml#L58

I'm using matrix there to build on several OSes at once but you can just use windows-latest to write a job for windows only.

You might have to use vcpkg for tss libs (I'm not an expert in this matter) like openssl bindings do: https://github.com/sfackler/rust-openssl/blob/master/.github/workflows/ci.yml#L95

Hope this helps!

Unfortunately tpm2-tss did not have a vcpkg. Will have to explore other options.

wiktor-k commented 5 months ago

Oh, that's too bad. I see people are struggling with compilation on Windows: https://github.com/tpm2-software/tpm2-tss/issues/1828 but maybe you'll find a way :crossed_fingers:

Superhepper commented 5 months ago

I have already compiled tpm2-tss on my computer(Windows) and got the tests of the crate to run. They fail because I have no simulator but they run.

wiktor-k commented 5 months ago

Wow, that's great! Given that the simulator has ms in its name I guess this is just a matter of time. For the record I've also had slight "problems" with running integration tests on Windows: https://github.com/wiktor-k/ssh-agent-lib/pull/25/files#diff-b1a180c7db3d68d63c6a33ea491b590c09cca209c930eae52c1f6dae2b00768e

:wave:

wiktor-k commented 5 months ago

It looks good on a quick look. Is there a plan to add a windows target that at least builds it and checks that it doesn't regress?

I've seen people commenting on how to build it and such a CI config would be one place to point them... :thinking:

Superhepper commented 5 months ago

@wiktor-k I have it on my list of things I want to improve. But I have found no way of accomplishing it. So I am going to create a ticket for it and if some Windows savvy github actions enthusiast could take a look at it. It would be great.