Bug 433738

Summary: Project Plugin does not autoload Mercurial projects.
Product: [KDE Neon] neon Reporter: Buddy Thompson <BuddyT313>
Component: SnapsAssignee: Neon Bugs <neon-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: christoph, jr, neon-bugs, razor87_
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: attachment-9150-0.html

Description Buddy Thompson 2021-02-28 09:45:23 UTC
SUMMARY
When I open a file in a Mercurial controlled project, Kate doesn't recognize the project. The file tree shows only the opened file with <untracked> at the top of the tree. 

It may be a recurrence of this bug:

https://kde-bugs-dist.kde.narkive.com/DVcU9dxh/kate-bug-355827-new-kate-project-not-loading-project-tree


STEPS TO REPRODUCE
1. Make sure autoload is enabled for Mercurial in settings.
2. Open a file in a Mercurial project repo
3. Check out the project file tree.

OBSERVED RESULT - Project file tree is unpopulated except for the open file and the tree heading shows <untracked>. Also can't search through current project, etc.


EXPECTED RESULT - Fully populated project file tree and project-based functions working.


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION 
Kate 19.12.3 works fine on this same machine.
Comment 1 Christoph Cullmann 2021-02-28 19:44:45 UTC
Hmm, I tried this with the 20.12 version (and master) with the Mercurial repo itself:

hg clone https://www.mercurial-scm.org/repo/hg

=> opened some file inside
=> got the full repo

Is hg installed and executable e.g. from your shell?
Comment 2 Christoph Cullmann 2021-02-28 19:45:40 UTC
(ok, if it works in 19.12.3 should be there)

I have no 20.04 here, perhaps this was some regression :/
Comment 3 Buddy Thompson 2021-02-28 20:15:28 UTC
Created attachment 136264 [details]
attachment-9150-0.html

Hi,
Yes, I have hg is installed and working.

I should explain that I'm new at both coding and Linux OS...

I just set up this machine yesterday. I installed kate 20.04.0 form the 
Ubuntu (20.04.2)Software app and ran into this problem. I removed Kate 
and then re-installed it from the command line. Everything worked fine. 
A little later, I realized that the version I installed from the command 
line was 19.12.3. So I reversed everything again, re-installed 20.04.0 
from the snap store and had the problem again. Reverted back to 19.12.3 
and all is good again.

After submitting this bug I also found this report...

431223 – Projects plugin does not list files in the Projects-view 
(kde.org) <https://bugs.kde.org/show_bug.cgi?id=431223>

So the problem is not restricted to hg repos.

Hope that helps.

Buddy Thompson




On 2/28/2021 12:44, Christoph Cullmann wrote:
> https://bugs.kde.org/show_bug.cgi?id=433738
>
> Christoph Cullmann <cullmann@kde.org> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |cullmann@kde.org
>
> --- Comment #1 from Christoph Cullmann <cullmann@kde.org> ---
> Hmm, I tried this with the 20.12 version (and master) with the Mercurial repo
> itself:
>
> hg clone https://www.mercurial-scm.org/repo/hg
>
> => opened some file inside
> => got the full repo
>
> Is hg installed and executable e.g. from your shell?
>
Comment 4 Christoph Cullmann 2021-02-28 21:07:55 UTC
Hmm, I see.

Guess this is an issue with the snap package.

> I should explain that I'm new at both coding and Linux OS...

Nothing to apologize for, your bug report is totally ok.
It is unexpected that it doesn't work.
Comment 5 Christoph Cullmann 2021-02-28 21:08:17 UTC
Hi, is it expected that Kate from the Snap package can't call system wide installed stuff?
Comment 6 Buddy Thompson 2021-02-28 21:40:18 UTC
I'm not sure if that question is directed at me. If so, I don't know what you're asking. 

I know that there is an Ubuntu Software app that I used originally to install Kate 20.04.0. I believe that app is somehow linked to the snap store. 

After having my problem. I looked at other IDEs to install. I saw in a review for one of them that installing from the Ubuntu Software app doesn't work for that particular IDE and people should use "sudo apt install appname" to install it directly. So, on a whim, I removed Kate using the Ubuntu Software app and then tried "sudo apt install kate" in a terminal to re-install it and was happy to find that it was working. Only a bit later did I realize I had installed an older version. 

Hope that helps.
Comment 7 Christoph Cullmann 2021-03-01 18:11:24 UTC
Sorry, didn't want to confuse you.

The question was meant for the people doing the Snap packages.

My knowledge of Snap packages is zilch ;=)
Comment 8 Christoph Cullmann 2021-03-20 18:35:49 UTC
Hi Neon devs,

any input on this?

I just moved one other bug in the same category: bug 431223.

If Kate from the snap stuff can't execute external processes, a lot of the advanced features like the project stuff (needs to execute git/svn/mercurial), the git integration that will be in 21.04 (needs to call git) and even more important the LSP stuff will just not work.

Either this should be fixed or we should not provide snap packages, as Kate without any of these features is really not that nice.
Comment 9 Christoph Cullmann 2021-03-20 19:02:36 UTC
I looked in the 

https://invent.kde.org/neon/kde/kate/-/blob/Neon/unstable/snapcraft.yaml

file.

I assume the confinement: strict is the issue.
Can this be relaxed? Without more or less full access to all installed stuff of the system, a lot of Kate features are broken.
Comment 10 Christoph Cullmann 2021-03-20 19:02:47 UTC
*** Bug 431223 has been marked as a duplicate of this bug. ***
Comment 11 Christoph Cullmann 2021-03-20 19:04:03 UTC
upsa, the other bug was for flatpack, there we have the same issues, it seems.
Comment 12 Jonathan Riddell 2021-03-22 21:49:34 UTC
thanks for the report

yes snap packages are containers with a limited view of the outside world, they can't run external binaries.  Probably the easiest way is to include hg in the snap packages and any other external binaries that are likely to be used.  I'll ask around for other ideas.
Comment 13 Christoph Cullmann 2021-03-23 06:29:42 UTC
Hi,

Please take a look at the discussion in bug 431223.

If Kate can't access external programs and the user/system environment none of the advanced plugins we work so hard on function properly, bundling stuff won't help, we need access to exactly the stuff the user has installed.

If that is infeasible, we need to remove the snap package, like flatpak.
Comment 14 Jonathan Riddell 2021-03-23 15:38:05 UTC
I've uploaded it to be a classic snap, hopefully the request will be reviewed by the store admins soon
https://forum.snapcraft.io/t/kate-as-classic-snap/23514
Comment 15 Christoph Cullmann 2021-03-23 16:15:09 UTC
Cool, if that allows full access, that's great!
Comment 16 Christoph Cullmann 2021-05-09 20:04:45 UTC
I tried the 21.04 package, that now has classic confinement, works for me nicely.

Thanks for taking care.

There are other small issues, like missing spell checking stuff, but I will open extra bugs for taht.