Index: trunk/phase3/maintenance/hiphop/run-server |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | sourceDir=`dirname "$0"` |
5 | 5 | |
6 | 6 | "$sourceDir"/build/persistent/mediawiki-hphp \ |
7 | | - --config="$sourceDir/server.conf" \ |
| 7 | + -c "$sourceDir/server.conf" \ |
8 | 8 | --mode=server \ |
9 | 9 | --port=8080 |
10 | 10 | |
Index: trunk/phase3/maintenance/hiphop/make |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | |
33 | 33 | # Create a function that provides the HipHop compiler version, and |
34 | 34 | # doesn't exist when MediaWiki is invoked in interpreter mode. |
35 | | - $version = trim( `hphp --version` ); |
| 35 | + $version = str_replace( PHP_EOL, ' ', trim( `hphp --version` ) ); |
36 | 36 | file_put_contents( |
37 | 37 | "$buildDir/HipHopCompilerVersion.php", |
38 | 38 | "<" . "?php\n" . |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | ' --input-dir=' . wfEscapeShellArg( $IP ) . |
50 | 50 | ' --input-list=' . wfEscapeShellArg( "$sourceDir/file-list.small" ) . |
51 | 51 | ' --inputs=' . wfEscapeShellArg( "$buildDir/HipHopCompilerVersion.php" ) . |
52 | | - ' --config=' . wfEscapeShellArg( "$sourceDir/compiler.conf" ) . |
| 52 | + ' -c ' . wfEscapeShellArg( "$sourceDir/compiler.conf" ) . |
53 | 53 | ' --parse-on-demand=false' . |
54 | 54 | ' --program=mediawiki-hphp' . |
55 | 55 | ' --output-dir=' . wfEscapeShellArg( $outDir ) . |
— | — | @@ -137,8 +137,23 @@ |
138 | 138 | passthru( $cmd ); |
139 | 139 | } |
140 | 140 | |
| 141 | + # Determine appropriate make concurrency |
| 142 | + # Compilation can take a lot of memory, let's assume that that is limiting. |
| 143 | + $mem = false; |
| 144 | + foreach ( file( '/proc/meminfo' ) as $line ) { |
| 145 | + if ( preg_match( '/^MemTotal:\s+(\d+)\s+kB/', $line, $m ) ) { |
| 146 | + $mem = intval( $m[1] ); |
| 147 | + break; |
| 148 | + } |
| 149 | + } |
| 150 | + if ( $mem ) { |
| 151 | + $procs = floor( $mem / 1000000 ); |
| 152 | + } else { |
| 153 | + $procs = 1; |
| 154 | + } |
| 155 | + |
141 | 156 | # Run make. This is the slow step. |
142 | | - passthru( 'make' ); |
| 157 | + passthru( 'make -j' . wfEscapeShellArg( $procs ) ); |
143 | 158 | |
144 | 159 | $elapsed = time() - $startTime; |
145 | 160 | |