Coder Social home page Coder Social logo

Comments (21)

Superhepper avatar Superhepper commented on August 17, 2024 1

Make serde an optional dependency.

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024 1

I'm not sure if it's tracked somewhere else independently but I had to use generate bindings feature to get the first alpha to compile in my crate: https://github.com/wiktor-k/tpm-box/blob/main/Cargo.toml#L18

It'd be nice to fix that before releasing 8.0.

That will probably be fixed when #505 is merged.

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024 1

Yup it is my mistake. Because I forgot to change a parameter in the test script that determines what flags to enable. So it will always generate bindings and never use the ones commited.\n\nWell... then it's quite funny because appending features = ["generate-bindings"], in my Cargo.toml makes it work on my end 😅

No, that is expected. Because in that PR all that is tested is that "generate-bindings" works. The code is never tested using the committed bindings due to my mistake.

from rust-tss-esapi.

tgonzalezorlandoarm avatar tgonzalezorlandoarm commented on August 17, 2024 1

@wiktor-k I'll take a look today :)

from rust-tss-esapi.

ionut-arm avatar ionut-arm commented on August 17, 2024 1

I'm adding a new task for the stabilization work: fixing the failing doc build.

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024

Increase minimum supported Rust version
Increase minimum supported tpm2-tss version (To at least 3.0 but ideally I would like to see something greater. Because this goes hand in hand with a the work with TpmsContext but it requires a type added in 3.1.0).

from rust-tss-esapi.

wiktor-k avatar wiktor-k commented on August 17, 2024

I'm not sure if it's tracked somewhere else independently but I had to use generate bindings feature to get the first alpha to compile in my crate: https://github.com/wiktor-k/tpm-box/blob/main/Cargo.toml#L18

It'd be nice to fix that before releasing 8.0.

from rust-tss-esapi.

wiktor-k avatar wiktor-k commented on August 17, 2024

That will probably be fixed when #505 is merged.

Hm... it doesn't seem so from my tests:

  1. clone tpm-box
  2. change the dep line to: tss-esapi={ version = "8.0.0-alpha", git ="https://github.com/parallaxsecond/rust-tss-esapi", rev = "refs/pull/505/head" }
  3. cargo check

