Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
606 stars 28 forks source link

fs.fnl: Support platforms which appear to not use luajit #122

Closed nickwanninger closed 2 years ago

nickwanninger commented 2 years ago

This patch simply updates the path-sep logic to follow the code referenced in the comment. This is required for aniseed to function correctly in my aarch64 ubuntu virtual machine.

Olical commented 2 years ago

Ohh interesting. So then you can require some of this outside of nvim / luajit? I'll take a look when I get home this evening.

Olical commented 2 years ago

Hmm am I right in saying this alternate method you added works for JIT too? Why don't we just use (package.config:sub 1 1) for all environments?

Olical commented 2 years ago

Can someone run package.config:sub(1, 1) on Windows for me and tell me if it returns \?

nickwanninger commented 2 years ago

Unfortunately I don't have a windows machine setup to test.

This patch was mainly to support gettng aniseed working in my ubuntu 20.04 vm, which I think had an old version of neovim pre luajit (~v0.4.3). I ended up compiling neovim from source and it solved the problem (v0.8.0). All depends on if you want to support ancient neovims :)

Olical commented 2 years ago

I think I'll close this! I'm pretty sure I depend on other features that require you to have a newer neovim, maybe around floating windows which are pretty core to the UX. So for now, I'll close this. But if I get people raising issues about this same thing where everything else should be supported I'll revisit this change. Thank you for the submission!

ghost commented 1 year ago

@Olical I think this PR would fix a bug I'm seeing trying to run Conjure on a Mac M1 inside Docker for Ubuntu 2210, where neovim 0.7.2 comes with Lua not LuaJIT because LuaJIT isn't supported on aarch64 (ie arm64).

:version                                                                                                                                                       
NVIM v0.7.2                                                                                                                                                    
Build type: Release                                                                                                                                            
Lua 5.1                                                                                                                                                        
Compiled by team+vim@tracker.debian.org                                                                                                                        

Features: +acl +iconv +tui                                                                                                                                     
See ":help feature-compile"                                                                                                                                    

   system vimrc file: "$VIM/sysinit.vim"                                                                                                                       
  fall-back for $VIM: "/usr/share/nvim"                                                                                                                        

Run :checkhealth for more info                     

The bug I'm seeing is the following (when opening a Clojure file for example)

                    Error detected while processing FileType Autocommands for "clojure":                                                                       
E5108: Error executing lua ...me/vu/.vim/bundle/conjure/lua/conjure/aniseed/fs.lua:50: attempt to index global 'jit' (a nil value)                             
stack traceback:                                                                                                                                               
        ...me/vu/.vim/bundle/conjure/lua/conjure/aniseed/fs.lua:50: in main chunk                                                                              
        [C]: in function 'require'                                                                                                                             
        ....vim/bundle/conjure/lua/conjure/aniseed/autoload.lua:19: in function 'ensure'                                                                       
        ....vim/bundle/conjure/lua/conjure/aniseed/autoload.lua:28: in function <....vim/bundle/conjure/lua/conjure/aniseed/autoload.lua:27>                   
        ...u/.vim/bundle/conjure/lua/conjure/aniseed/fennel.lua:20: in function 'sync_rtp'                                                                     
        ...u/.vim/bundle/conjure/lua/conjure/aniseed/fennel.lua:43: in function 'impl'                                                                         
        /home/vu/.vim/bundle/conjure/lua/conjure/client.lua:62: in function </home/vu/.vim/bundle/conjure/lua/conjure/client.lua:61>                           
        (tail call): ?                                                                                                                                         
        /home/vu/.vim/bundle/conjure/lua/conjure/client.lua:167: in function 'get'                                                                             
        /home/vu/.vim/bundle/conjure/lua/conjure/client.lua:180: in function </home/vu/.vim/bundle/conjure/lua/conjure/client.lua:179>                         
        (tail call): ?                                                                                                                                         
        [string ":lua"]:1: in main chunk