-
-
Notifications
You must be signed in to change notification settings - Fork 333
modules/performance: add ability to byte-compile lua packages and lua dependencies #3314
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
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.
Awesome, thanks for continuing to work on these perf options!
16be733
to
4d9b0c3
Compare
I think all comments were addressed. I rebased it on top of c76112e. |
Previously, to determine if a file is byte-compiled, a simple binary file detection was used, specifically checking if it contained any null bytes. This commit updates the check to read the file header and compare it with a known LuaJIT header.
To reduce unexpected breakages due to changes in nixpkgs, replace the tested plugins with specially crafted stub plugins.
* improve assert messages * validate both byte-compiled and non-byte-compiled files are working
This commit adds `performance.byteCompileLua.luaLib` options. When enabled it byte-compiles lua packages from extraLuaPackages option.
This commit adds byte compiling of plugin lua dependencies (specifically propagatedBuildInputs). It's enabled by `performance.byteCompileLua.luaLib` option.
This commit introduces a shared utils module for future use in performance tests. It includes lua libraries and plugins of various types and dependencies. Additionally, it provides lua code snippets to verify that all features supplied by the plugins are functioning correctly.
This commit replaces custom lua plugins in tests with shared stub plugins from utils module. After this change the test has started to fail. Debugging this issue I found out that dependencies of plugins weren't processed. This commit improves the test assertion to detect duplicated dependencies in this case and fixes the underlying issue by also processing dependencies.
Previously only extraLuaPackages themselves were byte-compiled, not theirs dependencies. This commit fixes that by compiling lua packages recursively. It uses byte-compile-lua-lib.nix shared file. Also this commit uses the shared stub lua libraries for extraLuaPackages byte-compiling test.
This commit finalizes using shared utils stub plugins for performance.byteCompileLua tests. To re-use more code from utils module, 'pluginChecksFor', 'libChecksFor' and 'pythonChecksFor' functions were introduced. These functions generate a check code for the given plugins/libs names.
This commit replaces stub plugins with the shared ones from utils module. This also removes separate tests for checking python and lua dependencies. This is now tested in the 'default' test thanks to `pluginChecks` code.
4d9b0c3
to
49a7bb5
Compare
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.
Awesome! The diff looks good to me, thanks again
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This pull request, with head sha This pull request will be automatically closed by GitHub.As soon as GitHub detects that the sha It is possible for this pull request to remain open if this detection does not happen, this usually happens when a force-push is done on this branch |
This PR:
performance.byteCompileLua.luaLib
option. When enabled, it'll byte-compile lua libraries in LUA_PATH. Specifically:extraLuaPackages
and pluginspropagatedBuildInputs
.tests/utils/plugin-stubs.nix
with a shared plugin stubs and generated lua code for using in performance tests.