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

Add support for FreeBSD #6

Open
jan0sch opened this issue Jan 21, 2019 · 21 comments
Open

Add support for FreeBSD #6

jan0sch opened this issue Jan 21, 2019 · 21 comments

Comments

@jan0sch
Copy link

jan0sch commented Jan 21, 2019

Hi,

I just tried metals with neovim on FreeBSD 11.2 and got the following error message:

[lsc:Error] StdErr from metals-vim: ^@(<unknown>:22541): GVFS-RemoteVolumeMonitor-WARNING **: 10:3...List is not implemented on interface org.gtk.Private.RemoteVolumeMonitor (g-dbus-error-quark, 19)^@

The rest seems to work but navigation (goto definition) does not.

Environment

I'm using metals 0.3.3.

% freebsd-version -ku
11.2-RELEASE-p8
11.2-RELEASE-p8
% pkg info -E neovim
neovim-0.3.2
% pkg info | grep -i ^gtk
gtk12-1.2.10_27                Gimp Toolkit for X11 GUI (previous stable version)
gtk2-2.24.32                   Gimp Toolkit for X11 GUI (previous stable version)
gtk3-3.22.30_4                 Gimp Toolkit for X11 GUI (current stable version)
@gabro
Copy link
Member

gabro commented Jan 21, 2019

Hi @jan0sch, thanks for reporting!

Do logs say anything useful? (see https://scalameta.org/metals/docs/contributors/getting-started.html#workspace-logs)

@jan0sch
Copy link
Author

jan0sch commented Jan 21, 2019

No, looked good. Here it is just in case.

I am also not sure if it is directly related to metals or the vim-lsc plugin. 🤔

Jan 21, 2019 10:34:59 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.6.5.Final
Jan 21, 2019 10:34:59 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.6.5.Final
Jan 21, 2019 10:34:59 AM org.jboss.threads.Version <clinit>
INFO: JBoss Threads version 2.3.0.Beta2
INFO  Started Metals http server at http://127.0.0.1:5031
INFO  The server is listening for incoming connections at local:///tmp/bsp1082522203047515795/-1an0obv9tnq7z.socket...
INFO  tracing is disabled for protocol BSP, to enable tracing of incoming and outgoing JSON messages create an empty file at ~/.cache/metals/bsp.trace.json
INFO  time: connected to build server in 0,53s
INFO  Accepted incoming BSP client connection at local:///tmp/bsp1082522203047515795/-1an0obv9tnq7z.socket
INFO  request received: build/initialize
INFO  BSP initialization handshake complete.
INFO  time: imported workspace in 3,08s

@gabro
Copy link
Member

gabro commented Jan 21, 2019

Looks look fine on the Metals side. Judging by the error you get, it seems like a vim-lsc issue, possibly related to the NeoVim integration.

You can maybe try with a vanilla vim installation and see whether you have the same issue.

In any case, I suggest you ask in https://github.com/natebosch/vim-lsc

@jan0sch
Copy link
Author

jan0sch commented Jan 21, 2019

Thanks, I'll try it there.

@jan0sch jan0sch closed this as completed Jan 21, 2019
@olafurpg
Copy link
Member

Thanks for reporting. Metals is not tested/used on FreeBSD so there might be some issues we're not aware of. Can you try to validate if Metals works in vscode first? There can be many reason why navigation doesn't work, I recommend running the doctor to see if there are any recommendation.

@olafurpg olafurpg reopened this Jan 21, 2019
@jan0sch
Copy link
Author

jan0sch commented Jan 21, 2019

With vscode it doesn't seem to work at all. However the vscode ports to FreeBSD are unofficial as far as I understand. 🤔

@olafurpg
Copy link
Member

How about Atom? I'm not so familiar with FreeBSD, are there differences for JDK-related applications I should be aware of? Does IntelliJ work?

@jan0sch
Copy link
Author

jan0sch commented Jan 21, 2019

IntelliJ and other java stuff works fine. But there are problems with atom, vscode, lighttable etc. Therefore I can only use unofficial builds for these.
So far I had not trouble but I want migrate from ensime to metals because for the most time I'm using vim/neovim.

@olafurpg
Copy link
Member

Metals uses native libraries for system processes (via nuprocess) and file watching (via directory-watcher). Could that be an issue?

@olafurpg
Copy link
Member

We also use java.awt.Desktop.getDesktop.browse(URI.create(url)) if you click on "Learn more" or "More information" in the doctor dialogues

@jan0sch
Copy link
Author

jan0sch commented Jan 21, 2019

The GVFS part seems to indicate that. Could you give me a pointer to the relevant code sections?
I will take a deeper look when I've some time.

@jan0sch
Copy link
Author

jan0sch commented Jan 21, 2019

For reference: The same error message appeared in the following issue: kpeeters/cadabra2#12

@olafurpg
Copy link
Member

Another native component we use is local UNIX domain sockets to communicate with the build server.

@olafurpg
Copy link
Member

Here's where we open a URL https://github.com/scalameta/metals/blob/e6424034e832e2eee95e6b341643a24331ac1f72/metals/src/main/scala/scala/meta/internal/metals/Urls.scala#L28

It's only executed if you select "learn more" in a dialogue. You can test local changes with publishLocal and update the coursier bootstrap command to use 0.4.0-SNAPSHOT (or version published).

@jan0sch
Copy link
Author

jan0sch commented Jan 22, 2019

After digging around a bit I think that it is likely caused by nuprocess so I'm going to investigate it.

@olafurpg olafurpg changed the title metals-vim: List is not implemented in gtk error Add support for FreeBSD Jan 22, 2019
@jan0sch
Copy link
Author

jan0sch commented Jan 22, 2019

Note: The same error occures on FreeBSD 12.

@olafurpg
Copy link
Member

@jan0sch I'm gonna move this issue to the metals-feature-requests issue tracker since we don't officially support FreeBSD. I'm happy to help you fix this issue, but even if this issue gets fixed our CI does not run tests on FreeBSD to prevent regressions in the future.

@olafurpg olafurpg transferred this issue from scalameta/metals Jan 24, 2019
@jan0sch
Copy link
Author

jan0sch commented Jan 26, 2019

For reference:

Got a more complete error message this time:

[lsc:Error] StdErr from metals-vim: 
^@(<unknown>:87111): GVFS-RemoteVolumeMonitor-WARNING **: 
09:44:59.532: invoking List() failed for type GProxyVolumeMonitorHal: 
GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: 
Method List is not implemented on interface org.gtk.Private.RemoteVolumeMonitor (g-dbus-error-quark, 19)^@

There is also another one indicating that maybe the error stems from some python stuff:

[lsc:Error] Error dispatching message: 'Vim(call):E728: Dictionary als Number verwendet'

@olafurpg
Copy link
Member

@mdedetrich
Copy link

@olafurpg Does it make sense to try and remove all python (and other interpreter?) commands from bloop/metals to make sure its as portable as possible?

I think for these kind of tools we should have a hard requirements of either only using shell standard tools or java.

@jan0sch
Copy link
Author

jan0sch commented Sep 5, 2019

An update from my side. I tried the current metals (0.7.2) with neovim 0.3.8 and current coc.nvim under FreeBSD 12.
Although I get some warnings about build configuration it seems to work. I did not test everything though. Sometimes a doHover or find references doesn't seem to do anything (also no error in the logs) but in general I'd say that it works. 👍
By the way: Many thanks for putting your effort into this. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants