ocaml-omake / omake

The new home of OMake - docs, downloads, mailing list etc. see:
http://projects.camlcity.org/projects/omake.html
GNU General Public License v2.0
66 stars 25 forks source link

Is it possible to run omake from another place than the one specified during compilation process? #56

Open sbriais opened 8 years ago

sbriais commented 8 years ago

Hello,

I compiled omake with --prefix = ${HOME}/omake and I would like to distribute this binary to other users. Unfortunately, this does not work since the path has been replaced by /home/user/omake and omake hardcode its installation path at compile time.

I wonder whether there is a way to run omake from a place different from its installation path.

For this I tried to move omake from /home/user/omake to /home/user/omake2

If I run omake naively, ie

> omake
*** omake error:
   File Omake_builtin: line 0, characters 0-0
   include file Pervasives not found in OMAKEPATH (OMAKEPATH[] = "." : Sequence /home/user/omake/lib/omake : Dir)

I then tried

> OMAKEPATH=/home/user/omake2/lib/omake omake
*** omake error:
   File OMakeroot: line 10, characters 1-18
   can't open IR: /home/user/omake/lib/omake/build/Common.om

Any ideas?

gerdstolpmann commented 8 years ago

Set OMAKELIB not OMAKEPATH.

sbriais commented 8 years ago

This does not seem to work (or I misuse it).

I tried:

OMAKELIB=/home/user/omake2/lib/omake omake all
*** omake error:
   File OMakeroot: line 10, characters 1-18
   can't open IR: /home/user/omake/lib/omake/build/Common.om
gerdstolpmann commented 8 years ago

This is strange. We use OMAKELIB during bootstrap, e.g.

gerd@e130:~/pub/omake$ OMAKELIB=`pwd` ./boot/omake all
*** omake: reading OMakefiles
*** omake error:
   File Omake_builtin: line 0, characters 0-0
   include file Pervasives not found in OMAKEPATH
      (OMAKEPATH[] = "." : Sequence /home/gerd/pub/omake : Dir)

but

gerd@e130:~/pub/omake$ OMAKELIB=`pwd`/lib ./boot/omake all
*** omake: reading OMakefiles
*** omake: finished reading OMakefiles (0.21 sec)
*** omake: done (1.08 sec, 0/245 scans, 0/335 rules, 0/177 digests)

and the reaction is similar when I'm not using boot/omake but an installed omake.

omake looks for $OMAKELIB/build/Common.om

sbriais commented 8 years ago

Ok, found the problem. It is probably due to a bad interaction of the --force-dotomake flag and the cache of omc files. When I delete my .omake folder, this works. I suspect the omc files are cached based on the MD5 of the source om file, but it does not take into account the path/the environment. Maybe a bug?

gerdstolpmann commented 7 years ago

There could be in deed bugs - caching is always brittle. Is there a way to reproduce the problem reliably?

sbriais commented 7 years ago

I believe you can reproduce with the following procedure (reconstructed from my first and third post in this thread):

ANogin commented 4 years ago
OMAKELIB=/home/user/omake2/lib/omake omake all
*** omake error:
   File OMakeroot: line 10, characters 1-18
   can't open IR: /home/user/omake/lib/omake/build/Common.om

I just filed issue #131 about the "can't open IR" caching issue (before seeing this one).

jhwoodyatt commented 3 years ago

Workaround for this: omake --flush.