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

xmake backend will not copy lua code to lua directory ~/.local/share/lua #2

Closed
Freed-Wu opened this issue Sep 21, 2024 · 1 comment · Fixed by #3
Closed

xmake backend will not copy lua code to lua directory ~/.local/share/lua #2

Freed-Wu opened this issue Sep 21, 2024 · 1 comment · Fixed by #3
Labels
bug Something isn't working

Comments

@Freed-Wu
Copy link
Contributor

Xmake Version

2.9.4

Operating System Version and Architecture

NixOS

Describe Bug

For other backend, they will copy lua/* to luarocks's lua path such as ~/.local/share/lua.
However, xmake only copy output/lib/*.so to luarocks's lib path such as ~/.local/lib/lua.

Expected Behavior

Like cmake backend. Such as:

rock_manifest = {
   ["cppinsights.nvim-scm-1.rockspec"] = "c1f48bdca17fa78cd5d3cd378b05271c",
   ftplugin = {
      ["cpp.lua"] = "e27626c1430f38ce6d98e2d092492369"
   },
   lib = {
      ["cppinsights.so"] = "13dbf183489c9e68972b905d9ce481e3"
   },
   lua = {
      cppinsights = {
         ["config.lua"] = "f03e71a515e4542cd8a38ac7a41c0654",
         nvim = {
            ["init.lua"] = "49071491749b746a3fed35a1e3a2db95"
         }
      }
   }
}

However, xmake will:

rock_manifest = {
   after = {
      plugin = {
         ["rime.lua"] = "cadf152f7b5fb43e2a96c8e500297aa0"
      }
   },
   lib = {
      ["rime.so"] = "6fd5e32362b3b68d86d1af39064d52bf"
   },
   ["rime.nvim-scm-1.rockspec"] = "22a0addcf7d0580cecd8c82912b269bf"
}

Miss lua directory.

Project Configuration

Refer https://github.com/Freed-Wu/rime.nvim

Additional Information and Error Logs

@Freed-Wu Freed-Wu added the bug Something isn't working label Sep 21, 2024
@Freed-Wu
Copy link
Contributor Author

Freed-Wu commented Sep 24, 2024

Now we have two methods:

  1. Modify upstream's code. Add
    local luadir = path.lua_dir(rockspec.name, rockspec.version)
    fs.copy_contents("lua", luadir)

to

~/.local/share/lua/5.1/luarocks/build/xmake.lua

  1. Add build.install.lua to downstream's code.

Weird: use build.modules to install lua files cannot work. Maybe another bug?

@waruqi waruqi closed this as completed in c1dbba6 Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant