Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] distrobox-export issues #1311

Closed
pavelxdd opened this issue Mar 27, 2024 · 2 comments
Closed

[Error] distrobox-export issues #1311

pavelxdd opened this issue Mar 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@pavelxdd
Copy link
Contributor

  1. Exported binaries don't start in a login shell, so the user environment variables are not sourced.

For example I have multiple HOMEBREW_* env variables set in .zshenv and export brew binary from a distrobox container. But when running brew on a host, it doesn't source the .zshenv. So I have to manually modify the exported script to add /bin/sh -l -c.

As far as I can see from the commit history it worked before and got changed in this commit:
3b1e312#diff-291967e0db48bedf9e745ebca7eeb5c28d1652ab5baa971642ec682b6b88b1a1

  1. distrobox/distrobox-export

    Lines 337 to 339 in 867f4f8

    elif [ -n "\${CONTAINER_ID}" ] && [ "\${CONTAINER_ID}" != "${container_name}" ]; then
    exec distrobox-host-exec '${dest_path}/$(basename "${exported_bin}")' ${extra_flags} "\$@"
    else

I think the extra_flags here are redudant, since they are added in the previous line, which will be called after host-exec.

@pavelxdd pavelxdd added the bug Something isn't working label Mar 27, 2024
@RodoMa92
Copy link

RodoMa92 commented Apr 3, 2024

Similar experience, but instead I can't even export anything now. distrobox-export just dies with

❯ distrobox-export --list-apps
/home/marco/.local/bin//distrobox-export: line 244: CONTAINER_ID: unbound variable

Which is correct, since I'm running in podman, but it should just skip that if check, not die on that line. Can't really see why tho, it should work from my primitive understanding of bash.

@RodoMa92
Copy link

RodoMa92 commented Apr 3, 2024

Commenting that if branch out still makes it fail with

❯ distrobox-export --list-apps
grep: /run/host/home/marco/.local/share/applications/io.github.fastrizwaan.WineZGUI_BbLauncher.desktop: File o directory non esistente
/home/marco/.local/bin//distrobox-export: line 628: CONTAINER_ID: unbound variable
/home/marco/.local/bin//distrobox-export: line 628: CONTAINER_ID: unbound variable
/home/marco/.local/bin//distrobox-export: line 628: CONTAINER_ID: unbound variable

And taking a look at that line it seems to assume that CONTAINER_ID is set at that point, but I can't see anywhere in distrobox-export a manual assignment to it. Is this intended behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants