>> 1) Linking clang.exe and clang++.exe simultaneously takes out my machine,
>> causing it to swap furiously for a long period of time. It would be great if
>> the generated Ninja rules included pools ideally limiting the build to at
>> most one link step at a time. At the moment I am using -j1 on my 4 CPU
>> machine just so I don't freeze at link time.
>
> One workaround I've used before is to hack a linker binary into the front of
> your path that knows to run only one at a time. This is trivial on Linux
> with the "flock" command; maybe there's something similar on Windows.
It's probably easier for me to manually tweak the generated
build.ninja for the moment. The advantage of using pools over flock is
that you don't waste a build CPU waiting on the lock, as you can build
other things while waiting for the linker lock to become available (or
certainly Shake can).
> As I mentioned on IRC, the deps thing is new, so we're being a bit cautious.
> I should probably put a warning on it in the manual.
>
> I think the CMake developers are even more cautious when introducing the use
> of new features so I'm not sure where they stand on adding this to CMake.
> Perhaps in the next release of Ninja we'll just make it the default and so
> older versions of CMake will get the optimization transparently.
Given a command to produce foo with depsfile=bar, if you are happy to
declare that Ninja only needs to read the contents of bar after
running foo, and does not need to check bar every time, I'll implement
that logic in Shake. Shake always puts the conents of bar as
dependencies of foo, and at the moment it also introduces a dependency
of foo on bar. It sounds like given your thoughts dropping the
dependency is reasonable, which would save me 0.1s.
> Note that on Windows, unless you're intentionally using gcc, you ought to
> build with Visual Studio's compiler and deps=msvc. But CMake doesn't
> support that yet either.
I am intentionally building with gcc, since there were step-by-step
instructions on the web that worked first time with MingW/gcc.
> Cool! For others on the mailing list, I'll add that I believe that while
> normal use of Shake involves a Haskell compiler to compile your build rules,
> I believe the Ninja support works by reading the Ninja files dynamically,
> which (I think?) means you can just drop a built shake.exe in to your build
> to use it. (Please correct me if I got that wrong.)
You are correct. Normally people use Shake as a library, the usage
looks much more like the typical configure.py Ninja scripts, which are
then compiled to produce a build system for that project. You
typically need to recompile the script whenever in Ninja you would
change the configure.py script, not just when you rerun the
configure.py script. When running over a Ninja script, you can drop a
prebuilt binary of shake next to the ninja one, and do not need any
Haskell compiler on your build machine etc.