It gives me:

    Checking tss-esapi v8.0.0-alpha (https://github.com/parallaxsecond/rust-tss-esapi?rev=refs/pull/505/head#1451c519)
error[E0432]: unresolved import `crate::tss2_esys::TPMU_SENSITIVE_CREATE`
   --> /home/wiktor/.cargo/git/checkouts/rust-tss-esapi-acac77377da9bd28/1451c51/tss-esapi/src/structures/buffers.rs:364:17
    |
364 |             use crate::tss2_esys::TPMU_SENSITIVE_CREATE;
    |                 ^^^^^^^^^^^^^^^^^^---------------------
    |                 |                 |
    |                 |                 help: a similar name exists in the module: `TPMS_SENSITIVE_CREATE`
    |                 no `TPMU_SENSITIVE_CREATE` in the root

The commit referenced in the output is the same as in your PR... or maybe I'm holding it wrong somehow? 🤔

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024

Hrmm that is not what I expected. Well we can rather easily determine where the problem lies by looking at the generated code and see if the type exists.

from rust-tss-esapi.

wiktor-k avatar wiktor-k commented on August 17, 2024

It's interesting that the build works on the PR-level but fails here... totally not something I expected :/

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024

It can be that I made a mistake so it always generates the bindings even when it should not. I will have to look into this.

from rust-tss-esapi.

wiktor-k avatar wiktor-k commented on August 17, 2024

Thank you 🙏

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024

Yup it is my mistake. Because I forgot to change a parameter in the test script that determines what flags to enable. So it will always generate bindings and never use the ones commited.

from rust-tss-esapi.

wiktor-k avatar wiktor-k commented on August 17, 2024

Yup it is my mistake. Because I forgot to change a parameter in the test script that determines what flags to enable. So it will always generate bindings and never use the ones commited.

Well... then it's quite funny because appending features = ["generate-bindings"], in my Cargo.toml makes it work on my end 😅

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024

Yup it is my mistake. Because I forgot to change a parameter in the test script that determines what flags to enable. So it will always generate bindings and never use the ones commited.\n\nWell... then it's quite funny because appending features = ["generate-bindings"], in my Cargo.toml makes it work on my end 😅

No, that is expected. Because in that PR all that is tested is that "generate-bindings" works. The code is never tested using the committed bindings due to my mistake.

This should be fixed now. Please try again @wiktor-k

from rust-tss-esapi.

wiktor-k avatar wiktor-k commented on August 17, 2024

I've updated via cargo update:

Updating tss-esapi v8.0.0-alpha (https://github.com/parallaxsecond/rust-tss-esapi?rev=refs/pull/505/head#1451c519) -> #8ab0de2f
    Updating tss-esapi-sys v0.5.0 (https://github.com/parallaxsecond/rust-tss-esapi?rev=refs/pull/505/head#1451c519) -> #8ab0de2f

And it still fails:

error[E0432]: unresolved import `crate::tss2_esys::TPMU_SENSITIVE_CREATE`
   --> /home/wiktor/.cargo/git/checkouts/rust-tss-esapi-acac77377da9bd28/8ab0de2/tss-esapi/src/structures/buffers.rs:364:17
    |
364 |             use crate::tss2_esys::TPMU_SENSITIVE_CREATE;
    |                 ^^^^^^^^^^^^^^^^^^---------------------
    |                 |                 |
    |                 |                 help: a similar name exists in the module: `TPMS_SENSITIVE_CREATE`
    |                 no `TPMU_SENSITIVE_CREATE` in the root

Interesting that it's just a one letter "typo" (S <-> U). :/

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024

Hrmm I need to investigate this further. Why is this not failing in vi then. They use the committed bindings. What version is installed on the system you build?

from rust-tss-esapi.

wiktor-k avatar wiktor-k commented on August 17, 2024
$ pkg-config --modversion tss2-esys
4.0.1

Are you able to reproduce building tpm-box locally using these instructions? Maybe it's something on my end but previous versions worked fine 🤔

from rust-tss-esapi.

Superhepper avatar Superhepper commented on August 17, 2024

I am not sure when I will have time to look at it. But I will investigate.

from rust-tss-esapi.

wiktor-k avatar wiktor-k commented on August 17, 2024

I am not sure when I will have time to look at it. But I will investigate.

Wait a minute let me ask some people that for sure have plenty of time 😏 : @ionut-arm, @tgonzalezorlandoarm could you help check if you also get the same error as I do? Just follow this simple 3 step instruction: #495 (comment)

from rust-tss-esapi.

tgonzalezorlandoarm avatar tgonzalezorlandoarm commented on August 17, 2024

@wiktor-k @Superhepper

So, I took a look:

  1. I think "version" was missing for "package" on the Cargo.toml of tpm-box. I put a dummy version.
  2. I got your error.
  3. I then realized that the TPMU_SENSITIVE_CREATE failure was being triggered when TSS_VERSION > 4.0.0 as indicated in here and here.
  4. And the bindings were generated TSS_VERSION = 3.2.2 as indicated here.
  5. So basically it was a matter of the TSS_VERSION on the docker image I was using.
  6. I was building the docker image as imposed by the ci.yml here, which uses TSS_VERSION > 4.0.0.

I was able to have a successful build with:

  1. rust-tss-esapi$ docker build -t ubuntucontainer tss-esapi/tests/ --build-arg TPM2_TSS_VERSION=3.2.2 --file tss-esapi/tests/Dockerfile-ubuntu
  2. tpm-box$ docker run -v $(pwd):/tmp/tpm-box -w /tmp/tpm-box -it ubuntucontainer
  3. cargo clean (This is just in case you have abn old build there that would cause issues).
  4. cargo check

Hope this helps?

from rust-tss-esapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.