Skip to content
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

add rockspec #136

Merged
merged 5 commits into from
Jun 7, 2022
Merged

add rockspec #136

merged 5 commits into from
Jun 7, 2022

Conversation

teto
Copy link
Contributor

@teto teto commented May 31, 2022

  • add rockspec: sqlite is a dependency but I chose not to expose it
  • hack to fix tests: wouldn't it be simpler to use the envvar in all cases ?

so that the package can be published on luarocks, describes
dependencies, and can be redistributed in distributions too.
@kkharji
Copy link
Owner

kkharji commented Jun 1, 2022

hey @teto, do you mean to say that this env var is auto set? or users need to set it manually in there zsh/bash config?

@kkharji
Copy link
Owner

kkharji commented Jun 1, 2022

Currently the ci tests failing for two reason:

  • upper/lower type names: Had this issue for awhile, I guess we need to make sure that is "always" lower case.
  • test/auto/stmt_spec.lua:96: types no longer return in ci, maybe this should just be ignored/commented out

@teto
Copy link
Contributor Author

teto commented Jun 1, 2022

do you mean to say that this env var is auto set? or users need to set it manually in there zsh/bash config?

I tried to make luarocks test succeeds and it was failing because of that code: sqlite_clib_path is not set in the minimal_test.vim. It was not clear how to pass the value to vim while exporting the environment variable could fix it and removed one code path.
But I would understand if you prefer to keep it the current way, maybe the vim code could check the environment variable too ?

unrelated but would also be nice to have a vim.health script to check sqlite is correctly loaded.

@teto teto marked this pull request as draft June 1, 2022 22:26
@kkharji
Copy link
Owner

kkharji commented Jun 1, 2022

I tried to make luarocks test succeeds and it was failing because of that code: sqlite_clib_path is not set in the minimal_test.vim.

In that case, how about if not vim, try to read path from env var? or regardless if not set then read from env var. That way users may have the freedom to pick either one.

unrelated but would also be nice to have a vim.health script to check sqlite is correctly loaded.

Definitely it would, can you open an issue so we can later implement

@teto teto marked this pull request as ready for review June 6, 2022 18:52
@teto
Copy link
Contributor Author

teto commented Jun 6, 2022

this should be more acceptable.

upper/lower type names: Had this issue for awhile, I guess we need to make sure that is "always" lower case.
test/auto/stmt_spec.lua:96: types no longer return in ci, maybe this should just be ignored/commented out

sry I didn't check those, could you rerun the workflow so I have a look please ?

@kkharji
Copy link
Owner

kkharji commented Jun 6, 2022

LGTM, I will fix test later, in another pr along with ci issues

@teto
Copy link
Contributor Author

teto commented Jun 7, 2022

I've added a makefile target to run stylua locally so that I could fix the issues. The problem is that the stylua version I use locally may be different than the one on the CI. Since you are a nix user, would you mind if I added a flake just for development ? to get lualint/stylint and correctly export LIBSQLITE ?

@kkharji
Copy link
Owner

kkharji commented Jun 7, 2022

I've added a makefile target to run stylua locally so that I could fix the issues. The problem is that the stylua version I use locally may be different than the one on the CI. Since you are a nix user, would you mind if I added a flake just for development ? to get lualint/stylint and correctly export LIBSQLITE ?

Not at all. I like where this is going.

@teto
Copy link
Contributor Author

teto commented Jun 7, 2022

I've added the flake, running nix develop followed by luarocks test seems to pass. I wouldn't mind this being merged if only so that the github workflows get run automatically in followup PRs ^^'

Copy link
Owner

@kkharji kkharji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing luacheck and style lua still failing but for absolute nonsense it should have been warning instead of errors

flake.nix Outdated Show resolved Hide resolved
lua/sqlite/defs.lua Outdated Show resolved Hide resolved
Copy link
Owner

@kkharji kkharji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @teto

tag = "master"
}
dependencies = {
"plenary.nvim"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, sqlite.lua doesn't depend on plenary only on luv, have you seen script/gen_rockspec.lua

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I had seen it then forgot about it when I resumed the PR xD I've submitted an update that adds plenary as a test dependency though. It won't work because plenary is not in the root manifest of luarocks.org but I think this can be done with the help of @tjdevries

Copy link
Owner

@kkharji kkharji Jun 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆 no worries, @teto what do u mean by it won't work .., isn't plenary up in luarocks and https://github.com/nvim-lua/plenary.nvim/blob/master/plenary.nvim-scm-1.rockspec? or is it having as test dependency breaking t?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

luarocks test ./sqlite-master-0.rockspec 
Missing dependencies for sqlite master-0:
   plenary.nvim (not installed)

sqlite master-0 depends on plenary.nvim (not installed)
Installing https://luarocks.org/plenary.nvim-scm-1.rockspec

fails .
adding my manifest fixes it (https://luarocks.org/modules/teto/plenary.nvim) but it is not scalable so I wonder if I should manage plenary myself or if @tjdevries has enough time/interest to do it (or another maintainer) .

I think it's fine to merge as is as luarocks install ./sqlite-master-0.rockspec --tree /tmp keeps working

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just pushed a linting fix. I think it would be best to have the CI use the flake to run the code rather than CI actions. We would have the same results locally as on github + it would work on other CI/CD pipelines without limiting oneself to github. but that's a suggestion.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the CI setup was pre getting into nix. this would make things a lot simpler and won't have this out sync issue.

Matthieu Coudron added 4 commits June 7, 2022 18:54
vim would only care about vim.g.sqlite_clib_path.
to be able to run mae lint/make lualint quickly
and improve makefile dependencies
@kkharji kkharji merged commit de2cc54 into kkharji:master Jun 7, 2022
@teto teto deleted the rockspec branch June 7, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants