-
Notifications
You must be signed in to change notification settings - Fork 4
Add Neovim support #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
Conversation
|
[amended, fixed by https://github.com//issues/10] |
This fixes `nvim` being executed from `/usr/local/bin`, although it is installed/linked in `/vim-build/bin`. Ref: Vimjas#9 (comment)
scripts/install_neovim.sh
Outdated
| # > make[3]: Leaving directory '/neovim/build' | ||
| # > make[3]: Entering directory '/neovim/build' | ||
| # > Bus error (core dumped) | ||
| # > runtime/CMakeFiles/vimball-tags.dir/build.make:57: recipe for target 'runtime/CMakeFiles/vimball-tags' failed |
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 would be nice to install Neovim into a specific location, but is not required currently, since we're not using tags etc.
But still..
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.
Woah, bus error? That's hardware telling software that something is seriously broken. No idea why that would happen...
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.
Yeah, but it's reproducible.
Just tried with make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/nvim/nvim-master" again.
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.
Oh, I was overwriting the export CMAKE_EXTRA_FLAGS=-DENABLE_JEMALLOC=OFF from the top with that, which is likely the issue.
scripts/install_neovim.sh
Outdated
| rm -r /root/.cache || exit 1 | ||
|
|
||
| # Install Neovim Python support. | ||
| pip install neovim pep8 |
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.
A few lines above we upgrade pip3 and here we use pip(2). Intended?
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.
This is the pip that is installed through pip3 install --upgrade pip setuptools.
By default there is no pip in the image. Will change it for clarity though.
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.
Just for my understanding: That's pip3 in pip disguise?
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.
Yes.
This fixes `nvim` being executed from `/usr/local/bin`, although it is installed/linked in `/vim-build/bin`. Ref: #9 (comment)
c983662 to
76782f0
Compare
|
This should be good for now, but I'd like to merge it with |
3f27e10 to
0c1a0ba
Compare
0c1a0ba to
8289dad
Compare
|
Rebased for now. The next time I come here without stopping feedback in the form of comments, I'll merge it (nearly) as-is. |
mhinz
left a comment
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.
The first post mentions updating the README. What about that?
|
Merged it with install_vim.sh now.. seems to work good. So only the docs need to be updated now. |
|
I still need to revisit the README properly, but apart from that it seems very good now. |
|
@tweekmonster |
tweekmonster
left a comment
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.
Just a code review. I haven't tried building an image yet.
README.md
Outdated
| ---- | ----------- | ||
| `-tag` | The Vim release. It must match the tags on Vim's [releases page](https://github.com/vim/vim/releases). | ||
| `-name` | The name to use for the binary's symlink. If omitted, the name will default to `vim-$TAG`. | ||
| `-vim` | The Vim variant. Either `vim` (default) or `nvim`. |
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.
Why not a boolean -nvim? -vim nvim could be confusing to understand at 2AM and -vim vim is redundant.
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.
Yes, the name -vim is weird after all.
There might be other variants in the future though, so -nvim 1 might not be sufficient..?!
But I am +0 on changing it like that.
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.
How hard would it be to have -tag support a flavor prefix? Like -tag nvim:0.1.7 or -tag vim:7.4.123
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.
Actually, like -tag neovim/neovim:v0.1.7 so it could be any git repo. Like a fork -tag tweekmonster/neovim:wip-branch or something.
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.
Sounds good.
With vim/vim being the default prefix then?
example/Dockerfile
Outdated
| -name vim-xenial -tag v7.4.963 -build | ||
| -name vim-xenial -tag v7.4.963 -build \ | ||
| -vim neovim -tag v0.1.7 -build \ | ||
| -vim neovim -tag master -build |
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.
Looks like a mistake. Should these be -vim nvim?
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.
Yes.
| #!/bin/bash | ||
|
|
||
| set -e | ||
| set -x |
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.
Is this added so the builds are verbose or is this left in by mistake? Maybe this should be enabled if a VERBOSE env variable exists.
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.
I think it's quite nice in general, although too verbose with echos for sure.
We could have a VERBOSE var for this, but I think the default should be 1 then maybe after all: it shows up nicely in the output in red lines, so you see what is being executed currently.
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.
I don't feel strongly about it. I think it can stay as is. It just stuck out as something that might've been left behind from testing.
scripts/install_vim.sh
Outdated
| } | ||
|
|
||
| init_vars() { | ||
| VIM=vim |
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.
I think this should be FLAVOR or something. It seems a little easy to lose track of the variable because the characters "vim" are all over. WDYT?
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.
FLAVOR sounds good, and could be used as -flavor then, too.
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.
This comment is probably irrelevant if a change is made to the -vim flag.
|
I think It is constructed, but yeah.. |
|
Good point. |
|
So now support for |
Up to you. It was just an idea. TBH, I can't think of a good use case for it yet since the goal is to create semi-permanent and reusable images.
Yeah. I was thinking it'd be simply BTW, did you get an email about joining https://github.com/testbed ? |
Yes, joined. I think you could move this repo over there then. I've pushed some updates, also for the better |
tweekmonster
left a comment
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.
make test passes for me! This seems to work. Only blocking issue I saw was a typo.
README.md
Outdated
| -tag v7.4.052 -name vim74 -build \ | ||
| -tag master -build | ||
| -tag master -build \ | ||
| -vim neovim -tag master -py2 -py3 -build |
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.
Should this be changed to -tag neovim:master ?
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.
I will slightly enhance the examples in example/Dockerfile, and use them here. I've thought about using those in the tests then (automatically), and did it now.. :)
| luajit \ | ||
| luajit-dev \ | ||
| m4 \ | ||
| make \ |
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.
if [ "$FLAVOR" = vim ]; only installs ncurses-dev, so does this mean some of these are already installed by this point? It doesn't affect this PR, but might be good to clean this up in the future to reduce the noise.
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.
Neovim certainly has more deps, and these here are pretty fine-grained (and I see it as to see what is required really, if you want to create a Dockerfile yourself).
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.
Oh, I was referring to things like make. It's not installed by the vim flavor, but it still uses make, right?
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.
Yes, there is a more global one at the top: apk add --virtual vim-build curl gcc libc-dev make.
Required for luarocks etc already also.
|
I've broken it on Travis again. |
|
Any idea about getting a better version for Neovim builds?
/cc @mhinz |
|
\o/ |
61370cc to
b25c8ec
Compare
|
Regarding the version: should we use Since we are assuming to use GitHub here still, we might want to use their API to get the commit hash: This would allow us to use |
|
Squashed, waiting for feedback on the version issue with Neovim. |
|
If you want to tackle the GitHub API, I'm all for it since it should speed up the build time. But, the Only issue I can think of with this is the API rate limit without an API token. If the user is allowed to supply the API token, wouldn't it be exposed in the built image if it's pushed to docker hub? |
|
Why does using the GitHub API (to get something for the version) speed up the build?! |
I was thinking that the release archives could be downloaded instead of cloning the repos. A single binary blob is faster to transmit over a network, and the archive's compression ratio should be fairly high since it's all text. Installing |
|
@tweekmonster |
24f53ff to
1fcf0e5
Compare
|
Improved the version output for Neovim (3f379af). |
e0e0b34 to
abfa18e
Compare
Paging @tweekmonster and @mhinz for review.
Fixes #1.
TODO:
update README
sync with updates, e.g. install_vim.sh: allow to pass through configure flags #22 (when not refactoring into a single script)
get Git version info; since we use curl to get the tarball, no
.gitinformation is available, and the Git information in missing innvim --versionetc. We can use-DNVIM_VERSION_MEDIUM=$tagin `CMAKE_EXTRA_FLAGS, but that is not ideal either: would just say "master" there then for example.