Linux install broken #31

Closed
opened 2021-06-26 10:25:26 +00:00 by mikro2nd · 8 comments

Kubuntu 20.04

After running install-home.sh from the Linux binary install https://cwtch.im/releases/cwtch-v1.0.0-16-gb1f81e4/cwtch-v1.0.0-16-gb1f81e4.tar.gz, running cwtch fails with

/home/mike/.local/bin/cwtch: error while loading shared libraries: libflutter_linux_gtk.so: cannot open shared object file: No such file or directory
Kubuntu 20.04 After running `install-home.sh` from the Linux binary install https://cwtch.im/releases/cwtch-v1.0.0-16-gb1f81e4/cwtch-v1.0.0-16-gb1f81e4.tar.gz, running cwtch fails with ``` /home/mike/.local/bin/cwtch: error while loading shared libraries: libflutter_linux_gtk.so: cannot open shared object file: No such file or directory ```

I ran into the same problem for install-sys.sh on Debian 10.10.
The workaround for it was using ldconfig:

$ sudo ldconfig /usr/lib/cwtch/

But that won't work for the local installation with install-home.sh.
Also, this is something the install script should have handled in some way, right?

I ran into the same problem for `install-sys.sh` on Debian 10.10. The workaround for it was using ldconfig: ``` $ sudo ldconfig /usr/lib/cwtch/ ``` But that won't work for the local installation with `install-home.sh`. Also, this is something the install script should have handled in some way, right?
dan was assigned by sarah 2021-06-26 16:11:07 +00:00
sarah added the
bug
linux
labels 2021-06-26 16:11:14 +00:00
Contributor

Are you running cwtch through the .desktop file / menu, or by executing the binary? The .desktop file sets LD_LIBRARY_PATH, so I ended up putting the binary in /usr/lib/cwtch/ and making /usr/bin/cwtch a shell script:

#!/bin/bash -eu
exec env LD_LIBRARY_PATH=/usr/lib/cwtch /usr/lib/cwtch/cwtch
Are you running cwtch through the .desktop file / menu, or by executing the binary? The .desktop file sets LD_LIBRARY_PATH, so I ended up putting the binary in /usr/lib/cwtch/ and making /usr/bin/cwtch a shell script: ```sh #!/bin/bash -eu exec env LD_LIBRARY_PATH=/usr/lib/cwtch /usr/lib/cwtch/cwtch ```
Owner

Good call, thanks, I can switch the binary to an alt name, and move the LD_LIBRARY_PATH to a shell script so that it's invokable from the command line still!

Good call, thanks, I can switch the binary to an alt name, and move the LD_LIBRARY_PATH to a shell script so that it's invokable from the command line still!
Author

Directly executing the binary, so library path is clearly not set, nor is the library in any of the "standard" places.

fwiw: The library (libraries!) are correctly installed to ~/.local/lib/cwtch so there's no problem there.

Directly executing the binary, so library path is clearly not set, nor is the library in any of the "standard" places. fwiw: The library (libraries!) are correctly installed to ~/.local/lib/cwtch so there's no problem there.
Owner

