-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Building lua-tiktoken on Windows #397
Comments
I will add Windows as a target to the release task in https://github.com/gptlang/lua-tiktoken |
We should steal their whole makefile: https://github.com/yetone/avante.nvim/blob/main/Makefile |
@deathbeam did you know we can do
in |
https://github.com/gptlang/lua-tiktoken/releases (got windows down) |
I got it working with Not quite sure what the equivalent is in Windows |
This file was used by
param (
[string]$Version = "luajit"
)
$BuildDir = "build"
$BuildFromSource = $true
function Build-FromSource($feature) {
if (-not (Test-Path $BuildDir)) {
New-Item -ItemType Directory -Path $BuildDir | Out-Null
}
$tempDir = Join-Path $BuildDir "lua-tiktoken-temp"
git clone --branch v0.2.2 --depth 1 https://github.com/gptlang/lua-tiktoken.git $tempDir
Push-Location $tempDir
cargo build --features=$feature
Pop-Location
$targetFile = "tiktoken_core.dll"
Copy-Item (Join-Path $tempDir "target\debug\tiktoken_core.dll") (Join-Path $BuildDir $targetFile)
Remove-Item -Recurse -Force $tempDir
}
function Main {
Write-Host "Building for $Version..."
Build-FromSource $Version
}
# Run the main function
Main |
I tested the build on Windows 11 with this plugin config: ...
build = vim.fn.has("win32") == 1 and "powershell -ExecutionPolicy Bypass -File Build-LuaTiktoken.ps1" or "make"
... and it worked. |
This script may be useful, and also implementable on
CopilotChat.nvim
:yetone/avante.nvim@83d0676
The text was updated successfully, but these errors were encountered: