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

Add: target Linux ARM64 #53

Closed
matteocavestri opened this issue Mar 30, 2024 · 11 comments · Fixed by #54
Closed

Add: target Linux ARM64 #53

matteocavestri opened this issue Mar 30, 2024 · 11 comments · Fixed by #54
Labels
bug Something isn't working

Comments

@matteocavestri
Copy link

I'm using Fedora Asahi Remix and I'd like to use CodeSnap on Linux ARM64.
There are other problems, maybe I'm doing something wrong:

  • code_font_family = "JetBrainsMono Nerd Font" doesn't work (I have installed it and I use it)
  • mac_window_bar = false doesn't work

This is my config:

local home = os.getenv "HOME"
...
  {
    "mistricky/codesnap.nvim",
    build = "make",
    version = "^1",
    lazy = "true",
    cmd = {
      "CodeSnap",
      "CodeSnapSave",
    },
    config = function()
      require("codesnap").setup {
        title = "CodeSnap.nvim",
        -- code_font_family = "CaskaydiaCove Nerd Font",
        code_font_family = "JetBrainsMono Nerd Font",
        mac_window_bar = false,
        has_breadcrumbs = true,
        bg_theme = "default",
        save_path = home .. "/.snap.png",
        watermark_font_family = "Pacifico",
        watermark = "Matteo Cavestri",
      }
    end,
  },

On x86 I only have that problems.
Here an example:
snap

Thanks all

@mistricky
Copy link
Owner

Hi there, thx for report this issue. For add arm64 compile target, you can use make build_generator build command to build current target from source:

{ "mistricky/codesnap.nvim", version = "^1", build = "make"}

But I will consider add it into cross-compile config in the future if it's necessary.

The problem about "mac_window_bar" does not work has fix by #54, but I can't reproduce the "code_font_family" not work bug, they works fine on my machine (x86_64 Arch Linux with wayland session).

Hack Nerd Font

{
  code_font_family = "Hack Nerd Font",
  save_path = "~/Pictures/foo.png",
  bg_theme = "bamboo",
}

foo

PingFang

{
  code_font_family = "PingFang",
  save_path = "~/Pictures/foo.png",
  bg_theme = "bamboo",
}

foo

CaskaydiaCove Nerd Font

{
  code_font_family = "CaskaydiaCove Nerd Font",
  save_path = "~/Pictures/foo.png",
  bg_theme = "bamboo",
}

foo

@matteocavestri
Copy link
Author

Thanks for your reply

  • The issue about the font was my fault (I use Nerd Font, but only the necessary ones). Now I have installed the whole family and it works, I'm sorry.
  • I will wait for v1.1.2 (probably?) to see [Fix] condition render for mac window bar component #54 solved, thanks for your reply.
  • I think cross-compile on linux arm64 is useful because of Asahi Linux (Apple SIlicon) and Snapdragon X Elite in the future. I think Linux on ARM will become more relevant in the future.

Now I'm doing some testing and there are some problems on codesnap during install using lazy:

{
    "mistricky/codesnap.nvim",
    build = "make",
    version = "^1",   
}

Using this config I got this error during the install (x86), but after a neovim restart CodeSnap works as intended. Do you have any ideas on this problem?

Failed to source `/home/matteocavestri/.local/share/nvim/lazy/codesnap.nvim/plugin/codesnap.lua`

vim/_editor.lua:0: nvim_exec2()../home/matteocavestri/.local/share/nvim/lazy/codesnap.nvim/plugin/codesnap.lua: Vim(source):E5113: Error while calling lua chunk: ...ocal/share/nvim/lazy/codesnap.nvim/lua/codesnap/init.lua:3: module 'generator' not found:
	no field package.preload['generator']
cache_loader: module generator not found
cache_loader_lib: module generator not found
	no file './generator.lua'
	no file '/usr/share/luajit-2.1/generator.lua'
	no file '/usr/local/share/lua/5.1/generator.lua'
	no file '/usr/local/share/lua/5.1/generator/init.lua'
	no file '/usr/share/lua/5.1/generator.lua'
	no file '/usr/share/lua/5.1/generator/init.lua'
	no file './generator.so'
	no file '/usr/local/lib/lua/5.1/generator.so'
	no file '/usr/lib64/lua/5.1/generator.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
	[C]: in function 'require'
	...ocal/share/nvim/lazy/codesnap.nvim/lua/codesnap/init.lua:3: in main chunk
	[C]: in function 'require'
	....local/share/nvim/lazy/codesnap.nvim/plugin/codesnap.lua:1: in main chunk
	[C]: in function 'nvim_exec2'
	vim/_editor.lua: in function 'cmd'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:485: in function <...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:484>
	[C]: in function 'xpcall'
	.../.local/share/nvim/lazy/lazy.nvim/lua/lazy/core/util.lua:113: in function 'try'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:484: in function 'source'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:443: in function 'source_runtime'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:411: in function 'packadd'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:346: in function '_load'
	...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:191: in function 'load'
	...hare/nvim/lazy/lazy.nvim/lua/lazy/manage/task/plugin.lua:29: in function <...hare/nvim/lazy/lazy.nvim/lua/lazy/manage/task/plugin.lua:26>
	[C]: in function 'pcall'
	.../share/nvim/lazy/lazy.nvim/lua/lazy/manage/task/init.lua:70: in function 'start'
	.../share/nvim/lazy/lazy.nvim/lua/lazy/manage/task/init.lua:65: in function <.../share/nvim/lazy/lazy.nvim/lua/lazy/manage/task/init.lua:64>

# stacktrace:
  - vim/_editor.lua:0 _in_ **cm

Thanks all

@mistricky mistricky linked a pull request Apr 1, 2024 that will close this issue
@mistricky
Copy link
Owner

mistricky commented Apr 2, 2024

module generator not found

Hi @matteocavestri Can you show what output of uname -m?

@matteocavestri
Copy link
Author

The last issue appears on x86_64

  • uname -m --> x86_64
  • uname -r --> 6.7.7-200.t2.fc39.x86_64

On apple silicon I'll start to use codesnap after cross compile on Linux ARM64

@mistricky mistricky added the bug Something isn't working label Apr 2, 2024
@mistricky
Copy link
Owner

Hey @matteocavestri, thx for report this bug, I fix it in latest version, you can install the CodeSnap.nvim to v1.1.5 and try again, If still have this bug, please tell me

@matteocavestri
Copy link
Author

Thanks for your support @mistricky
In the last version (v1.1.5) this bug is resolved and now on x86 everything is perfect.

If you want to add ARM64 into cross-compile I,ll wait for an update. If you want I can contribute to the project to make it cross-compile on Linux ARM64. (I'm not so good in rust, but I'm learning it)

@matteocavestri
Copy link
Author

@mistricky I've read #58.
You can add to the build_generator docs some deps.
In order to compile on ARM I need:

export CC=gcc
sudo dnf install libuv libuv-devel # On RHEL based systems
sudo apt-get install libtool libuv1-dev # On Debian based systems

@mistricky
Copy link
Owner

mistricky commented Apr 2, 2024

Hi @matteocavestri, thx for your reply.

If you want to add ARM64 into cross-compile I,ll wait for an update.

Maybe not now, as #58 says I don't wanna add too many cross-compilation target for now.

You can add to the build_generator docs some deps.

That's great idea, I'll add it in README later.

@matteocavestri
Copy link
Author

Thanks @mistricky
I consider this issue closed

@mistricky
Copy link
Owner

Okay Thank u for this issue report again :)

@mistricky
Copy link
Owner

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

Successfully merging a pull request may close this issue.

2 participants