OmniSharp / omnisharp-sublime

C# IDE Plugin for Sublime Text 3
http://omnisharp-sublime.readthedocs.org/en/latest/
MIT License
551 stars 64 forks source link

Omnisharp launcher does not have executable permissions #140

Closed andzdroid closed 9 years ago

andzdroid commented 9 years ago

Maybe it's because I installed through package control, but the fix in 1.8.2 doesn't appear for me in the package. I needed to manually give executable permissions to the launcher otherwise it didn't run.

jchannon commented 9 years ago

@wbond may be able to help, pretty sure the file has executable permissions in the git repo

wbond commented 9 years ago

Package Control uses zip files, which don't store permissions in the archive.

Is some executable not starting via subprocess.Popen() without having permissions changed, or is this something executed via a terminal?

jchannon commented 9 years ago

Its calling out via sublime shell here https://github.com/OmniSharp/omnisharp-sublime/blob/master/lib/omnisharp.py#L212

jchannon commented 9 years ago

But the file needs chmod +x which it has in the repo so not sure if Package Control changes that or ignores those permissions

nosami commented 9 years ago

it needs +x ... but it sounds as if you can't rely on that because zip files don't preserve permissions.

On Mon, Mar 30, 2015 at 4:23 PM, Jonathan Channon notifications@github.com wrote:

But the file needs chmod -x which it has in the repo so not sure if Package Control changes that or ignores those permissions

— Reply to this email directly or view it on GitHub https://github.com/OmniSharp/omnisharp-sublime/issues/140#issuecomment-87721747 .

wbond commented 9 years ago

Well, as I mentioned above, Package Control downloads via zip files, and zip files don't store permissions.

Mostly likely you'll need to add some code to your initialization code to chmod the file if the permissions are wrong.

jchannon commented 9 years ago

@wbond yup that was my next plan using the new events in Package Control

axxxj commented 9 years ago

Not sure if this is a separate issue but after chmod the file it runs but as my solution file path has a space in it it seems to have a hissy fit.

Unhandled Exception: System.IO.FileNotFoundException: Could not find file "/Users/AJ/Unity".

The correct path should be "/Users/AJ/Unity Projects/_PROJECT NAME_/solution_file.sln"

I can put this a separate issue if that helps?

jchannon commented 9 years ago

If you look in the Sublime console what do you see when it tries to start the server with the -s argument

axxxj commented 9 years ago

It looks correct but is double quoted... -s ""/Users/AJ/Unity Projects/Superhero/Superhero-csharp.sln""

jchannon commented 9 years ago

Can you try removing the second quote to see if that makes a diff. You edit omnisharp.py in the packages folder via here

screen shot 2015-03-30 at 17 02 50

Quit Sublime and reopen to see if that makes a diff

axxxj commented 9 years ago

I should clarify that the original "Couldn't find file error" was being reported from the Show Server Output. But anyway I removed the double quotes and when I tried to type anything that would normally autocomplete I get this output in the console window:

already_bound_solution:"/Users/AJ/Unity Projects/Superhero/Superhero-csharp.sln" project file found response: "/Users/AJ/Unity Projects/Superhero/Superhero-csharp.sln" request: http://localhost:57770/autocomplete ======== request params ======== THIS PART WAS ALL THE UNITY GUBBINS THAT WAS MASSIVE SO I REMOVED IT Traceback (most recent call last): File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/connectionpool.py", line 529, in urlopen body=body, headers=headers) File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/connectionpool.py", line 334, in _make_request conn.request(method, url, _httplib_request_kw) File "./http/client.py", line 1065, in request File "./http/client.py", line 1103, in _send_request File "./http/client.py", line 1061, in endheaders File "./http/client.py", line 906, in _send_output File "./http/client.py", line 844, in send File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/connection.py", line 155, in connect conn = self._new_conn() File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/connection.py", line 134, in _new_conn (self.host, self.port), self.timeout, _extra_kw) File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/util/connection.py", line 87, in create_connection raise err File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/util/connection.py", line 78, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/omnisharp.py", line 38, in run response = http.urlopen('POST', url, body=data) File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/poolmanager.py", line 153, in urlopen response = conn.urlopen(method, u.request_uri, _kw) File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/connectionpool.py", line 595, in urlopen release_conn=release_conn, _response_kw) File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/connectionpool.py", line 595, in urlopen release_conn=release_conn, _response_kw) File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/connectionpool.py", line 595, in urlopen release_conn=release_conn, _response_kw) File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/connectionpool.py", line 575, in urlopen _pool=self, _stacktrace=stacktrace) File "/Users/AJ/Library/Application Support/Sublime Text 3/Packages/OmniSharp/lib/urllib3/util/retry.py", line 271, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) OmniSharp.lib.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=57770): Max retries exceeded with url: /autocomplete (Caused by ProtocolError('Connection aborted.', ConnectionRefusedError(61, 'Connection refused'))) ======== response ======== None None CALLBACK_ERROR

jchannon commented 9 years ago

Looks like the server isnt running.

I think I may have spotted a bug in Sublime

Can you close all files but keep the folder in your left hand pane.

Quit Sublime

Open Activity Monitor, make sure no mono-sgen processes are running.

Open Sublime, then open a cs file and click inside it, hopefully you'll now see a mono-sgen process in Activity Monitor, go back in to Sublime and try to get intellisense etc etc

axxxj commented 9 years ago

Ahhh sweet that worked, cheers :D

jchannon commented 9 years ago

Hmmm, I think this is something bizarre thats crept in with the latest Sublime update. May have to rethink some things in the plugin

karlgrz commented 9 years ago

Confirm this same behavior in linux (Ubuntu 14.04) with latest update from Package Control.

jchannon commented 9 years ago

If someone wants to do a PR for #138 then we can't do a new release

On Wednesday, 1 April 2015, Karl Grzeszczak notifications@github.com wrote:

Confirm this same behavior in linux (Ubuntu 14.04) with latest update from Package Control.

Reply to this email directly or view it on GitHub https://github.com/OmniSharp/omnisharp-sublime/issues/140#issuecomment-88634071 .

jchannon commented 9 years ago

Oops that was meant to say once that's done we can do a new release

On Wednesday, 1 April 2015, Jonathan Channon jonathan.channon@gmail.com wrote:

If someone wants to do a PR for #138 then we can't do a new release

On Wednesday, 1 April 2015, Karl Grzeszczak <notifications@github.com javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

Confirm this same behavior in linux (Ubuntu 14.04) with latest update from Package Control.

Reply to this email directly or view it on GitHub https://github.com/OmniSharp/omnisharp-sublime/issues/140#issuecomment-88634071 .

jchannon commented 9 years ago

the command we want is:

os.chmod('/PrebuiltOmniSharpServer/omnisharp', st.st_mode | 0111)

or it may be

os.chmod('/PrebuiltOmniSharpServer/omnisharp', st.st_mode | 0o111)

jchannon commented 9 years ago

OK, I've released a beta that hopefully addresses this.

Please edit your Package Control - User settings and add OmniSharp to the install_prereleases array to get the beta

Beta Release Notes here! https://t.co/IVLARJeKkO

jchannon commented 9 years ago

screen shot 2015-04-05 at 19 55 23

jchannon commented 9 years ago

This should be addressed with the 1.9.1 release.