[Omake] OMake locking
Aleksey Nogin
nogin at metaprl.org
Wed Jan 17 10:38:25 PST 2007
On 17.01.2007 08:38, Jared C. Davis wrote:
> I'm wondering if there's a way to make OMake's locking mechanism less
> severe.
>
> My project has a few long-running files take over an hour to build
> apiece. When I start building one of these files, I can't use OMake
> at all on other parts of the project
Jared,
This is not really about locking - the basic assumption of OMake is that
it does the global dependency analysis on the whole project, so in
general you can not really have more than one instance of OMake running
on the same project, without loosing some of the reliability guarantees
that OMake is designed to provide. Also, there is a global per-project
"build state" database (.omakedb) that is not designed for parallel
access. The locking is there just to remind you of this limitation.
Basically, if you do want to run more than one copy of OMake, you need
to have more than one project. Different projects are allowed to share
[sub]directories (although, OMake running on one project will not
"trust" what another copy of OMake did, so they might end up "fighting"
in those directories). From the OMake's point of view, projects are
different if they have different "project root" directory(*).
Basically, if you want a separate project that shares all the
directories with an existing one, create a fresh directory and copy the
OMakeroot file from the original project to the new directory. Next,
replace the ".SUBDIRS: ." line with ".SUBDIRS:
path/to/original/project/root". Now you should be able to run omake in
the new project root directory, even if you already have one running in
the original one.
Note:
- You do not have to point the ".SUBDIRS" line to the original root,
often it is sufficient to point it to a subdirectory. In that case, you
can just use that subdirectory as the root of the new project, copy the
OMakeroot there and keep the ".SUBDIRS: ." line.
- As I said before, one instance of omake will not in general
"recognize" the progress made by another (as you will end up having two
completely separate .omakedb databases - this is the database that,
among other things, records which files have been successfully built -
omake, contrary to how make does it, does not trust file time stamps).
- It is up to you to make sure that the two instances of OMake do not
end up "fighting" (e.g., many strange things might happen if both try to
build the same file at the same time), Well, I guess this is no worse
that what you'd get if you tried to do this with make.
Aleksey
----
(*) May be we should allow different projects to share a root directory,
but this never came up before.
More information about the Omake
mailing list