Skip to content

[Error] Distrobox is not location independent. #315

@wamserma

Description

@wamserma

Describe the bug
distrobox-enter fails if location of distrobox-scripts changed on disk.

To Reproduce
This happened to me with Nix on Ubuntu when updating and the old distrobox version got GC'd from the nix store:

  1. Assume a nix-enabled system
  2. Get older distrobox: nix-store -r /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15
  3. Create a box /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15/bin/distrobox-create --name testbox --image ubuntu:20.04
  4. Enter box /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15/bin/distrobox-enter testbox and leave again - works.
  5. Stop box /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15/bin/distrobox-stop testbox
  6. Remove old distrobox: nix-store --delete /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15
  7. Get newer distrobox: nix-store -r /nix/store/7nsxw7jggd33hrcbclgm5v13xds90r8w-distrobox-1.3.0
  8. Try to enter box /nix/store/7nsxw7jggd33hrcbclgm5v13xds90r8w-distrobox-1.3.0/bin/distrobox-enter testbox and observe reference to old version in failure message.
  9. Get older distrobox again: nix-store -r /nix/store/hcn0gjbb8xpl717pdp2bamzjcmspz3rp-distrobox-1.2.15
  10. Try to enter box /nix/store/7nsxw7jggd33hrcbclgm5v13xds90r8w-distrobox-1.3.0/bin/distrobox-enter testbox and observe things work.

Expected behavior
Distrobox should map its own location to a static path inside the container. (Distrobox already has great Nix support!)

Logs
Podman logs do not provide any useful data.

Desktop (please complete the following information):

  • Are you using podman or docker? Podman
  • Which version or podman or docker? Podman 4.1.0 (/nix/store/76hhw9w196lpwmkyzh4c526ax6sb19gs-podman-wrapper-4.1.0/bin/podman)
  • Which version of distrobox? 1.2.15 and 1.3.0, see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions