-
Notifications
You must be signed in to change notification settings - Fork 3k
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
v0.32.0 fails to locate required lua scripts #7399
Comments
As far as I understand it, this was intentionally changed in commit bc1c024. |
This will, I bet, be massively stupid of me, but how does one use functions across different Lua scripts then? Surely it's useful to define a function in one file and use it elsewhere, perhaps in multiple other scripts.. Right now I have symlinked the Edit: Never mind, the solution I'll settle for is to simply add the following line in all of those
where 2nd Edit: Or more robustly, so as to have it work across multiple systems with different main usernames, etc.:
|
Install them into the official package paths. |
Personally I'd do a preface to the tune of: local lua_modules = mp.find_config_file('scripts/lua-modules')
if lua_modules then
-- lua_modules can be nil if the folder does not exist or we're in --no-config mode
package.path = package.path .. ';' .. lua_modules .. '/?.lua;' .. lua_modules .. '/?/init.lua'
end
-- scripts/
-- require_test.lua
-- lua-modules/
-- my_module.lua
local my_module = require('my_module')
my_module.woot() This enables requiring modules in |
@wm4, actually the "portable_config" functionality is broken though. Package.pack cannot see portable_config any longer and scripts in
|
That is not supposed to work. |
Before upgrading to new mpv git version, it was working correctly. I have module.lua and script.lua in the same
It's missing |
Important Information
Provide following Information:
mpv version:
mpv 0.32.0
Linux Distribution and Version
arch Linux, kernel version 4.19.98-1-lts
Source of the mpv binary
arch distro standard package.
If known which version of mpv introduced the problem
latest on this distro,
0.32.0
Window Manager and version
i3 version 4.17.1 (2019-08-30)
GPU driver and version
VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)
Possible screenshot or video of visual glitches
N/A
Reproduction steps
Upon loading any video file with the newest version
0.32.0
a number of scripts in${HOME}/.config/mpv/scripts/
fail to load because theyrequire
anotherutils.lua
package in the same directory.The sorts of errors I am receiving (red in a console when starting from the command line):
Explanation
I have a script
${HOME}/.config/mpv/scripts/eof-del.lua
that in turns calls${HOME}/.config/mpv/scripts/utils.lua
with arequire
directive:Both files exist and are readable. Furthermore, downgrading back to the previous version
0.31.0
restores functionality with no errors. I have the exact same Lua script setup on a number of other machines, ranging inmpv
version from0.27.2
to0.31.0
, and I have never seen this issue before.Expected behavior
No errors as indicated above.
Actual behavior
Lua-script loading reported and described above.
Log file
https://0x0.st/irDl.txt
Sample files
Place the script
in
${HOME}/.config/mpv/scripts/
along with the package itrequire
s:The text was updated successfully, but these errors were encountered: