Re: jit installation broken

  • From: Laurent Deniau <Laurent.Deniau@xxxxxxx>
  • To: "<luajit@xxxxxxxxxxxxx>" <luajit@xxxxxxxxxxxxx>
  • Date: Tue, 21 Jul 2015 09:34:47 +0000

Hi,

Thanks for your comments and link Mike.

On Jul 20, 2015, at 12:11 PM, Mike Pall <mike-1507@xxxxxxxxxx> wrote:

Laurent Deniau wrote:
Giving the PREFIX during the compilation worked, but the problem is that I
don't know the PREFIX during the build (and not even once installed) when it
is "distributed", and setting a relative path doesn't work. In my case, the
user will be allowed to download a self-contained application and put it
where he/she wants on is computer as soon as the starting script is in its
PATH. Is it a recent change, or I just didn't notice it before?

It has always been that way on POSIX systems. Even plain Lua
hardcodes the module paths in the binary (except, it doesn't
come with any external modules).

How does it work when the application embeds Luajit as a library? Does it mean
that the binary cannot be moved? I can see the path encoded in libluajit-5.1.a
and some of them are relative. Could the PREFIX be relative (I don't think it
could...) ? Actually it does not compile with relative path.

[
NB: There's no 100% portable and reliable solution to derive the
absolute path of an executable from within itself for POSIX systems:
http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
]

--Mike


I agree, but an intermediate attempt trying to find the modules paths from
argv[0], PATH and PREFIX with relative paths should be portable and would
probably succeed in 99% of the use cases (even for execXp family), and it would
emit an error in case of failure (which is anyway the case now).

Basically, my problem is to distribute an application based on Luajit such that:

- users download a single statically linked application (or a package installer)
- users don't need to compile anything (the strength of scripting languages).
- users don't need to be admin on their machine,
the application must be installable on a local or remote user account
- users should be able to launch the application with PATH search or with
prefixing a relative/absolute path.

I guess that I am not the first one that have these constraints… How other
projects based on Lua or Luajit distribute their application without
recompiling Luajit on users machines? I could think of patching the paths
stored in the binary and/or the libraries during installation… Or did I miss
something?

Best,
Laurent.

--
Laurent Deniau http://cern.ch/mad
Accelerators Beam Physics mad@xxxxxxx
CERN, CH-1211 Geneva 23 Tel: +41 (0) 22 767 4647


Other related posts: