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: avante.nvim can't start inside ubuntu 22.04 arm64 #741

Closed
ghosert opened this issue Oct 21, 2024 · 6 comments
Closed

bug: avante.nvim can't start inside ubuntu 22.04 arm64 #741

ghosert opened this issue Oct 21, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@ghosert
Copy link
Contributor

ghosert commented Oct 21, 2024

Describe the bug

I saw the same issue with this one: #684

but it happens inside Ubuntu 22.04 arm64. It could be reproduced in the host Macbook M3 Pro or the host Android phone. Both hosts are ARM64 architectures, and the docker guest OS is Ubuntu 22.04 arm64.

Neovim inside guest os ubuntu 22.04 is built from neovim source code.

I eventually resolved this issue by building avante.nvim from source code inside guest OS like:

make BUILD_FROM_SOURCE=true

but would like to check if this could be avoided since compiling sources usually takes time.

To reproduce

  1. find a Macbook M chip-based machine
  2. Install docker and start a simple Ubuntu 22.04 docker container, by default this Ubuntu is arm64-based since the host is an M chip-based machine.
  3. Inside docker container, install neovim 0.10.1+ and avante.nvim
  4. You will see avante.nvim fails to start with the same error reported in bug: Error executing vim.schedule lua callback: ...ocal/share/nvim/lazy/avante.nvim/lua/avante/repo_map.lua:19: Failed to load avante_repo_map #684
  5. My guess is regardless of docker, the same issue may be reproduced in Ubuntu 22.04 arm64, please help double-check.

Expected behavior

avante.nvim should be able to start inside Ubuntu 22.04 arm64-based machine

Installation method

Use lazy.nvim:

{
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  opts = {
    -- add any opts here
  },
  -- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
  build = "make",
  -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  },
}

Environment

neovim: 0.10.1+, my neovim is installed from neovim source codes, not sure if the same error happens from apt install neovim
OS: Ubuntu 22.04 arm64

Repro

No response

@ghosert ghosert added the bug Something isn't working label Oct 21, 2024
@ghosert ghosert changed the title bug: avante.nvim can't start inside docker ubuntu 22.04 arm64 bug: avante.nvim can't start inside ubuntu 22.04 arm64 Oct 21, 2024
@yuchanns
Copy link
Collaborator

yuchanns commented Oct 21, 2024

The bug is confirmed: the Linux Aarch64 artifact downloaded from the release has the wrong architecture.

$ file avante_repo_map.so
avante_repo_map.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=7206c1188027a8a8e00385c612064599b9227481, not stripped

cargo build --release --features ${{ matrix.feature }}

The build script should specify the --target in an x86_64 host. Besides, to build Aarch Linux, gcc-aarch64-linux-gnu is required.

FYI: https://github.com/apache/opendal-go-services/blob/57c42a0fb656977bcbb5c60492528895e8826d30/.github/workflows/build_artifacts.yaml#L91 https://github.com/apache/opendal-go-services/blob/57c42a0fb656977bcbb5c60492528895e8826d30/.github/workflows/build_artifacts.yaml#L69

I could submit a change tomorrow.

cc @yetone

@yuchanns yuchanns self-assigned this Oct 21, 2024
@yuchanns
Copy link
Collaborator

yuchanns commented Oct 22, 2024

UPDATE
Well, there is a cross-compile issue. The tokenizers crate with http feature enabled depends on hf-hub, which depends on OpenSSL. OpenSSL has a well-known problem with cross-compilation.

FYI:

We can take a try on: 255doesnotexist/lintestor#22

@aarnphm
Copy link
Collaborator

aarnphm commented Oct 26, 2024

Hmm let me try to see if I can depend on tokio for tokenizers

@ghosert
Copy link
Contributor Author

ghosert commented Nov 5, 2024

This was reported for two weeks. I've mentioned it could be resolved by

make BUILD_FROM_SOURCE=true

but it's not an ideal solution.

Is this hard to resolve?

@yuchanns
Copy link
Collaborator

Closed since #909 is merged.

@ghosert
Copy link
Contributor Author

ghosert commented Nov 29, 2024

thanks the latest 0.0.12 fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants