-
Notifications
You must be signed in to change notification settings - Fork 53
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
Adds support for non pkg-config tpm2-tss installs. #477
Conversation
5c31929
to
cef6a40
Compare
Very interesting development! By the way Github supports windows CI runners so maybe it would be useful to at least run |
Yeah this is just a test. I would really like to be able run the tests before committing anything. |
6e7cfcb
to
89a476e
Compare
89a476e
to
1c17a57
Compare
c80915e
to
5bf565c
Compare
Wow, that's great! Given that the simulator has 👋 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's quite a complicated build file, I'm surprised something like it doesn't exist more generally..
Thanks for the patch!
//See this issue: https://github.com/parallaxsecond/rust-cryptoki/issues/12 | ||
.generate_comments(false) | ||
.blocklist_type("max_align_t") | ||
// Needed for windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the issue here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you compile under windows ( I used msvc 2022) you get a lot of errors of structs that it some how thinks are needed but not available probably due to it importing "windows.h" or something. So I just blocked everything that caused an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant when you generate the bindings on a windows machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you compile under windows ( I used msvc 2022) you get a lot of errors of structs that it some how thinks are needed but not available probably due to it importing "windows.h" or something.
I wonder if WIN32_LEAN_AND_MEAN
would help here... (note that I'm no C/C++ dev so this may be wildly wrong)...
- Adds support for specifying path to the tpm2-tss libraries and header files using the environment variable ```TPM2_TSS_PATH```. The specified path is expected to have the following layout: | -> <Specified path> | | -> include | | -> tss2 | | -> tss2_esys.h | | | -> lib | | -> tss2_esys.lib (or .so) Signed-off-by: Jesper Brynolf <[email protected]>
let min_version_req = VersionReq::parse(&min_version_req_str).unwrap_or_else(|e| { | ||
panic!( | ||
"[Internal Error]: Failed to parse minimum tpm2-tss library version \ | ||
requirement. Error: `{}`. Please report this.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the "Please report this" bit, we should do it more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
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... 🤔 |
@wiktor-k |
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-author: Thomas Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-author: Thomas Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-author: Thomas Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-author: Thomas Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-author: Thomas Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-author: Thomas Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-author: Thomas Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-author: Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-authored-by: Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-authored-by: Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
When parallaxsecond#477 got merged it became possible to build using a path to the ```tpm2-tss``` installation instead of depending on ```pkg-config```. This made it possible to build under Windows. To further increase the support for the windows platform this commit moves the option for TBS TCTI that is being introduced in parallaxsecond#523 into a separate commit. This commit also updates the documentation regarding building using an installation folder. Co-authored-by: Thomas Epperson <[email protected]> Signed-off-by: Jesper Brynolf <[email protected]>
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.