From ae0801e23b4a17be08fd24f0b41da836f43abf23 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 5 Mar 2018 14:05:13 -0800 Subject: [PATCH] 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. --- cranelift/test-all.sh | 4 ++++ lib/cretonne/build.rs | 3 +++ 2 files changed, 7 insertions(+) diff --git a/cranelift/test-all.sh b/cranelift/test-all.sh index 6a9291d82e..2402eb7a39 100755 --- a/cranelift/test-all.sh +++ b/cranelift/test-all.sh @@ -11,6 +11,10 @@ set -euo pipefail # # 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. cd $(dirname "$0") topdir=$(pwd) diff --git a/lib/cretonne/build.rs b/lib/cretonne/build.rs index d2ef3905b1..69be14de94 100644 --- a/lib/cretonne/build.rs +++ b/lib/cretonne/build.rs @@ -59,8 +59,11 @@ fn main() { let build_script = meta_dir.join("build.py"); // 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") .current_dir(crate_dir) + .arg("-B") .arg(build_script) .arg("--out-dir") .arg(out_dir)