Skip to content

Conversation

@herheliuk
Copy link
Member

@herheliuk herheliuk commented Oct 22, 2025

Use system-installed CRIU binary instead of a local file

Thanks to @avagin for suggesting this solution.

Co-authored-by: Andrei Vagin [email protected]
Signed-off-by: Andrii Herheliuk [email protected]

@herheliuk
Copy link
Member Author

herheliuk commented Oct 22, 2025

Currently, pycriu attempts to use a local CRIU binary, but I believe
it would make more sense to use a system-installed CRIU binary instead.

This approach would provide a more “works out of the box” experience,
as it’s unlikely that the CRIU binary would be located in the current directory.

@herheliuk herheliuk changed the title lib/pycriu: change default behaviour to use the system binary lib/pycriu: changing the default behavior to use the system binary Oct 22, 2025
@herheliuk herheliuk closed this Oct 22, 2025
@herheliuk herheliuk reopened this Oct 22, 2025
@herheliuk herheliuk closed this Oct 23, 2025
@avagin
Copy link
Member

avagin commented Oct 23, 2025

some tests are failing.

You need to add the local binary directory to PATH in all tests.

@herheliuk herheliuk reopened this Oct 23, 2025
@herheliuk herheliuk marked this pull request as draft October 23, 2025 05:27
@herheliuk herheliuk force-pushed the use-default-binary branch 2 times, most recently from 5ac465b to 56830f5 Compare October 23, 2025 05:29
Use system-installed CRIU binary instead of a local file

Thanks to @avagin for suggesting this solution.

Co-authored-by: Andrei Vagin <[email protected]>
Signed-off-by: Andrii Herheliuk <[email protected]>
@herheliuk herheliuk marked this pull request as ready for review October 23, 2025 06:13
@rst0git
Copy link
Member

rst0git commented Oct 23, 2025

Currently, pycriu attempts to use a local CRIU binary, but I believe it would make more sense to use a system-installed CRIU binary instead.

Note that this behavior is for testing. We want to run tests with a locally built binary, not a system-installed one.

@herheliuk
Copy link
Member Author

herheliuk commented Oct 23, 2025

@rst0git won't os.execvp resolve to local binary if it is available?

And does tests use criu.py at all?

@herheliuk
Copy link
Member Author

I do not know how to add PATH to tests. Can you guys help with that?

@rst0git
Copy link
Member

rst0git commented Oct 23, 2025

@herheliuk os.execvp uses the PATH environment variable.

What is the issue you are trying to fix with this change?

@herheliuk
Copy link
Member Author

herheliuk commented Oct 23, 2025

I'm trying to make it as pleasant 'out of the box' experience as possible.

Since it is unlikely for the binary to be in the same folder in normal circumstances, I recon most users would want to use a system-installed binary anyway, thus we want to make it a default behaviour.

@herheliuk
Copy link
Member Author

herheliuk commented Oct 23, 2025

Tests might have been failing because I accidentally pushed my fork instead of origin rebase.
I don't think there would be a different criu version installed system-wide on the CI anyway.

You know better, but maybe we don't need to add the binary to PATH in tests.

@avagin
Copy link
Member

avagin commented Oct 27, 2025

Currently, pycriu attempts to use a local CRIU binary, but I believe it would make more sense to use a system-installed CRIU binary instead.

Note that this behavior is for testing. We want to run tests with a locally built binary, not a system-installed one.

@rst0git I think this change is doing the right thing. By default, the library has to use the system-installed criu binary.

Copy link
Member

@rst0git rst0git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rst0git rst0git merged commit 49e9de0 into checkpoint-restore:criu-dev Oct 27, 2025
38 of 44 checks passed
@herheliuk herheliuk deleted the use-default-binary branch October 27, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants