craft_parts.overlays.chroot module

Execute a callable in a chroot environment.

craft_parts.overlays.chroot.chroot(path, target, *args, **kwargs)[source]

Execute a callable in a chroot environment.

Parameters:
  • path (Path) – The new filesystem root.

  • target (Callable) – The callable to run in the chroot environment.

  • args (Any) – Arguments for target.

  • kwargs (Any) – Keyword arguments for target.

Return type:

Any

Returns:

The target function return value.