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

[Feature] Export app when it's not in $PATH #225

Closed
tunix opened this issue Apr 4, 2022 · 6 comments · Fixed by NixOS/nixpkgs#175302
Closed

[Feature] Export app when it's not in $PATH #225

tunix opened this issue Apr 4, 2022 · 6 comments · Fixed by NixOS/nixpkgs#175302
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tunix
Copy link

tunix commented Apr 4, 2022

Describe the bug

I've created an Ubuntu container into which I install beekeeper-studio. I use the DEB package to install. It installs itself into /opt/Beekeeper Studio and its binary is available at /opt/Beekeeper Studio/beekeeper-studio. It also installs a desktop file at /usr/share/applications/beekeeper-studio.desktop but when I try to export it, I get the following error:

$ distrobox-export --app beekeeper-studio
Error: trying to export a non-installed application.

An error occurred

To Reproduce

Use the following Containerfile:

FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive

RUN sed -i 's/archive.ubuntu/tr.archive.ubuntu/g' /etc/apt/sources.list \
  && apt update \
  && apt upgrade -y \
  && apt install -qqy wget gnupg2

RUN wget --quiet -O - https://deb.beekeeperstudio.io/beekeeper.key | apt-key add - \
  && echo "deb https://deb.beekeeperstudio.io stable main" | tee /etc/apt/sources.list.d/beekeeper-studio-app.list \
  && apt update -y \
  && apt install -qqy beekeeper-studio

Expected behavior

I expect the desktop file to install on my host OS and the application to work.

Logs

$ distrobox-export --app beekeeper-studio --verbose
+ [ ! -f /run/.containerenv ]
+ id -u
+ [ 1000 -eq 0 ]
+ [ -z beekeeper-studio ]
+ [ -n beekeeper-studio ]
+ [ -n  ]
+ [ -n beekeeper-studio ]
+ [ -n  ]
+ [ -n  ]
+ [ -n  ]
+ uname -n
+ cut -d. -f1
+ container_name=beekeeper
+ container_command_prefix=/usr/bin/distrobox-enter -T -n beekeeper -- "
+ [ -z  ]
+ exported_app_label= (on beekeeper)
+ export_application
+ command -v beekeeper-studio
+ printf Error: trying to export a non-installed application.\n
Error: trying to export a non-installed application.
+ return 127
+ [ 127 -ne 0 ]
+ printf \nAn error occurred\n

An error occurred

Desktop:

  • OS: Fedora Silverblue 35
  • Version: 35.20220403.0

Additional context

Maybe in addition to just looking for binaries within $PATH, we can also search for a .desktop file and try to validate whether the executable it defines exists?

@tunix tunix added the bug Something isn't working label Apr 4, 2022
@tunix tunix changed the title [Error] Cannot export beekeeper-studio [Error] Cannot export app when it's not in $PATH Apr 4, 2022
@89luca89
Copy link
Owner

89luca89 commented Apr 5, 2022

Seems reasonable yes
Will modify this in a feature request, and work on it when possible 👍

@89luca89 89luca89 changed the title [Error] Cannot export app when it's not in $PATH [Feature] Export app when it's not in $PATH Apr 5, 2022
@89luca89 89luca89 added enhancement New feature or request good first issue Good for newcomers and removed bug Something isn't working labels Apr 5, 2022
@Meister1593
Copy link
Contributor

Same thing happens for Webex desktop app

@Meister1593
Copy link
Contributor

Meister1593 commented Apr 29, 2022

Tried doing so with Intellij Idea that installs desktop file into ~/.local/share/applications, same thing

I first thought exporting app actually exports desktop file, but i now ses it exports only application from $PATH

when this will be implemented, is it possible to change --app to export actually desktop applications and not something from $PATH (make --bin without full path export binary from path meybe)?

@89luca89
Copy link
Owner

@tunix @Meister1593 latest commit is fixing this issue 👍

@Meister1593
Copy link
Contributor

Meister1593 commented May 27, 2022

Okay i tried same thing with idea and it doesn't work if application has exported desktop file in local user folder path.

For example, community idea by default can be installed anywhere and you usually launch it using idea/bin/idea.sh script.
Then, if you want, you can install desktop file (using help-desktop file integration or something like that) either for all users (i suppose, it will install somewhere like /usr/local/share/applications, but don't quote this on me), or just in current user (which will place desktop file in ~/.local/share/applications/jetbrains-idea-ce.desktop relative to container's home folder)

Distrobox doesn't search for those paths and thus, fails to find it.
I'm not sure if this is also related to flatpak, but looking at places there, i don't seem to find any references to flatpak user desktop files too
e1ec844#diff-291967e0db48bedf9e745ebca7eeb5c28d1652ab5baa971642ec682b6b88b1a1L314-L316

@89luca89
Copy link
Owner

@Meister1593 this is not flatpak related

But a PR is open for this #291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants