ameyp / CscopeSublime

A Cscope plugin for Sublime Text 2 and 3
89 stars 37 forks source link

Cscope ERROR: ['cscope', '-dL', '-f', 'D:\\u\\cscope.out', '-1Set_TTT_k'] failed! #44

Closed qqquan closed 8 years ago

qqquan commented 9 years ago

I have problem using any find features in the plugin.

I have copied the win version of cscope to the windows directory. I have also used the -R argument to generate the database in the code base.


Sublime Text

Cscope ERROR: ['cscope', '-dL', '-f', 'D:\u\aaa\SandboxArea\CP1.51_O_P3\P3\cscope.out', '-1Set_TTT_k'] failed!

OK

haferburg commented 8 years ago

I ran into the same issue. I found a solution here. http://stackoverflow.com/a/28976131/872616

Replace the try-catch block in cscope.py:235 with this one:

try:
    proc = subprocess.Popen(cscope_arg_list, stdin=subprocess.PIPE, **popen_arg_list)
except OSError as e:
    if e.errno == errno.ENOENT:
        sublime.error_message(
            "Cscope ERROR: cscope binary \"%s\" not found!" % self.executable)
    else:
        sublime.error_message("OSError {}({}), Cscope ERROR: {} failed!"
            .format(e.errno, e.strerror, cscope_arg_list))
    return
vanrijn commented 8 years ago

Hey guys, I don't have a Windows environment to test in. Could you try something for me? Could you try adding stdin=subprocess.PIPE to the popen_arg_list instead of to the subprocess.Popen line? In other words, can you try this and tell me if it works?

        popen_arg_list = {
            "shell": False,
            "stdout": subprocess.PIPE,
            "stderr": subprocess.PIPE,
            "cwd": self.database.root
        }
        if (self.platform == "windows"):
            popen_arg_list["creationflags"] = 0x08000000
            popen_arg_list["stdin"] = subprocess.PIPE

        try:
            proc = subprocess.Popen(cscope_arg_list, **popen_arg_list)

Or does it actually need to be added to the subprocess.Popen call directly?

vanrijn commented 8 years ago

Okay, I think this should fix things for you guys. Please let me know if it does not. Thanks!!! =:)

ProgramCpp commented 7 years ago

I couldn't get it fixed with the package version v2016.07.07.21.43.02 (from package control). Please direct me to the right forum to discuss this further.

vanrijn commented 7 years ago

This is the right forum, @ProgramCpp. You're going to need to provide a lot more information for this discussion to be helpful though.

ProgramCpp commented 7 years ago

I am on x64 Windows7 enterprise and have Python 3.5, cScope from https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/cscope-win32/cscope-15.8a-win64rev1-static.zip, Sublime unregistered build 3126.

cscope database built with options -b -q cscope.sublime-package file not found under packages directory.

Hope this helps.