checkpoint-restore / criu

Checkpoint/Restore tool
criu.org
Other
2.98k stars 599 forks source link

releases: provide a static binary #1293

Open kolyshkin opened 3 years ago

kolyshkin commented 3 years ago

Currently, releases come with .zip and .tar.gz of criu sources. Since many projects (docker and runc at the very least) use criu in their CI cycle, currently they have to compile criu binary before running tests.

It would be nice to have a static criu binary in release artefacts.

I just checked it on Fedora. Theoretically you can make a static binary by running make LDFLAGS+=-static criu (or something like that). Practically, many libraries (protobuf-c, gnutls, libnl3, libnet) criu depends on are not available in the static version.

I haven't checked on Ubuntu/Debian but I guess the end result will be similar.

It probably makes sense to take a look whether using something like nix os would help to make a static binary.

Alternatively, a looong Dockerfile which compiles all the deps statically.

avagin commented 3 years ago

Cc: @0x7f454c46

adrianreber commented 3 years ago

@kolyshkin Podman and crun use either the package from the Ubuntu PPA or the package from Fedora to run their CI against the latest released version of CRIU.

https://github.com/containers/crun/blob/master/.travis.yml#L86

Running a CI against the latest released version of CRIU should be easily doable right now. As long as you are not looking for the latest development release this should be a good solution for runc.

GitHub Actions also has the possibility to publish artifiacts so it should also be not too hard to create Fedora and Ubuntu packages out of the latest development release.

kolyshkin commented 3 years ago

@adrianreber thanks, adopted it for runc (https://github.com/opencontainers/runc/pull/2691), let's see how it works.

Yet I think having a static binary still makes sense. One will be able to download a single file and use it on any distro. Not that it should be the preferred way of using criu, but it would be nice to have the option.

adrianreber commented 3 years ago

I was able to publish Debian packages at https://build.opensuse.org/repositories/devel:tools:criu

If anyone wants to be added as admin to that project, just let me know.

github-actions[bot] commented 3 years ago

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] commented 3 years ago

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] commented 3 years ago

A friendly reminder that this issue had no activity for 30 days.

avagin commented 8 months ago

Another option is to build criu in a container and take a criu binary with all dependent libraries:

cp criu/criu criu-bundle
cp /lib64/ld-linux-x86-64.so.2 criu-bundle
for l in `/lib64/ld-linux-x86-64.so.2 --list criu/criu | awk '{ print $3 }'`; do
    cp $l criu-bundle/
done