Including another report I received below which is related to the linux install process (though not libraries, but tor itself:

Cwtch Beta Testing #3

Cwtch v. :  cwtch-v1.0.0-18-g3e547bd
Platform :  Ubuntu 21.04

Cwtch has trouble finding the Tor executable

Running

$ cd Downloads/cwtch-v1.0.0-18-g3e547bd/cwtch/
$ ./install-home.sh 

And then opening Cwtch from the GNOME application search, gives the following warning

"Error connecting to Tor: Could not connect or start Tor that meets requirements (min Tor version 0.3.5.x)"

However, running

$ cd Downloads/cwtch-v1.0.0-18-g3e547bd/cwtch/
$ chmod +x cwtch.home.desktop
$ ./cwtch.home.desktop

successfully launches the bundled Tor executable.

After installing Tor with sudo apt install tor -y, the launcher finds Tor (from /usr/sbin/tor; $ which tor points to that binary).

The problem seems to be the .desktop launcher doesn't look for the downloaded Tor outside cwd, and if Tor isn't present in pre-existing $PATHs, it won't be found.

I managed to fix this by appending one of the following snippets to the install-home.sh:

# Requires logging out and back in
if [ ! $(which tor) ]; then
    cp tor ~/.local/bin/
    echo "Please log out and back in before using Cwtch"
fi

or

# Requires root password:
if [ ! $(which tor) ]; then
    echo "Installing Tor"
    sudo cp tor /usr/local/bin
fi

Neither is ideal. The latter one requires sudo privileges. I selected the path /usr/local/bin as it can be overridden by the Tor APT installation, at least on Ubuntu that has /usr/sbin/tor listed first in PATH. I can't comment on behalf of other distros.

As for the first one, I tried different ways to export ~/.local/bin/ to PATH from within the shell script file but didn't succeed to fix the need to log out and back in. Shell scripting is definitely not my forte however, so there might be a way to get it working.

Including another report I received below which is related to the linux install process (though not libraries, but tor itself: Cwtch Beta Testing #3 --------------------- Cwtch v. : cwtch-v1.0.0-18-g3e547bd Platform : Ubuntu 21.04 ### Cwtch has trouble finding the Tor executable Running $ cd Downloads/cwtch-v1.0.0-18-g3e547bd/cwtch/ $ ./install-home.sh And then opening Cwtch from the GNOME application search, gives the following warning "Error connecting to Tor: Could not connect or start Tor that meets requirements (min Tor version 0.3.5.x)" However, running $ cd Downloads/cwtch-v1.0.0-18-g3e547bd/cwtch/ $ chmod +x cwtch.home.desktop $ ./cwtch.home.desktop successfully launches the bundled Tor executable. After installing Tor with `sudo apt install tor -y`, the launcher finds Tor (from `/usr/sbin/tor`; `$ which tor` points to that binary). The problem seems to be the `.desktop` launcher doesn't look for the downloaded Tor outside `cwd`, and if Tor isn't present in pre-existing `$PATH`s, it won't be found. I managed to fix this by appending one of the following snippets to the `install-home.sh`: # Requires logging out and back in if [ ! $(which tor) ]; then cp tor ~/.local/bin/ echo "Please log out and back in before using Cwtch" fi or # Requires root password: if [ ! $(which tor) ]; then echo "Installing Tor" sudo cp tor /usr/local/bin fi Neither is ideal. The latter one requires sudo privileges. I selected the path `/usr/local/bin` as it can be overridden by the Tor APT installation, at least on Ubuntu that has `/usr/sbin/tor` listed first in `PATH`. I can't comment on behalf of other distros. As for the first one, I tried different ways to export `~/.local/bin/` to `PATH` from within the shell script file but didn't succeed to fix the need to log out and back in. Shell scripting is definitely not my forte however, so there might be a way to get it working.
Contributor

If using the bundled tor is desired, it may be best to just install both the cwtch and tor binaries to /usr/lib/cwtch/bin/ or ~/.local/share/cwtch/bin/, and install a script as /usr/bin/cwtch that sets both LD_LIBRARY_PATH and PATH.
That avoids potential conflicts with a tor installed with apt/dnf/pacman/etc.

On the other hand, you may want to use the system tor if it's newer? Maybe have the script run tor --version and run e.g. /usr/lib/cwtch/bin/cwtch --tor="$tor_binary_path"

Another tangent: The install script should really write /usr/lib/cwtch/bin/uninstall-cwtch.sh or something, I hate having to figure out what an installer did so I can manually remove an app.

If using the bundled `tor` is desired, it may be best to just install both the cwtch and tor binaries to /usr/lib/cwtch/bin/ or ~/.local/share/cwtch/bin/, and install a script as `/usr/bin/cwtch` that sets both `LD_LIBRARY_PATH` and `PATH`. That avoids potential conflicts with a `tor` installed with apt/dnf/pacman/etc. On the other hand, you may want to use the system `tor` if it's newer? Maybe have the script run `tor --version` and run e.g. `/usr/lib/cwtch/bin/cwtch --tor="$tor_binary_path"` Another tangent: The install script should really write `/usr/lib/cwtch/bin/uninstall-cwtch.sh` or something, I hate having to figure out what an installer did so I can manually remove an app.
dan added this to the Cwtch Beta 1.1 project 2021-06-29 07:28:14 +00:00
Owner

#95

should go a long way to addressing these concerns :)
the bundled tor is installed in the respective lib/cwtch directory, along with the cwtch binary. a simple shell script setting hte LD_LIBRARY_PATH is installed in the appropriate bin directory.

https://git.openprivacy.ca/cwtch.im/cwtch-ui/pulls/95 should go a long way to addressing these concerns :) the bundled tor is installed in the respective lib/cwtch directory, along with the cwtch binary. a simple shell script setting hte LD_LIBRARY_PATH is installed in the appropriate bin directory.
dan added the
in-nightly
label 2021-07-07 17:31:10 +00:00
sarah added the
cwtch-beta-1.1
label 2021-07-13 17:48:11 +00:00
Owner

no more reports of this so I'm closing it :)
if anyone is still having problems please reopen and comment!

no more reports of this so I'm closing it :) if anyone is still having problems please reopen and comment!
dan closed this issue 2021-07-14 17:30:19 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch-ui#31
No description provided.