[Nix-dev] Re: [Nix-commits] SVN commit: nix - 22282 - MarcWeber - nixpkgs/branches/stdenv-updates/pkgs/stdenv/generic

Marc Weber marco-oweber at gmx.de
Wed Jun 16 10:44:02 CEST 2010


> AFAICS the value of ‘configureFlags’ always appears in the build log,
> but I don’t see how this relates to this commit.

Sorry. your're right. I tried talking about make flags only. Probably it
was too late.

> I see this factorization benefit.  However, wouldn’t it work to use
> ‘makeFlags’ for ‘-j’ flags?

It would. That's when opt-out starts mattering. How would you implement opt-out
for each phase then?

That's why I replaced the simple runMake function by a runMake function which
conditionally adds -l -j option only.

$curPhase is set by the builder anyway. This leads to the names being
disliked by Eelco Dolstra: NO_PARALLEL_BUILD_buildPhase etc:

 runMake(){
  local optout=NO_PARALLEL_BUILD_${curPhase}
  [ -n "${!optout}" ] || \
    local j="$makeFlagsParallelBuild"
  cmd make ${makefile:+-f $makefile} "$@" $j
 }


Not having to write something like this for each phase made me think
about the previous commit you were talking about.

So instead of

  echo "dist flags: $distFlags ${distFlagsArray[@]}"
  make ${makefile:+-f $makefile} $distFlags "${distFlagsArray[@]}" ${distTarget:-dist} \
      $([ -z $OPT_OUT_DIST_PHASE ]; echo $makeFlags)

we have

   runMake $distFlags "{ istFlagsArray[]}" ${}istTarget:-dist
    
Of course the first gives us a way to name the opt-out env vars the way
we want. Having one more generic functions ensures that they are all
named in a consistent way which is - so  I hoped - easier to remember.

Marc Weber



More information about the nix-dev mailing list