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

Luarocks make command doesn't search temporary path for build backends #1521

Closed
alerque opened this issue Jul 7, 2023 · 2 comments · Fixed by #1578
Closed

Luarocks make command doesn't search temporary path for build backends #1521

alerque opened this issue Jul 7, 2023 · 2 comments · Fixed by #1578
Labels

Comments

@alerque
Copy link
Contributor

alerque commented Jul 7, 2023

Normally when running luarocks make --pack-binary-rock, the rock dependencies would be installed and are made available in a temporary path during the build process. This seems to work for normal dependencies, but it does not work for dependencies that are build backends.

Interestingly the dependency is seen and installed in the temporary path, but the build fails because it doesn't seem to check that temporary path to find it later:

$ luarocks make --pack-binary-rock --lua-version 5.4 -- decasify-dev-1.rockspec
Missing dependencies for decasify dev-1:
   luarocks-build-rust-mlua (not installed)

decasify dev-1 depends on lua >= 5.1 (5.4-1 provided by VM)
decasify dev-1 depends on luarocks-build-rust-mlua (not installed)
Installing https://luarocks.org/luarocks-build-rust-mlua-0.1.2-1.src.rock

No existing manifest. Attempting to rebuild...
luarocks-build-rust-mlua 0.1.2-1 is now installed in /tmp/caleb/luarocks_luarocks-build-pack-decasify-949690 (license: MIT)


Error: Failed initializing build back-end for build type 'rust-mlua': module 'luarocks.build.rust-mlua' not found:
        No LuaRocks module found for luarocks.build.rust-mlua
        no field package.preload['luarocks.build.rust-mlua']
        no file '/usr/share/lua/5.4/luarocks/build/rust-mlua.lua'
        no file '/usr/share/lua/5.4/luarocks/build/rust-mlua/init.lua'
        no file '/usr/lib/lua/5.4/luarocks/build/rust-mlua.lua'
        no file '/usr/lib/lua/5.4/luarocks/build/rust-mlua/init.lua'
        no file './luarocks/build/rust-mlua.lua'
        no file './luarocks/build/rust-mlua/init.lua'
        no file '/home/caleb/.luarocks/share/lua/5.4/luarocks/build/rust-mlua.lua'
        no file '/home/caleb/.luarocks/share/lua/5.4/luarocks/build/rust-mlua/init.lua'
        no file '/usr/lib/lua/5.4/luarocks/build/rust-mlua.so'
        no file '/usr/lib/lua/5.4/loadall.so'
        no file './luarocks/build/rust-mlua.so'
        no file '/home/caleb/.luarocks/lib/lua/5.4/luarocks/build/rust-mlua.so'
        no file '/usr/lib/lua/5.4/luarocks.so'
        no file '/usr/lib/lua/5.4/loadall.so'
        no file './luarocks.so'
        no file '/home/caleb/.luarocks/lib/lua/5.4/luarocks.so'

Note that if I first luarocks install -- local luarocks-build-rust-mlua to install it to my user directory (which is also in my path by default) then there is no problem and the build works.

The issue here is that it sees and installs the builder:

luarocks-build-rust-mlua 0.1.2-1 is now installed in /tmp/caleb/luarocks_luarocks-build-pack-decasify-949690

But the /tmp/caleb/luarocks_luarocks-build-pack-decasify-949690 path is not used in the next step when it tries to initialize the build backend.

@hishamhm
Copy link
Member

I spent some time on this one, but fixing this is trickier than it seems.

@hishamhm
Copy link
Member

This recent commit might be a fix for this: ea43975

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants