containers / libkrun

A dynamic library providing Virtualization-based process isolation capabilities
Apache License 2.0
898 stars 74 forks source link

Fix build error on missing uuid headers #129

Closed pfw closed 1 year ago

pfw commented 1 year ago

build_on_krunvm.sh was failing with an error of a missing header in the linux vm.

gcc -O2 -static -Wall -D__ROSETTA__ -o init/init init/init.c -D__ROSETTA__
In file included from init/init.c:26:
init/tee/snp_attest.h:8:10: fatal error: uuid/uuid.h: No such file or directory
    8 | #include <uuid/uuid.h>
      |          ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:64: init/init] Error 1
There was a problem building init/init in the VM
slp commented 1 year ago

Thanks for the PR! We shouldn't be bringing snp_attest.h into the non-SEV builds. I think we right fix would be putting https://github.com/containers/libkrun/blob/d31747aa92cf83df2abaeb87e2a83311c135d003/init/init.c#L26, https://github.com/containers/libkrun/blob/d31747aa92cf83df2abaeb87e2a83311c135d003/init/init.c#L37 and https://github.com/containers/libkrun/blob/d31747aa92cf83df2abaeb87e2a83311c135d003/init/init.c#L38 between #ifdef SEV build-time conditionals.

@pfw Do you want to update this PR with this approach?

pfw commented 1 year ago

No problems, I'll look at doing that.

tylerfanelli commented 1 year ago

@pfw Is there any update on this? Would you like me to make these changes?

pfw commented 1 year ago

Hi @tylerfanelli I’ve not had a chance to look at this but will in the next couple of days but I’m more than happy for you to take a look if you have time.