-
Notifications
You must be signed in to change notification settings - Fork 659
chore: deprecate require'avante_lib'.load() #2354
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
base: main
Are you sure you want to change the base?
Conversation
local os_name = require("avante.utils").get_os_name() | ||
local ext = os_name == "linux" and "so" or (os_name == "darwin" and "dylib" or "dll") | ||
local dirname = string.sub(debug.getinfo(1).source, 2, #"/avante_lib.lua" * -1) | ||
return dirname .. ("../build/?.%s"):format(ext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing build
to lua
might solve the issue of darwin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will fix it but it is still extra-code just for darwin. What I've pushed, is instead renamed the .dynlib to .so. From what I read from darwin users, it should work but I would like someone to confirm this.
@@ -48,7 +48,7 @@ $(foreach lua_version,$(LUA_VERSIONS),$(eval $(call make_definitions,$(lua_versi | |||
define build_package | |||
$1-$2: | |||
cargo build --release --features=$1 -p avante-$2 | |||
cp target/release/libavante_$(shell echo $2 | tr - _).$(EXT) $(BUILD_DIR)/avante_$(shell echo $2 | tr - _).$(EXT) | |||
cp target/release/libavante_$(shell echo $2 | tr - _).$(EXT) $(BUILD_DIR)/avante_$(shell echo $2 | tr - _).so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we rename to .so
even on darwin such that neovim can find the library without extra code
mark it as deprecated to avoid breaking user configs but it is now a noop (does nothing). Updated README to reflect changes in yetone#2324
…e#2324)" (yetone#2353)" This reverts commit e2d160a.
the default LUA_CPATH for interpreters look at .so files but not at .dynlib files which is one of mac's extension. Looking at neovim/neovim#21749 seems like the libraries on darwin could also use the .so extension
Tested locally with a barebones config installing it with Lazy from this PR branch. Having never used the command before, it was a bit weird to see absolutely no UI feedback to whether it was working, or not. I had to check my |
thanks for testing. Your test showed I dont handle the downloading libraries yet. Once I fix that, we should be good to go o/ |
mark it as deprecated to avoid breaking user configs but it is now a noop (does nothing). Updated README to reflect changes in #2324
linked PR got reverted in #2353