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

Build instructions for GNU/Linux #77

Closed
dariox86 opened this issue Apr 22, 2020 · 6 comments
Closed

Build instructions for GNU/Linux #77

dariox86 opened this issue Apr 22, 2020 · 6 comments
Labels
discussion question Further information is requested up-for-grabs

Comments

@dariox86
Copy link

I was wondering whether the application can be built from sources on GNU/Linux. On Parabola GNU/Linux-libre, version 2.0.7 crashes with a segmentation fault while version 2.0.6 works. I wanted to investigate this regression.

@0x90d 0x90d added discussion question Further information is requested up-for-grabs labels May 16, 2020
@guihkx
Copy link

guihkx commented Jun 1, 2020

I learned about this amazing program yesterday and I wanted to give it a try, but I was left disappointed because the latest Linux release is crashing for me too.

Then I tried to fix it myself (knowing absolutely nothing about C# or .NET, nonetheless 😆), and after a couple of hours of pure stress learning process, I was able to compile a "functional" Linux version from the master branch!

I put "functional" in quotation marks because while the program does run and the GUI is displayed, it will immediately crash if you click to add directories for scanning.

I'm on Arch Linux, so I decided to test it on Ubuntu 19.10 and, to my surprise, it doesn't crash there. The crash has been reported already to the Avalonia team, but no fix or workaround is available as of yet:

AvaloniaUI/Avalonia#2817

I'll set up a fork later with the modifications I made to make the program build and work on Linux. Then, if @0x90d wants, he can merge these changes into his repository.

@dariox86
Copy link
Author

dariox86 commented Jun 2, 2020

Great job, @guihkx. I look forward to see your progress.

@guihkx
Copy link

guihkx commented Jun 6, 2020

I've written a quick guide on how to compile and run the most recent build on Linux. Additionally, I'll be listing some general issues I have found, which I don't know how to properly fix.

Compiling

First, install the .NET Core SDK package from your distro (e.g. on Arch Linux, there's an official package called dotnet-sdk).

Then, clone my repository and checkout to the linux-fixes branch:

git clone -b linux-fixes https://github.com/guihkx/videoduplicatefinder.git

Now let's enter into that directory and compile the VideoDuplicateFinderLinux project:

cd videoduplicatefinder/
dotnet publish 'VideoDuplicateFinderLinux' -c 'Release' -f 'netcoreapp3.1' -r 'linux-x64' -o './Releases/VDF.Linux-x64'

There will be a bunch of warnings, so just ignore them. Apart from that, it should compile with no errors.

The compiled program (along with the necessary runtime libraries), will be in the Releases/VDF.Linux-x64/ folder.

Running

The requirements to run it haven't changed: You still need FFmpeg and GDI+ installed (On Arch, those packages are called ffmpeg and gdiplus, respectively).

Once you have those installed, just head to the Releases/VDF.Linux-x64 directory and double-click the VideoDuplicateFinderLinux binary. You can also run from the command line: ./VideoDuplicateFinderLinux.

Problems

Although the main functionality of the program works as expected, there are some bugs that you have to be aware of (some are mild, other are serious):

  • Adding/Excluding directories: As I mentioned in my previous post, if you're on a Arch-based distribution, once you click the button to add or exclude directories, the program will crash. A fix is available, but only in the nightly version of Avalonia. The workaround is to add/exclude directories by manually editing the Settings.xml file inside VDF's directory -- just make sure you open & close the program at least once, so the file can be generated.

  • Missing dialogs: There are a couple of places in the code where a message box is shown to the user, to either show an error/warning message or ask for user input. Most notably:

    • Deleting files: When you try to delete a duplicated file using VDF, in theory it will ask for your confirmation. But since dialogs are currently broken, once you do that, VDF will crash, so delete them manually instead!
    • Missing dependencies: If you don't have ffmpeg installed, for example, the program will try to warn you showing a message box, which will also make VDF crash. So make sure you have all the dependencies installed before running it.

    I've tried to fix this, but since my C# knowledge is very much absent, I wasn't able to properly reference the function that initializes the MessageBox class in the XAML file (using the x:Class property), like I had to do with other XAML files. This is the error I get when I try to compile when I add x:Class="VideoDuplicateFinderLinux.MessageBoxView" to MessageBoxView.xaml:

    $ dotnet publish 'VideoDuplicateFinderLinux' -c 'Release' -f 'netcoreapp3.1' -r 'linux-x64' -o './Releases/VDF.Linux-x64'
    /home/me/videoduplicatefinder/VideoDuplicateFinderLinux/MessageBoxView.xaml(1,2,1,2): Avalonia error XAMLIL: Unable to find public constructor for type VideoDuplicateFinderLinux:VideoDuplicateFinderLinux.MessageBoxView() (line 1 position 2) Line 1, position 2. [/home/me/videoduplicatefinder/VideoDuplicateFinderLinux/VideoDuplicateFinderLinux.csproj]
    

    Apparently, setting the x:Class property wasn't necessary at all in Avalonia 0.8, so maybe that's why it used to work...? I don't know. I've also found this bug report, which is apparently related to this.

  • Pause button still visible after you pause the scanning process: This is only a "visual" bug, so it shouldn't negatively affect usability. The main reason this is happening, is because I have no idea on how to add more than one condition to the IsVisible property of the pause button. I tried doing something like this: {Binding IsScanning && !IsPaused}, but it doesn't work and the documentation doesn't seem to address it. Plus, I didn't want to create a new variable just to control the visibility of the Pause button. Hopefully, there is a better way of fixing it. :)

  • Double-clicking any of the duplicated files listed, will not open its directory: The code that handle this is there, but it does not work. See: Binding to $parent in listbox item generates binding errors initially AvaloniaUI/Avalonia#2258. Apparently it should work despite the warnings, but it still doesn't work for me:

    [Binding] Error in binding to "Avalonia.Xaml.Interactions.Core.InvokeCommandAction"."Command": "Null value in expression '$parent[ListBox, 0]'." (Avalonia.Xaml.Interactions.Core.InvokeCommandAction #6488958)
    
  • Hovering the thumbnail doesn't display the original image: In fact, if you hover your mouse cursor on it, it will show a very small square, which I guess is where the bigger preview was supposed to be. This feature was introduced in Add side pane with larger preview #76.

  • Scrolling with your mouse through the duplicated file list feels sluggish: I'm not entirely sure if this one can be fixed on VDF's side, but damn, the scrolling feature is not good. In my testings, it gets much worse if you do some scrolling on VDF, then minimize it, then scroll up or down on some other program, then go back to VDF and scroll again. Sometimes, it will reset the scroll to the top of the list. Sometimes, it will scroll randomly downwards. It's just inconsistent behavior. If you have a big list of duplicates and don't want to get lost while deleting your files, I'd recommend manually dragging the scrollbar instead, like in the good ol' days.

And... I think that's it for now. Let me know how it goes for you.

@dariox86
Copy link
Author

dariox86 commented Jun 8, 2020

Thank you for your thorough feedback! It works for me. A condensed version of the build instructions should be in the main page and the bugs in a separate bug report. Hopefully the developers will act accordingly.

@Rlegault
Copy link

Rlegault commented Sep 22, 2020

Really appreciate the help. Managed to get it to compile on Linux Mint 20 after installing .NET SDK as a snap pack.

But because of a stack overflow in 2.07 & 2.08 am now using the binary from 2.06

@0x90d
Copy link
Owner

0x90d commented Aug 3, 2021

Closing because this refers to outdated VDF Version 2

@0x90d 0x90d closed this as completed Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion question Further information is requested up-for-grabs
Projects
None yet
Development

No branches or pull requests

4 participants