amuletml / amulet

An ML-like functional programming language
https://amulet.works/
BSD 3-Clause "New" or "Revised" License
328 stars 16 forks source link

amc static fails on Debian due to missing lua.pc #275

Closed Ilazki closed 4 years ago

Ilazki commented 4 years ago

I downloaded 1.0.0.0 (d6b1bcb1) as described here to give it a try and noticed that generating a standalone executable with amc static fails because pkg-config is looking for lua.pc. Debian's Lua development packages provide the appropriate files, but named according to the Lua version that provides them, e.g. lua5.1.pc and a lua51.pc symlink for 5.1, likewise for 5.2 and 5.3, and a luajit.pc for LuaJIT.

As a workaround I made a lua.pc symlink pointing to one of them, but ideally that shouldn't be necessary for people checking out the language. Or it should at least be documented somewhere so it doesn't look like a broken feature at first glance.

I don't know if this is also a problem with self-compiled Amulet binaries, since Amulet expected a newer version of Stack than the one provided by Debian stable

For the sake of completeness, output of amc static hello.ml before creating symlink:

amc static hello.ml Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua' found amc: readCreateProcess: pkg-config "lua" "--cflags-only-I" (exit 1): failed

SquidDev commented 4 years ago

You can compile with the --lua flag to change the Lua package (for instance, amc static --lua lua5.3 main.ml). That said, it might be sensible for us to try multiple packages if none are specified.

Ilazki commented 4 years ago

Oh, nice. amc --help doesn't mention flags for subcommands so I wasn't aware that was an option, but now that I know it's there I see that amc static --help works as well.

That said, it might be sensible for us to try multiple packages if none are specified.

Probably. With the attention to user friendliness I'm seeing with the error messages and amc explain, it seems odd that amc static barfs and fails instead of either giving a warning and finding a valid Lua, or failing with an error message that suggests how to select a different Lua.

Unrelated, it's funny to find you here as well. You seem to appear in any Lua-transpiled language I find interesting. (I ran into you with a couple Urn reports a while back, though I think I was using a different github account at the time)

Cool project, though. I've been getting into OCaml lately and was looking for something like this for ML->Lua output and Amulet seems to scratch that itch well.