-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
neovim 0.2.0 (new formula) #14485
neovim 0.2.0 (new formula) #14485
Conversation
Formula/neovim.rb
Outdated
url "https://github.com/neovim/neovim/archive/v0.2.0.tar.gz" | ||
sha256 "72e263f9d23fe60403d53a52d4c95026b0be428c1b9c02b80ab55166ea3f62b5" | ||
resource "luarocks" do | ||
url "https://github.com/luarocks/luarocks/archive/5d8a16526573b36d5b22aa74866120c998466697.tar.gz" |
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.
url "https://github.com/luarocks/luarocks.git",
:revision => "5d8a16526573b36d5b22aa74866120c998466697"
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 building from the luarocks tag?
Formula/neovim.rb
Outdated
head do | ||
url "https://github.com/neovim/neovim.git", :shallow => false | ||
resource "luarocks" do | ||
url "https://github.com/luarocks/luarocks/archive/2.4.2.tar.gz" |
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.
seems odd the tag is here not in stable
Formula/neovim.rb
Outdated
|
||
depends_on "cmake" => :build | ||
depends_on "libtool" => :build | ||
depends_on "automake" => :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.
does this really require both cmake and Autotools?
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 try and find out. This has been in use for the past 2 years and no changes has been made making a case for it in the neovim tap so I don't have the answer at the moment.
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.
@justinmk can you shine a light on this ?
Formula/neovim.rb
Outdated
depends_on "automake" => :build | ||
depends_on "autoconf" => :build | ||
depends_on "pkg-config" => :build | ||
depends_on "jemalloc" => :recommended |
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 recommended?
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.
Not sure why recommended was chosen but its linked to this issue neovim/neovim#5681 . I'm uncertain if the root cause was found.
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.
Interesting. The last comment there (neovim/neovim#5681 (comment)) says the original issue was resolved. I'm not sure if that implies it's fixed even if jemalloc is not used but it would be good to clarify if the jemalloc dependency is still actually required or just a vestige of that old bug and no longer necessary.
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.
@ilovezfs The reason this was still "recommended" in our brew formula was IIRC because we hadn't released the fixed version yet. I am 90% sure this can be "required" now, since we released 0.2 which includes the fix.
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.
@justinmk I'm a little confused. If the bug is fixed, wouldn't that mean we can just drop the dependency?
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.
We want to use jemalloc. It was temporarily changed to "recommended" instead of "required" because there was an issue related to jemalloc.
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.
Ah, OK! Yes, let's just require it then. No :recommended.
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've removed it completely now require jemalloc for all builds.
Formula/neovim.rb
Outdated
sha256 "620fa4eb12375021bef6e4f237cbd2dd5d49e56beb414bee052c746beef1807d" | ||
end | ||
|
||
resource "luarocks" do |
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 a duplicate resource
Formula/neovim.rb
Outdated
cmake_args = std_cmake_args + ["-DDEPS_PREFIX=../deps-build/usr", "-DCMAKE_BUILD_TYPE=#{build_type}"] | ||
cmake_args += ["-DENABLE_JEMALLOC=OFF"] if build.without?("jemalloc") | ||
cmake_args += ["-DJEMALLOC_LIBRARY=#{Formula["jemalloc"].opt_lib}/libjemalloc.a"] if build.with?("jemalloc") | ||
cmake_args += ["-DMSGPACK_LIBRARY=#{Formula["msgpack"].opt_lib}/libmsgpackc.2.dylib"] |
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 there a way to do this without hard coding a library number?
Formula/neovim.rb
Outdated
cmake_args += ["-DENABLE_JEMALLOC=OFF"] if build.without?("jemalloc") | ||
cmake_args += ["-DJEMALLOC_LIBRARY=#{Formula["jemalloc"].opt_lib}/libjemalloc.a"] if build.with?("jemalloc") | ||
cmake_args += ["-DMSGPACK_LIBRARY=#{Formula["msgpack"].opt_lib}/libmsgpackc.2.dylib"] | ||
cmake_args += ["-DIconv_INCLUDE_DIRS:PATH=/usr/include", "-DIconv_LIBRARIES:PATH=/usr/lib/libiconv.dylib"] |
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.
You'll need to use #{MacOS.sdk_path}/usr/include
here since /usr/include
only exists if the CLT is installed these days.
Formula/neovim.rb
Outdated
end | ||
end | ||
|
||
def caveats; <<-EOS.undent |
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 think we need any of the caveats.
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.
Removed
Formula/neovim.rb
Outdated
test do | ||
(testpath/"test.txt").write("Hello World from Vim!!") | ||
system bin/"nvim", "--headless", "-i", "NONE", "-u", "NONE", "+s/Vim/Neovim/g", "+wq", "test.txt" | ||
assert_equal "Hello World from Neovim!!", File.read("test.txt").strip |
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.
.chomp
instead of .strip
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.
Fixed
Formula/neovim.rb
Outdated
end | ||
|
||
head do | ||
url "https://github.com/neovim/neovim.git", :shallow => false |
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 shallow false actually required?
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 was the issue that triggered the addition of the deep clone neovim/homebrew-neovim#135 . I can check if its still a valid argument.
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 great to check if that's still a problem but :shallow => false
is fine if it is.
Formula/neovim.rb
Outdated
cd "deps-build" do | ||
ohai "Building Neovim third-party dependencies." | ||
system "cmake", "../third-party", | ||
"-DUSE_BUNDLED_BUSTED=OFF", |
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.
can the big list be replaced with the generic -DUSE_BUNDLED=OFF
?
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'm assuming the reason its not done like that now is because of luarocks, luajit and luv since they need to be ON as they are downloaded as separate resources and don't exist as a Formula in homebrew.
I've made an initial commit tackling the easy corrections and suggestions you made. |
Formula/neovim.rb
Outdated
end | ||
|
||
mkdir "build" do | ||
cmake_args = std_cmake_args |
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.
args = std_cmake_args + %W[
-DDEPS_PREFIX=../deps-build/usr
-DMSGPACK_LIBRARY=#{Formula["msgpack"].opt_lib}/libmsgpackc.2.dylib
-DIconv_INCLUDE_DIRS:PATH=#{MacOS.sdk_path}/usr/include
-DIconv_LIBRARIES:PATH=/usr/lib/libiconv.dylib
]
if build.with? "jemalloc"
args << "-DJEMALLOC_LIBRARY=#{Formula["jemalloc"].opt_lib}/libjemalloc.a"
else
args << "-DENABLE_JEMALLOC=OFF"
end
system "cmake", "..", *args
We'll need to get those vendored as well. |
@ilovezfs what do you mean by that ? (get them vendored) |
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.
Made additional updates based on your feedback.
Formula/neovim.rb
Outdated
"-DUSE_EXISTING_SRC_DIR=ON", | ||
*std_cmake_args | ||
|
||
# Deparallelize required since LuaRocks 2.4.1 for reasons unknown |
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.
Reported where ?
Formula/neovim.rb
Outdated
mkdir "build" do | ||
args = std_cmake_args + %W[ | ||
-DDEPS_PREFIX=../deps-build/usr | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo |
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.
@justinmk should we use "Release" here instead ?
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.
Release is the default from std_cmake_args
so: yes, I think 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.
Great then I'll just remove the line and it will use the default.
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.
We tend to ship RelWithDebInfo so that users have stacktraces should a crash occur. But if homebrew prefers to omit debug info that's ok. We have a RelWithDebInfo macOS binary available in our downloads page.
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.
Are there any agreements that would govern this choice @ilovezfs ?
I mean let's use |
So it seems to work if the options are reversed which looks better. If there are other ways to include (vendor) the formula resources then they can be removed as we move along. |
Formula/neovim.rb
Outdated
system "cmake", "../third-party", | ||
"-DUSE_BUNDLED=OFF", | ||
"-DUSE_BUNDLED_LUAROCKS=ON", | ||
"-DUSE_BUNDLED_LUAJIT=ON", |
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.
we have a luajit formula
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.
Will research this
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 I include the luajit formula and disable the above line I get this error when compiling
Last 15 lines from /Users/biomass/Library/Logs/Homebrew/neovim/02.make:
[ 54%] Performing configure step for 'luarocks'
cd /tmp/neovim-20170613-23390-1sbuqi4/neovim-0.2.0/deps-build/build/src/luarocks && /tmp/neovim-20170613-23390-1sbuqi4/neovim-0.2.0/deps-build/build/src/luarocks/configure --prefix=/tmp/neovim-20170613-23390-1sbuqi4/neovim-0.2.0/deps-build/usr --force-config --lua-suffix=jit
Looking for Lua...
luajit found in $PATH: /usr/local/opt/luajit/bin
Checking Lua interpreter...
luajit found in /usr/local/opt/luajit/bin
Checking Lua includes...
lua.h not found (looked in /usr/local/opt/luajit/include, /usr/local/opt/luajit/include/lua/5.1, /usr/local/opt/luajit/include/lua5.1)
The lua.h file is located in /usr/local/opt/luajit/include/luajit-2.0
- can I force it somehow to search there ?
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 code in neovim responsible for the luarocks configuration https://github.com/neovim/neovim/blob/master/third-party/cmake/BuildLuarocks.cmake#L56-L67 . It doesn't seem to accept any variables so maybe the only way is to monkey patch the cmake file ?
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.
So it is possible to do
inreplace "../third-party/cmake/BuildLuarocks.cmake", "${LUAROCKS_OPTS}",
"${LUAROCKS_OPTS} --with-lua-include=#{Formula["luajit"].include}/luajit-2.0 --with-lua-bin=#{Formula["luajit"].bin}"
but then it doesn't seem to find the luarocks modules that has been installed during the luarocks install.
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.
Can't LUAROCKS_OPTS
be passed to cmake somehow? We use list(APPEND ...
so it should have the same effect.
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.
Hmm, maybe it would work just to do -DLUAROCK_OPTS... I'll check.
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.
Also have to handle neovim/homebrew-neovim#149 when LUA_PATH
and LUA_CPATH
are set in the user's environment for use with Homebrew's Lua.
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.
Other formulas seems to have solved it like this https://github.com/Homebrew/homebrew-core/pull/12326/files
Formula/neovim.rb
Outdated
"-DUSE_BUNDLED=OFF", | ||
"-DUSE_BUNDLED_LUAROCKS=ON", | ||
"-DUSE_BUNDLED_LUAJIT=ON", | ||
"-DUSE_BUNDLED_LUV=ON", |
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.
we have a luvit formula
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.
luv and luvit are different afaik . https://github.com/luvit/luv
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, luv is a minimal alternative to luvit (which is much more complicated). Is luv not in brew core?
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.
No, in core there's only luvit.
Formula/neovim.rb
Outdated
args = std_cmake_args + %W[ | ||
-DDEPS_PREFIX=../deps-build/usr | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
-DMSGPACK_LIBRARY=#{Formula["msgpack"].opt_lib}/libmsgpackc.2.dylib |
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 it not able to find this automatically and if not, did you find a way not to have to hard code the library version number?
Formula/neovim.rb
Outdated
-DDEPS_PREFIX=../deps-build/usr | ||
-DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
-DMSGPACK_LIBRARY=#{Formula["msgpack"].opt_lib}/libmsgpackc.2.dylib | ||
-DIconv_INCLUDE_DIRS:PATH=#{MacOS.sdk_path}/usr/include |
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 it not able to find this automatically? And same question for libiconv.dylib
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.
IIRC random iconv in the include path of some users, caused problems.
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 formula as written is using the the macOS libiconv and headers...
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.
random iconvs
Ah. That shouldn't be an issue since superenv filters such things out.
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.
@ilovezfs Too fast. I updated my comment after actually reading the code.
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.
So we should be able to just remove these 2 lines ?
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.
see neovim/homebrew-neovim@f0469ed for why this was added. Is superenv something that didn't exist around December 2015?
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 that in the homebrew(-core) world stray libraries are a nono and brew doctor
is supposed to pick up things like that and detect any potential conflicts. It can therefore be assumed that the brewed formulas will pick up the intended libraries.
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 that's the case, then it should be safe to remove this line.
Formula/neovim.rb
Outdated
|
||
resource "luarocks" do | ||
url "https://github.com/luarocks/luarocks.git", | ||
:revision => "5d8a16526573b36d5b22aa74866120c998466697" |
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 be directly under the "
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 just used the regular identation. Does this means that consecutive lines should use two "tab" stops ? The two tab stop spaces and the " align so both answers result in the same thing.
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 "rule" we standardized on is alignment directly under " so for example
url "https://github.com/facebook/osquery.git",
:tag => "2.4.6",
:revision => "f9cb7149a9ac53c4aa563886d3bd37955876753f"
go_resource "github.com/mitchellh/gox" do
url "https://github.com/mitchellh/gox.git",
:revision => "c9740af9c6574448fd48eb30a71f964014c7a837"
end
and for commands alignment under the "
of the first or second argument depending on the phase of the moon. For example,
system "go-bindata", "-pkg", "docker", "-nocompress", "-nomemcopy",
"-nometadata", "-o",
"#{dir}/executors/docker/bindata.go",
"prebuilt-x86_64.tar.xz",
"prebuilt-arm.tar.xz"
and
system "go", "build", "-ldflags",
"-X github.com/mholt/caddy/caddy/caddymain.gitTag=#{version}",
"-o", bin/"caddy", "github.com/mholt/caddy/caddy"
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.
Got it
Formula/neovim.rb
Outdated
] | ||
|
||
if build.with? "jemalloc" | ||
args << "-DJEMALLOC_LIBRARY=#{Formula["jemalloc"].opt_lib}/libjemalloc.a" |
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.
Can this use the dylib? Is it not able to find it on its own?
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.
That's on my todo list to check - I don't think it will be an issue.
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 it works without this line.
So just a thought. The cmake script for the third party dependencies should automatically download any dependency it needs to complete the compilation. We could therefore remove the resources and rely on the cmake process to do its thing - would that be an acceptable solution ? |
Actually, the typical standard for inclusion in core is that the build should not be downloading anything except via resource blocks, which would include the luarocks, etc. |
Right so that means we need to add all the deps that are installed via luarocks in the cmake script which there are currently 8 + 8 dependencies. This will take a little while to put together and as far as I can tell not all the deps are versioned in the cmake script which I would assume means that the latest one should be used. |
Ideally upstream would specify what versions are to be used, but if they don't we should pin to whatever is current at the time of a given neovim release. |
I somewhat solved the issue with the installation of the rocks. However the way it works now is that it actually downloads off a remote site since the .rock file resource is unzipped at download from what I can tell. I need to be able to tell brew not to unzip the .rock file but currently don't know how. I'm also not sure how it deals with the other dependencies since the compile seems to be working. |
All the cases of -DUSE_BUNDLED_FOO=ON need to be removed. |
These need to be downloaded via resource blocks. |
@justinmk it seems that neovim build just fine with only lpeg and mpack rocks - do you know if the other rocks are only required to run the tests ? The ones that are currently missing are
|
@javian All of those are for tests only. |
So I've removed luv and testing removing the autotools dependency. Not gotten to the shallow clone yet but it is moving in the right direction. |
@javian nice work! |
Formula/neovim.rb
Outdated
homepage "https://neovim.io" | ||
|
||
stable do | ||
url "https://github.com/neovim/neovim/archive/v0.2.0.tar.gz" |
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 there aren't resources or dependencies specific to stable or head, you can make this top section
url "https://github.com/neovim/neovim/archive/v0.2.0.tar.gz"
sha256 "72e263f9d23fe60403d53a52d4c95026b0be428c1b9c02b80ab55166ea3f62b5"
head "https://github.com/neovim/neovim.git", :shallow => false
Formula/neovim.rb
Outdated
r.stage(buildpath/"deps-build/build/src/#{r.name}") | ||
end | ||
|
||
ENV.prepend "LUA_PATH", "#{buildpath}/deps-build/share/lua/5.1/?.lua" |
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.
Technically this should probably be ENV.prepend_path
here and for LUA_CPATH
.
Formula/neovim.rb
Outdated
system "luarocks-5.1", "build", "build/src/mpack/mpack-1.0.6-0.src.rock", "--tree=." | ||
system "luarocks-5.1", "build", "build/src/lpeg/lpeg-1.0.1-1.src.rock", "--tree=." | ||
system "cmake", "../third-party", | ||
"-DUSE_BUNDLED=OFF", |
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 and *std_cmake_args
can be on the same line as system "cmake", "../third-party",
Formula/neovim.rb
Outdated
url "https://github.com/neovim/neovim/archive/v0.2.0.tar.gz" | ||
sha256 "72e263f9d23fe60403d53a52d4c95026b0be428c1b9c02b80ab55166ea3f62b5" | ||
|
||
head do |
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 be
head "https://github.com/neovim/neovim.git"
no do
and end
Formula/neovim.rb
Outdated
system "luarocks-5.1", "build", "build/src/mpack/mpack-1.0.6-0.src.rock", "--tree=." | ||
|
||
system "cmake", "../third-party", "-DUSE_BUNDLED=OFF", *std_cmake_args | ||
|
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 blank line can be deleted
Should I remove the VERBOSE=1 flag on the make lines ? |
Yeah, I think the |
Formula/neovim.rb
Outdated
depends_on "luajit" | ||
depends_on "msgpack" | ||
depends_on "unibilium" | ||
depends_on :python => :recommended if MacOS.version <= :snow_leopard |
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 recommended?
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.
@justinmk can you elaborate on the Python dependency ?
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 the stock python on snow leopard was too old.
ah, yes: neovim/homebrew-neovim#20
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.
@justinmk right ... the question is why isn't it simply required? When would someone pass --without-python?
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.
python isn't required unless user wants to run python plugins.
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.
Vim Formula uses something similar https://github.com/Homebrew/homebrew-core/blob/master/Formula/vim.rb#L37-L38 but also "supports" python 3.
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 I would just remove the => :recommended
because there is no logic in the formula for the if build.without? "python"
case, and we're unlikely to get any complaints.
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.
Indeed. So is the logic that anything post snow leopard will build with python automatically since its shipped with macOS ?
I couldn't see that there was any linkage to python in brew linkage neovim
but perhaps it doesn't show up there. If that isn't the case there is no option to build --with-python
for anything post snow leopard which I would assume would be the intention if you wanted to offer python script support =).
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 you did see explicit Python framework links in the linkage output, it would actually be a "bug" as we prefer -undefined dynamic_lookup
for Python.
So is the logic that anything post snow leopard will build with python automatically since its shipped with macOS ?
Yes, I assume so, though you'd have to check the CMake output to find out if the Python stuff is getting built or not currently.
(Note Snow Leopard also has Python, but it's just too old.)
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'll have a look and see what I can find, in the meantime I will remove the recommended and commit that later today.
I wonder if the lua formula should be |
I'm not sure about that, but we don't have any |
It doesn't appear there. Technically we wouldn't require LUA if Luarocks had a formula of its own. |
@justinmk any idea why the MacPorts port depends on luabitop? https://github.com/macports/macports-ports/blob/master/editors/neovim/Portfile#L38 |
Formula/neovim.rb
Outdated
head "https://github.com/neovim/neovim.git" | ||
|
||
depends_on "cmake" => :build | ||
depends_on "libtool" => :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.
Are you sure this is needed?
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.
No, will test without.
Formula/neovim.rb
Outdated
system "luarocks-5.1", "build", "build/src/lpeg/lpeg-1.0.1-1.src.rock", "--tree=." | ||
system "luarocks-5.1", "build", "build/src/mpack/mpack-1.0.6-0.src.rock", "--tree=." | ||
system "cmake", "../third-party", "-DUSE_BUNDLED=OFF", *std_cmake_args | ||
|
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 blank line can be removed
@javian yeah let's make it |
Formula/neovim.rb
Outdated
depends_on "libtermkey" | ||
depends_on "libuv" | ||
depends_on "libvterm" | ||
depends_on "[email protected]" |
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.
Does 5.2 not work?
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.
5.1 is our target, since that is mostly what luajit tracks.
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 believe the reason I put this down is that it would not build with 5.2 and that I read somewhere that luajit was not 5.2 compatible which is why I changed it.
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.
Even the homebrew formula requires you to add an additional option to enable 5.2 compat https://github.com/Homebrew/homebrew-core/blob/master/Formula/luajit.rb#L23
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.
5.1 is our target, since that is mostly what luajit tracks.
OK, this seems fine then.
some of our build-time generator scripts use lua bitwise operations. This is builtin to luajit but not lua 5.1. |
@justinmk OK, so because we have |
Ah yes, if luajit is not optional then bitop is implied. |
Since lua is not linked in anyway to the binary and the downloaded luarocks are not copied into the Formula in any way and deleted once the install is complete the user wouldn't be able to access the compiled rocks in any case. If accessing the rocks from the runtime is a requirement then we need to do this differently. The initial test of running the runtime works but I haven't tested the lua functions so something might be hidden underneath the surface. |
FYI Lua or luajit is required and compiled into 0.2.1 |
@justinmk So this may be a stupid question, but if we were to require the main |
Formula/neovim.rb
Outdated
|
||
test do | ||
(testpath/"test.txt").write("Hello World from Vim!!") | ||
system bin/"nvim", "--headless", "-i", "NONE", "-u", "NONE", "+s/Vim/Neovim/g", "+wq", "test.txt" |
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.
system bin/"nvim", "--headless", "-i", "NONE", "-u", "NONE",
"+s/Vim/Neovim/g", "+wq", "test.txt"
We aren't prepared to support Lua 5.2. Maybe we accidentally do, but no one has looked closely at it, and it could break in the future if we write some Lua 5.1 code that is broken by 5.2. What's the problem with [email protected] ? Lua 5.1 is like C99: yes, C11 exists, but no, C99 is not going away. Lua 5.1 cannot be regarded as "deprecated". Not to mention luajit... |
@justinmk we like to avoid dependencies on versioned |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?This is slightly different from the Formula that currently sits in the neovim/neovim tap since the linux specific code has been removed since
brew audit
complains. The issue in the Neovim tap requesting the move to homebrew-core is here neovim/homebrew-neovim#115 which also contains a few question marks related to inclusion of code from non brew formula. Let me know if you have any feedback.