Disable creation of .pyc files.

Cretonne's python scripts aren't run very often, so there's little
benefit in creating .pyc files. And the .pyc files cause trouble for
some vendoring scripts. So disable them.
This commit is contained in:
Dan Gohman
2018-03-05 14:05:13 -08:00
parent 1a4723831b
commit ae0801e23b
2 changed files with 7 additions and 0 deletions

View File

@@ -11,6 +11,10 @@ set -euo pipefail
# #
# All tests run by this script should be passing at all times. # All tests run by this script should be passing at all times.
# Disable generation of .pyc files because they cause trouble for vendoring
# scripts, and this is a build step that isn't run very often anyway.
export PYTHONDONTWRITEBYTECODE=1
# Repository top-level directory. # Repository top-level directory.
cd $(dirname "$0") cd $(dirname "$0")
topdir=$(pwd) topdir=$(pwd)

View File

@@ -59,8 +59,11 @@ fn main() {
let build_script = meta_dir.join("build.py"); let build_script = meta_dir.join("build.py");
// Launch build script with Python. We'll just find python in the path. // Launch build script with Python. We'll just find python in the path.
// Use -B to disable .pyc files, because they cause trouble for vendoring
// scripts, and this is a build step that isn't run very often anyway.
let status = process::Command::new("python") let status = process::Command::new("python")
.current_dir(crate_dir) .current_dir(crate_dir)
.arg("-B")
.arg(build_script) .arg(build_script)
.arg("--out-dir") .arg("--out-dir")
.arg(out_dir) .arg(out_dir)