-
Notifications
You must be signed in to change notification settings - Fork 9
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
Build neovim nightly on download failure #18
Build neovim nightly on download failure #18
Conversation
core.debug(`Building and installing Neovim to ${installDir}.`); | ||
const dir = path.join(await makeTmpdir(), 'neovim'); | ||
|
||
await exec('git', ['clone', '--depth=1', 'https://github.com/neovim/neovim', dir]); |
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'd be better to install dependencies in this function so that user don't always need to install them. Installing packages via apt-get takes time because many network requests happen. I think avoiding them as much as possible would be great.
await exec('sudo', ['apt-get', 'install', '-y', 'ninja-build', 'gettext', 'libtool', 'libtool-bin', 'autoconf', 'automake', 'cmake', 'g++', 'pkg-config', 'unzip', 'curl']);
src/install_linux.ts
Outdated
try { | ||
return downloadNeovim(config.version, 'linux'); | ||
} catch (e) { | ||
core.debug(`Neovim download failure: ${e.message}.`); |
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.
core.debug(`Neovim download failure: ${e.message}.`); | |
const err = ensureError(e); | |
core.debug(`Neovim download failure: ${err.message}.`); |
ensureError()
is necessary to make TypeScript compiler happy.
src/neovim.ts
Outdated
await exec('git', ['clone', '--depth=1', 'https://github.com/neovim/neovim', dir]); | ||
|
||
const opts = { cwd: dir }; | ||
await exec('make', ['-j', `CMAKE_EXTRA_FLAGS=-DCMAKE_INSTALL_PREFIX=${installDir}`], opts); |
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.
await exec('make', ['-j', `CMAKE_EXTRA_FLAGS=-DCMAKE_INSTALL_PREFIX=${installDir}`], opts); | |
await exec('make', ['-j', `CMAKE_EXTRA_FLAGS=-DCMAKE_INSTALL_PREFIX=${installDir}`, 'CMAKE_BUILD_TYPE=RelWithDebug'], opts); |
Please add CMAKE_BUILD_TYPE
. Otherwise it builds Neovim in debug mode.
Neovim nightly downloads are currently very flaky. This is not caused by Neovim's build being broken but by the github actions uploading the build artifacts to github encountering issues.
Thank you for the updates. Looks good now. |
I'll add some small follow up (e.g. add tests) |
I confirmed all fallback logics worked fine by throwing an exception from `downloadNeovim()` function temporarily. Jobs installing Neovim nightly on Linux and macOS could fallback to building Neovim from source. https://github.com/rhysd/action-setup-vim/runs/3767376843?check_suite_focus=true
I added tests for this. And I also added the similar logic for macOS. Now it can fallback to building Neovim from source on macOS also. |
Great, thank you for taking care of all this - I planned on doing it myself but had little time to do it :). |
This feature was included in new release v1.2.8. |
I can confirm that it works! https://github.com/glacambre/firenvim/pull/1211/checks?check_run_id=3776936017#step:9:15 Thanks a lot for this wonderful action :). |
Yes, Neovim nightly release failed yesterday actually so we can confirm the fallback logic works fine 💯 |
As described in the commit message, Neovim is often failing to publish nightly releases these days. When this happens, it would be nice to have action-setup-vim fall back to building neovim. I know that you said in #9 that you thought there wasn't much of point to doing this as when Neovim fails to publish a nightly release this means that HEAD is broken, but I think the situation has changed since this comment. Indeed, as described in neovim/neovim#15709 , the recent failures are caused by Neovim's CI failing to publish artifacts that built fine. In this case, building Neovim is a perfect workaround.
This commit implements building neovim nightly in case of download failures on linux. If you are okay with this approach, I'll try to implement OSX and Windows support.