From: Tim Starling Date: Mon, 4 Apr 2011 12:27:52 +0000 (+0000) Subject: * Change --config to -c, the long form is broken in HEAD X-Git-Tag: 1.31.0-rc.0~31027 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=2e43da7c6b555cb0adb6592f49fa56fc5e739f25;p=lhc%2Fweb%2Fwiklou.git * Change --config to -c, the long form is broken in HEAD * "hphp --version" gives two lines when run on a git tree, make it into one. * Use make -j --- diff --git a/maintenance/hiphop/make b/maintenance/hiphop/make index 88b2913fb7..2aa0bd1790 100755 --- a/maintenance/hiphop/make +++ b/maintenance/hiphop/make @@ -31,7 +31,7 @@ class MakeHipHop extends Maintenance { # Create a function that provides the HipHop compiler version, and # doesn't exist when MediaWiki is invoked in interpreter mode. - $version = trim( `hphp --version` ); + $version = str_replace( PHP_EOL, ' ', trim( `hphp --version` ) ); file_put_contents( "$buildDir/HipHopCompilerVersion.php", "<" . "?php\n" . @@ -48,7 +48,7 @@ class MakeHipHop extends Maintenance { ' --input-dir=' . wfEscapeShellArg( $IP ) . ' --input-list=' . wfEscapeShellArg( "$sourceDir/file-list.small" ) . ' --inputs=' . wfEscapeShellArg( "$buildDir/HipHopCompilerVersion.php" ) . - ' --config=' . wfEscapeShellArg( "$sourceDir/compiler.conf" ) . + ' -c ' . wfEscapeShellArg( "$sourceDir/compiler.conf" ) . ' --parse-on-demand=false' . ' --program=mediawiki-hphp' . ' --output-dir=' . wfEscapeShellArg( $outDir ) . @@ -137,8 +137,23 @@ class MakeHipHop extends Maintenance { passthru( $cmd ); } + # Determine appropriate make concurrency + # Compilation can take a lot of memory, let's assume that that is limiting. + $mem = false; + foreach ( file( '/proc/meminfo' ) as $line ) { + if ( preg_match( '/^MemTotal:\s+(\d+)\s+kB/', $line, $m ) ) { + $mem = intval( $m[1] ); + break; + } + } + if ( $mem ) { + $procs = floor( $mem / 1000000 ); + } else { + $procs = 1; + } + # Run make. This is the slow step. - passthru( 'make' ); + passthru( 'make -j' . wfEscapeShellArg( $procs ) ); $elapsed = time() - $startTime; diff --git a/maintenance/hiphop/run-server b/maintenance/hiphop/run-server index 87695dd02a..bfd55f5321 100755 --- a/maintenance/hiphop/run-server +++ b/maintenance/hiphop/run-server @@ -3,7 +3,7 @@ sourceDir=`dirname "$0"` "$sourceDir"/build/persistent/mediawiki-hphp \ - --config="$sourceDir/server.conf" \ + -c "$sourceDir/server.conf" \ --mode=server \ --port=8080