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

[BUG] Chat Install with Cargo fails #96

Closed
aemonge opened this issue Jul 26, 2023 · 22 comments
Closed

[BUG] Chat Install with Cargo fails #96

aemonge opened this issue Jul 26, 2023 · 22 comments

Comments

@aemonge
Copy link

aemonge commented Jul 26, 2023

Describe the bug
Install fails with this error:

  cargo:warning=`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" "pkg-config" "--libs" "--cflags" "javascriptcoregtk-4.1" "javas
criptcoregtk-4.1 >= 2.38"` did not exit successfully: exit status: 1
  error: could not find system library 'javascriptcoregtk-4.1' required by the 'javascriptcore-rs-sys' crate

  --- stderr
  Package javascriptcoregtk-4.1 was not found in the pkg-config search path.
  Perhaps you should add the directory containing `javascriptcoregtk-4.1.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'javascriptcoregtk-4.1', required by 'virtual:world', not found
  Package 'javascriptcoregtk-4.1', required by 'virtual:world', not found

To Reproduce
Version:

❯ rustc --version
rustc 1.71.0 (8ede3aae2 2023-07-12)

Steps to reproduce the behavior:

  1. cd ~/.local/share/nvim/lazy/tabnine-nvim/chat
  2. cargo build --release

Expected behavior
A clear and concise description of what you expected to happen.

Version Info:

@aarondill
Copy link
Contributor

You're missing the system library javascriptcoregtk-4.1.
On Ubuntu this is in the package libjavascriptcoregtk-4.1-dev, on arch, I think it's in the javascriptcoregtk-4.1 package, if you're using another disto, just Google your disto and the name of the library

@aemonge
Copy link
Author

aemonge commented Jul 27, 2023

It has been built!

But, I can't see it nor open it:

:TabnineChat<cr>
>>> Nothing happens
:TabnineChatNew
>>> 2023-07-27T11:59:07  WARN tabnine chat not found, did you remember to start it first?

I did got access to the chat-alpha, through email

@aemonge
Copy link
Author

aemonge commented Jul 27, 2023

As a reference to any other archie it's:

pacman -S webkit2gtk-4.1

@aarondill
Copy link
Contributor

Just to cover all the bases, are you running this in a DE/WM? Ie, are you capable of displaying visual windows?

@aemonge
Copy link
Author

aemonge commented Jul 31, 2023

KDE Plasma, with Konsole

@aemonge
Copy link
Author

aemonge commented Jul 31, 2023

New output:

2023-07-31T12:31:28  WARN Something went wrong running Tabnine chat (signal 5)

@aarondill
Copy link
Contributor

Signal 5 is SIGTRAP. That's extremely unusual. @amirbilu do you have any idea what's going on here?

@aarondill
Copy link
Contributor

This could also be exit 133? since exit codes over 128 are generally interpreted as a signal

@aarondill
Copy link
Contributor

could you please post the output of this:

> ~/.local/share/nvim/lazy/tabnine-nvim/chat/target/release/tabnine_chat; echo "Exit: $?"

@aemonge
Copy link
Author

aemonge commented Aug 1, 2023

Sure:

❯ ~/.local/share/nvim/lazy/tabnine-nvim/chat/target/release/tabnine_chat; echo "Exit: $?"
Exit: 0

@aarondill
Copy link
Contributor

aarondill commented Aug 1, 2023

Please try applying this patch(patch.txt) with git apply patch.txt and posting the output after running :TabnineChat.

Note: there will likely be a lot of output.
Note: there will almost definitely be identifying information and/or access tokens (to access your github avatar). I highly recommend checking the output for any of this information and censoring it.

@aemonge
Copy link
Author

aemonge commented Aug 1, 2023

❯ git st
HEAD detached at 1837949
nothing to commit, working tree clean
❯ git apply ~/desktop/patch.txt
❯ git st
HEAD detached at 1837949
nothing to commit, working tree clean
❯ ./target/release/tabnine_chat

And no log when :TabnineChat

I've turned off most of my plugins leaving only:

  Loaded (4)
    ● lazy.nvim 6.06ms   init.lua
    ● project.nvim 6.16ms  start
    ● tabnine-nvim 6.25ms   javascript
    ● which-key.nvim 3.17ms  start

With this lazy vim configuration for tabnine-nvim:

table.insert(M, {
    'codota/tabnine-nvim',
    ft = require("file-types")({
        "languages",
        "frameworks",
        "markup"
    }),
    build = "./dl_binaries.sh",
    config = function()
        require('tabnine').setup({
            disable_auto_comment = true,
            accept_keymap = "<C-l>",
            dismiss_keymap = "<C-c>",
            debounce_ms = 300,
            suggestion_color = { gui = "#916690" }, -- #8787D7" }, -- color104
            exclude_filetypes = { "TelescopePrompt" },
            plugins = {
                cmp = true
            }
        })

        require("which-key").register({
            c = { require("tabnine.chat").open, "Chat with tabnine"}
        }, {
          mode = {"i", "n", "x"},
          prefix = "<leader>",
          buffer = nil,
          silent = true,
          noremap = true,
          nowait = true,
        })
    end
})

Creating a new window:

:TabnineChatNew     
tabnine chat not found, did you remember to start it first?
tabnine chat not found, did you remember to start it first?
tabnine chat not found, did you remember to start it first?
Press ENTER or type command to continue

Checking status:

:TabnineStatus      
⌬ tabnine pro
Press ENTER or type command to continue

@aemonge
Copy link
Author

aemonge commented Aug 1, 2023

Okey, I think we have advanced:

Tabnine Chat is available only for preview users

I though, due to the email I was a preview user.

I had to run it with my which-key:

            c = { require("tabnine.chat").open, "Chat with tabnine"}

Since :TabnineChat provided no ouptut.

@aemonge aemonge closed this as completed Aug 1, 2023
@aarondill
Copy link
Contributor

> git apply ~/desktop/patch.txt
> git st
HEAD detached at 1837949
nothing to commit, working tree clean

This shouldn't say nothing to commit. This should say

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   lua/tabnine/chat/binary.lua

no changes added to commit (use "git add" and/or "git commit -a")

Would you mind double checking the patch downloaded correctly with cat ~/desktop/patch.txt?

@aemonge
Copy link
Author

aemonge commented Aug 1, 2023

❯ cat ~/desktop/patch.txt
diff --git a/lua/tabnine/chat/binary.lua b/lua/tabnine/chat/binary.lua
index 08ff044..35e4d86 100644
--- a/lua/tabnine/chat/binary.lua
+++ b/lua/tabnine/chat/binary.lua
@@ -67,6 +67,7 @@ function ChatBinary:start()
                if chunk then
                        for _, line in pairs(utils.str_to_lines(chunk)) do
                                local message = vim.json.decode(line)
+                               vim.notify("From program: \n" .. vim.inspect(message))
                                local handler = self.registry[message.command]
                                if handler then
                                        handler(message.data, function(payload)
@@ -102,6 +103,7 @@ end
 
 function ChatBinary:post_message(message)
        if self.stdin then
+               vim.notify("To program:\n" .. vim.inspect(message))
                uv.write(self.stdin, json.encode(message) .. "\n")
        else
                vim.notify("tabnine chat not found, did you remember to start it first?", vim.log.levels.WARN)
❯ git apply ~/desktop/patch.txt
❯ git st
HEAD detached at 1837949
nothing to commit, working tree clean

@aarondill
Copy link
Contributor

Okey, I think we have advanced:

Tabnine Chat is available only for preview users

I though, due to the email I was a preview user.

I had to run it with my which-key:

            c = { require("tabnine.chat").open, "Chat with tabnine"}

Since :TabnineChat provided no ouptut.

well, that seems promising at least. I wonder why :TabnineChat didn't show that output though

@aarondill
Copy link
Contributor

Plus, the Tabnine Chat should've never started if you weren't in the preview (thusly avoiding theWARN Something went wrong running Tabnine chat (signal 5))

@aarondill
Copy link
Contributor

I must say, I'm confused here. Let me know if joining the preview fixes the problem...

@aemonge
Copy link
Author

aemonge commented Aug 1, 2023

I am happy to keep debugging with you, just let me know what to execute ;)

I've just emailed join the enabled list, and will let you know.

@aemonge
Copy link
Author

aemonge commented Aug 1, 2023

It's working !!!

As a suggestion, would be nice to have it interfaced it in vim, or at least readinput set mode vi.

Anyhow, I'm keen to move my conversation from chatGPT towards tabnine-chat :)

@aarondill
Copy link
Contributor

As a suggestion, would be nice to have it interfaced it in vim, or at least readinput set mode vi.

Sadly, the Tabnine chat is developed in a separate (private) repo, so while I would also love this feature, this isn't the right place for feature requests. The best I can offer is #92, or else send an email to the support team?

@aemonge
Copy link
Author

aemonge commented Aug 2, 2023

Done 😉 #92 (comment)

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

2 participants