Am 09.01.20 um 17:41 schrieb Willy Tarreau:
> I'm seeing some merit in this for quite some stuff which annoys us by
> requiring a dedicated file. I'm just a bit anxious about how this can
> steer from the original intent, with users seeing it as a way to inline
> code anywhere, then complaining that we don't have multi-line strings
> nor 64kB long lines :-/
> I'm interested in other opinions on this as well.

In fact I thought about this topic of "HAProxy specific Lua libraries" a
bit more and also about making this useful for Linux distributions when
we opt to change something about this within HAProxy.

Consider that a Linux distribution wants to distribute the
haproxy-lua-http library. That library is not useful outside of HAProxy,
because it relies on the internal API. To be a useful package it should
be "easy" for the administrator to `require` that library within custom
Lua scripts (for a certain definition of easy).

Vincent, a few questions for you as a maintainer of the distro of my
choice (full thread is here if you need context:

If you would package the haproxy-lua-http library for Debian
(https://github.com/haproxytech/haproxy-lua-http) [1], what would you
believe would be most "useful" / "in spirit of Debian packaging" / "your

a) Install the library into the regular Lua library path, even if it
would not be useful / broken outside of HAProxy. Using require within
HAProxy simply works without doing anything.
b) Install the library into a HAProxy specific Lua library path (e.g.
/usr/share/haproxy/lua-path/) and add proper lua-prepend-path to
HAProxy's default configuration. The user would need to copy that into
their own configuration, otherwise things break.
c) Install the library into a HAProxy specific Lua library path and add
that path to HAProxy at compile time via a dedicated compile option. For
the user it would work out of the box, similar to option (a), but it
would not clutter the global Lua library path.
d) Something entirely different.

Best regards
Tim Düsterhus

[1] I'd like to see it packaged if something useful comes out of this
discussion :-)

Reply via email to