-
Notifications
You must be signed in to change notification settings - Fork 64
Sanitize tss version number too #604
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
base: main
Are you sure you want to change the base?
Conversation
… of the version still has to match
9ae4929 to
bdd2e39
Compare
|
I am not against this. But I would like for the sanitize of the TSS version to be opt-in by using environment variable or by some other means. |
okay, that sounds okay to me. |
|
Every other environment variable that has to deal with tpm2-tss is named something with TPM2_TSS_*. So something like Interesting I tried to build it with static linkage when I finished bundled. But it a bit more complicated so I left it for the future. But if it would be possible to have static linkage on all platforms I think that would be great. |
|
--------
Jesper Brynolf ***@***.***> wrote:
Interesting I tried to build it with static linkage when I finished
bundled. But it a bit more complicated so I left it for the future. But
if it would be possible to have static linkage on all platforms I think
that would be great.
Both swtpm and libtss need a few small patches to build completely
statically.
|
| .expect("Failed to parse the DEP_TSS2_ESYS_VERSION variable as a semver version") | ||
| }; | ||
|
|
||
| // nuke any prerelease info, which probably is just a git repo/dirty flag |
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.
Move this inside the else block and do something like this instead
const TPM2_TSS_ALLOW_PRE_VERSION_NAME: &str = "TPM2_TSS_<Some Env var name>";
.
.
.
Version::parse(&tss_version_string)
.map(|mut v| {
if std::env::var(TPM2_TSS_ALLOW_PRE_VERSION_NAME).is_ok() {
v.pre = Prerelease::EMPTY;
}
v
})
.expect("Failed to parse the DEP_TSS2_ESYS_VERSION variable as a semver version")
This replaces PR #578.
It is rebased after ther DOCS_RS changes.
Without this patch, the version number does not parse with VersionReq::parse.
(This depends upon #603, please merge that first)