ubuntu / ubuntu-make

Easy setup of common tools for developers on Ubuntu.
GNU General Public License v3.0
1.2k stars 189 forks source link

Can't launch freshly installed Arduino IDE from desktop shortcut on Debian 11 #678

Closed N0rbert closed 2 years ago

N0rbert commented 2 years ago

Steps to reproduce:

  1. Have Debian 11 installed with task-mate-desktop on it
  2. Install Arduino IDE from Ubuntu Make using below commands
    
    sudo apt-get install git dpkg-dev debhelper dh-python python3-argcomplete python3-gnupg python3-setuptools python3-pytest python3-pycodestyle python3-pep8 python3-pexpect python3-progressbar python3-yaml python3-requests help2man
    cd ~/Downloads
    git clone https://github.com/ubuntu/ubuntu-make
    cd ubuntu-make
    dpkg-buildpackage -uc -us
    sudo apt-get install ../ubuntu-make_22.10_all.deb

umake electronics arduino

3. Reboot
4. Locate the desktop-file by Caja at `~/.local/share/applications/arduino.desktop` and make it trusted
5. Double click on the Arduino icon

Expected results:
* Arduino IDE is started. The Arduino icon is also usable from Applications → Programming menu too.

Actual results:
* error window with the following text - "There was an error launching the application." is shown instead. The Arduino icon is not shown in Applications → Programming menu.

The problem is probably caused by having `Exec=arduino` in desktop-file (see below):

$ cat ~/.local/share/applications/arduino.desktop

!/usr/bin/env xdg-open

[Desktop Entry] Version=1.0 Type=Application Name=Arduino Icon=/home/d/.local/share/umake/electronics/arduino/lib/arduino_icon.ico TryExec=/home/d/.local/share/umake/electronics/arduino/arduino Exec=arduino Comment=The Arduino Software IDE Categories=Development;IDE; Terminal=false


I can't understand why you have full path in `TryExec`, but not in `Exec` field. 

Details about the system:

$ grep -ira ".local/share/umake" ~ /home/d/.local/share/applications/arduino.desktop:Icon=/home/d/.local/share/umake/electronics/arduino/lib/arduino_icon.ico /home/d/.local/share/applications/arduino.desktop:TryExec=/home/d/.local/share/umake/electronics/arduino/arduino /home/d/.profile:PATH=/home/d/.local/share/umake/bin:$PATH

LyzardKing commented 2 years ago

Exec doesn't have the full path since the file is linked in a folder in PATH, therefore it is not necessary. This is set up in PATH=/home/d/.local/share/umake/bin:$PATH

There must be another error with the .desktop file. Could you check that the icon and executable paths are correct?

N0rbert commented 2 years ago

After adjusting PATH variable I can start Arduino from mate-terminal by arduino or gtk-launch arduino.desktop.

If I understand things correctly, then there is something wrong in Debian with the way of reading PATH variable from ~/.profile and/or ~/.bashrc by desktop environment. Currently I can't find relevant bug report about this, so I placed full path to Exec field manually. So there is no bug in ubuntu-make.

Update. The reason for the above behavior is the following. LightDM on Debian does not source ~/.profile file because of a bug or maybe feature (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636108 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024073 ). The workaround here is to install SDDM and use it instead of LightDM - use sudo apt-get install sddm --no-install-recommends --no-install-suggests and then reboot and login to MATE session.