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

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

Open
sbriais opened this issue Nov 3, 2016 · 8 comments

Comments

@sbriais
Copy link

sbriais commented Nov 3, 2016

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
Copy link
Collaborator

Set OMAKELIB not OMAKEPATH.

@sbriais
Copy link
Author

sbriais commented Nov 3, 2016

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
Copy link
Collaborator

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
Copy link
Author

sbriais commented Nov 3, 2016

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
Copy link
Collaborator

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

@sbriais
Copy link
Author

sbriais commented Dec 8, 2016

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

  • export OMAKEFLAGS=--force-dotomake
  • build a project with 'omake' from its 'standard' installation path (in my example was: /home/user/omake)
  • move 'omake' to another installation path (in my example was: /home/user/omake2) (see my first post)
  • try to build again the same project by invoking 'omake' at its new place with OMAKELIB defined. (see my third post)

@ANogin
Copy link

ANogin commented Feb 13, 2020

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
Copy link

Workaround for this: omake --flush.

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

4 participants