| 154 | fout.close() |
| 155 | |
| 156 | def check_compile(distcheck_top_dir, platform): |
| 157 | cmd = [sys.executable, 'scons.py', 'platform=%s' % platform, 'check'] |
| 158 | print('Running:', ' '.join(cmd)) |
| 159 | log_path = os.path.join(distcheck_top_dir, 'build-%s.log' % platform) |
| 160 | flog = open(log_path, 'wb') |
| 161 | try: |
| 162 | process = subprocess.Popen(cmd, |
| 163 | stdout=flog, |
| 164 | stderr=subprocess.STDOUT, |
| 165 | cwd=distcheck_top_dir) |
| 166 | stdout = process.communicate()[0] |
| 167 | status = (process.returncode == 0) |
| 168 | finally: |
| 169 | flog.close() |
| 170 | return (status, log_path) |
| 171 | |
| 172 | def write_tempfile(content, **kwargs): |
| 173 | fd, path = tempfile.mkstemp(**kwargs) |