firecracker-microvm / firecracker

Secure and fast microVMs for serverless computing.
http://firecracker-microvm.io
Apache License 2.0
24.69k stars 1.73k forks source link

Cannot build in submodule since 1.3.1 #3587

Closed benbuzbee closed 1 year ago

benbuzbee commented 1 year ago

This line in this commit uses git to calculate the version of firecracker https://github.com/firecracker-microvm/firecracker/commit/c8ec4b80a8d815e4a589dfae33b0e1c197af0132#diff-5c05dc4c302e9347cb2e91efd67fe5bf69ab7f93cffe21e8bdf9f99badeb9e4fR88

But firecracker uses docker to build when if you use the build steps like: ./tools/devtool --unattended build --release

This tool will mount the directory, but not parent directories.

If firecracker lives in a submodule, this means that when the script attempts to call "git describe" it will fail, because the parent module was not included int he docker container:

fatal: not a git repository: /firecracker/../../.git/modules/deps/firecracker

So, effectively, we cannot build firecracker in a submodule anymore.

Consider that firecracker-contaienrd uses submodules, so I expect it to fail once it tries to update: https://github.com/firecracker-microvm/firecracker-containerd/blob/main/Makefile#L347 https://github.com/firecracker-microvm/firecracker/tree/77cfb9ceaa6a54e22a8259f50fb621ad1e39292b

How to fix it

The tool could try to find the git root and mount the whole directory Or you could revert to having to have the version externally specified

pb8o commented 1 year ago

Thanks for the heads-up. We may want to just use the version in Cargo.toml and adapt everything else, since it seems to be the cause of a number of problems. Will make a proof-of-concept.

pb8o commented 1 year ago

This should be fixed now in HEAD, should be part of the next release.

pb8o commented 1 year ago

Resolved as it will be part of next release.