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

Require string #7

Open
daurnimator opened this issue Feb 17, 2016 · 1 comment
Open

Require string #7

daurnimator opened this issue Feb 17, 2016 · 1 comment

Comments

@daurnimator
Copy link

Reported by @nadako

A require string that contains "-" undergoes a translation to "_" when looking for a C symbol.

luautf8 should use a require string and .so name of just "utf8" instead of the current "lua-utf8"

@nadako
Copy link

nadako commented Feb 17, 2016

A require string that contains "-" undergoes a translation to "_" when looking for a C symbol.

That's not true actually, as Lua docs say:

Once it finds a C library, this searcher first uses a dynamic link facility to link the application with the library. Then it tries to find a C function inside the library to be used as the loader. The name of this C function is the string "luaopen_" concatenated with a copy of the module name where each dot is replaced by an underscore. Moreover, if the module name has a hyphen, its prefix up to (and including) the first hyphen is removed. For instance, if the module name is a.v1-b.c, the function name will be luaopen_b_c.

The issue arises when trying to compile luautf8 with luarocks on Windows, it generates a .def file with the invalid export function name: luaopen_lua-utf8 (or something like that), so I think it's more of a luarocks issue. I'm not familiar with lua world though, so I haven't reported any issue neither here, nor to luarocks repo.

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

No branches or pull requests

2 participants