yetone / avante.nvim

Use your Neovim like using Cursor AI IDE!
Apache License 2.0
7.1k stars 260 forks source link

bug: Build Timeout #674

Closed jeffcap1 closed 1 month ago

jeffcap1 commented 1 month ago

Describe the bug

Trying to install the latest version of Avante on my Intel Macbook Pro and the build is timing out. The build command I am using is: make BUILD_FROM_SOURCE=true.

When installing with Lazy I can see everything running as expected until it fails with the following output.

  Failed (1)
    ● avante.nvim 88.1ms  start
        cargo build --release --features=luajit -p avante-tokenizers
           Compiling proc-macro2 v1.0.86
           Compiling unicode-ident v1.0.12
           Compiling libc v0.2.158
           Compiling shlex v1.3.0
           Compiling cfg-if v1.0.0
           Compiling memchr v2.7.4
           Compiling autocfg v1.3.0
           Compiling serde v1.0.209
           Compiling pkg-config v0.3.30
           Compiling regex-syntax v0.8.4
           Compiling crossbeam-utils v0.8.20
           Compiling core-foundation-sys v0.8.7
           Compiling rustix v0.38.35
           Compiling strsim v0.11.1
           Compiling cc v1.1.21
           Compiling ident_case v1.0.1
           Compiling tinyvec_macros v0.1.1
           Compiling bitflags v2.6.0
           Compiling aho-corasick v1.1.3
           Compiling once_cell v1.19.0
           Compiling fnv v1.0.7
           Compiling tinyvec v1.8.0
           Compiling byteorder v1.5.0
           Compiling untrusted v0.9.0
           Compiling rustls-pki-types v1.8.0
           Compiling spin v0.9.8
           Compiling smallvec v1.13.2
           Compiling num-traits v0.2.19
           Compiling lock_api v0.4.12
           Compiling unicode-bidi v0.3.15
           Compiling adler2 v2.0.0
           Compiling rustls v0.23.12
           Compiling serde_json v1.0.127
           Compiling unicode-normalization v0.1.23
           Compiling native-tls v0.2.12
           Compiling rayon-core v1.12.1
           Compiling fastrand v2.1.1
           Compiling bit-vec v0.6.3
           Compiling lazy_static v1.5.0
           Compiling regex-automata v0.4.7
           Compiling percent-encoding v2.3.1
           Compiling ring v0.17.8
           Compiling parking_lot_core v0.9.10
           Compiling portable-atomic v1.7.0
           Compiling either v1.13.0
           Compiling idna v0.5.0
           Compiling quote v1.0.37
           Compiling syn v2.0.77
           Compiling onig_sys v69.8.1
           Compiling form_urlencoded v1.2.1
           Compiling crossbeam-epoch v0.9.18
           Compiling bit-set v0.5.3
           Compiling getrandom v0.2.15
           Compiling errno v0.3.9
           Compiling core-foundation v0.9.4
           Compiling security-framework-sys v2.11.1
           Compiling rand_core v0.6.4
           Compiling crossbeam-deque v0.8.5
           Compiling security-framework v2.11.1
           Compiling miniz_oxide v0.8.0
           Compiling crc32fast v1.4.2
           Compiling tempfile v3.12.0
           Compiling zeroize v1.8.1
           Compiling unicode-width v0.1.13
           Compiling ryu v1.0.18
           Compiling thiserror v1.0.63
           Compiling subtle v2.6.1
           Compiling typeid v1.0.2
           Compiling itoa v1.0.11
           Compiling log v0.4.22
           Compiling option-ext v0.2.0
           Compiling scopeguard v1.2.0
           Compiling paste v1.0.15
           Compiling mlua-sys v0.6.2 (https://github.com/mlua-rs/mlua.git?branch=main#1634c43f)
           Compiling dirs-sys v0.4.1
           Compiling regex v1.10.6
           Compiling darling_core v0.20.10
           Compiling console v0.15.8
           Compiling flate2 v1.0.33
           Compiling url v2.5.2
           Compiling esaxx-rs v0.1.10
           Compiling webpki-roots v0.26.5
           Compiling number_prefix v0.4.0
           Compiling minimal-lexical v0.2.1
           Compiling anyhow v1.0.86
           Compiling base64 v0.22.1
           Compiling nom v7.1.3
           Compiling indicatif v0.17.8
           Compiling parking_lot v0.12.3
           Compiling serde_derive v1.0.209
           Compiling zerocopy-derive v0.7.35
           Compiling thiserror-impl v1.0.63
           Compiling darling_macro v0.20.10
           Compiling zerocopy v0.7.35
           Compiling monostate-impl v0.1.13
           Compiling darling v0.20.10
           Compiling rayon v1.10.0
           Compiling derive_builder_core v0.20.1
           Compiling ppv-lite86 v0.2.20
           Compiling ordered-float v2.10.1
           Compiling dirs v5.0.1
           Compiling rand_chacha v0.3.1
           Compiling rustls-webpki v0.102.7
           Compiling bstr v1.10.0
           Compiling itertools v0.11.0
           Compiling derive_builder_macro v0.20.1
           Compiling rand v0.8.5
           Compiling base64 v0.13.1
           Compiling bitflags v1.3.2
           Compiling macro_rules_attribute-proc_macro v0.2.0
           Compiling unicode-segmentation v1.11.0
           Compiling macro_rules_attribute v0.2.0
           Compiling derive_builder v0.20.1
           Compiling mlua_derive v0.9.3 (https://github.com/mlua-rs/mlua.git?branch=main#1634c43f)
           Compiling fancy-regex v0.12.0
           Compiling fancy-regex v0.13.0
           Compiling rayon-cond v0.3.0
           Compiling itertools v0.12.1
           Compiling unicode-normalization-alignments v0.1.12
           Compiling rustc-hash v1.1.0
           Compiling base64 v0.21.7
           Compiling rustc-hash v2.0.0
           Compiling unicode_categories v0.1.1
           Compiling tiktoken-rs v0.5.9
           Compiling onig v6.4.0
           Compiling monostate v0.1.13
           Compiling spm_precompiled v0.1.4
           Compiling serde-value v0.7.0
           Compiling erased-serde v0.4.5
           Compiling mlua v0.10.0-beta.1 (https://github.com/mlua-rs/mlua.git?branch=main#1634c43f)
           Compiling ureq v2.10.1
           Compiling hf-hub v0.3.2
           Compiling tokenizers v0.20.0
           Compiling avante-tokenizers v0.1.0 (~/.local/share/nvim/lazy/avante.nvim/crates/avante-tokenizers)
            Finished `release` profile [optimized] target(s) in 1m 47s
        cp target/release/libavante_tokenizers.dylib build/avante_tokenizers.dylib
        cargo build --release --features=luajit -p avante-templates
           Compiling libc v0.2.158
           Compiling version_check v0.9.4
           Compiling v_htmlescape v0.15.8
           Compiling bstr v1.10.0
           Compiling syn v2.0.77
           Compiling unicode-ident v1.0.12
           Compiling aho-corasick v1.1.3
           Compiling self_cell v1.0.4
           Compiling memo-map v0.3.3
           Compiling unicase v2.7.0
           Compiling parking_lot_core v0.9.10
           Compiling parking_lot v0.12.3
           Compiling serde_derive v1.0.209
           Compiling mlua_derive v0.9.3 (https://github.com/mlua-rs/mlua.git?branch=main#1634c43f)
           Compiling serde v1.0.209
        make: *** [luajit-templates] Terminated: 15

        Process was killed because it reached the timeout

To reproduce

No response

Expected behavior

No response

Installation method

Use lazy.nvim:

local function check_architecture()
  -- Execute the 'uname -m' command to get the system architecture
  local handle = io.popen("uname -m")

  if handle == nil then
    return "Failed to execute 'uname -m'"
  end

  local architecture = handle:read("*a")
  handle:close()

  -- Trim any trailing whitespace from the output
  architecture = architecture:gsub("%s+", "")

  -- Check if the architecture is arm64 or x86_64
  if architecture == "arm64" then
    return "arm"
  elseif architecture == "x86_64" then
    return "intel"
  else
    return "Unknown architecture: " .. architecture
  end
end

local function get_build_function()
  local arch = check_architecture()
  if arch == "intel" then
    return "make BUILD_FROM_SOURCE=true"
  else
    return "make"
  end
end

local M = {
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  build = get_build_function(),
  dependencies = {
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
    --- The below dependencies are optional,
    "echasnovski/mini.icons",
    {
      -- support for image pasting
      "HakonHarnes/img-clip.nvim",
      event = "VeryLazy",
      opts = {
        -- recommended settings
        default = {
          embed_image_as_base64 = false,
          prompt_for_file_name = false,
          drag_and_drop = {
            insert_mode = true,
          },
          -- required for Windows users
          use_absolute_path = true,
        },
      },
    },
    {
      -- Make sure to set this up properly if you have lazy=true
      "MeanderingProgrammer/render-markdown.nvim",
      opts = {
        file_types = { "markdown", "Avante" },
      },
      ft = { "markdown", "Avante" },
    },
  },
}

M.opts = {
  provider = "gemini", -- Recommend using Claude
  -- auto_suggestions_provider = "copilot", -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot
  behaviour = {
    auto_suggestions = false, -- Experimental stage
    auto_set_highlight_group = true,
    auto_set_keymaps = true,
    auto_apply_diff_after_generation = false,
    support_paste_from_clipboard = false,
  },
  gemini = {
    -- @see https://ai.google.dev/gemini-api/docs/models/gemini
    model = "gemini-1.5-pro-exp-0827",
    -- model = "gemini-1.5-flash",
    temperature = 0,
    max_tokens = 4096,
  },
  mappings = {
    diff = {
      ours = "co",
      theirs = "ct",
      all_theirs = "ca",
      both = "cb",
      cursor = "cc",
      next = "]x",
      prev = "[x",
    },
    suggestion = {
      accept = "<M-y>",
      next = "<M-]>",
      prev = "<M-[>",
      dismiss = "<C-]>",
    },
    jump = {
      next = "]]",
      prev = "[[",
    },
    submit = {
      normal = "<CR>",
      insert = "<C-e>",
    },
    sidebar = {
      switch_windows = "<Tab>",
      reverse_switch_windows = "<S-Tab>",
    },
  },
}

return M

Environment

Neovim Version: NVIM v0.10.1 Build type: Release LuaJIT 2.1.1727621189

Platform: Darwin C02DX62LMD6P 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:44 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_X86_64 x86_64 i386 Darwin

Repro

No response

jeffcap1 commented 1 month ago

I saw a response in another bug ticket, bug: error after updating the plugin, referencing a possible fix in comment #612. I followed the steps there and that fixed the issue.