Closed Bug 1454826 Opened Last year Closed Last year
Tup backend should use PYTHONDONTWRITEBYTECODE instead of -B
59 bytes, text/x-review-board-request
The tup backend uses 'python -B' to avoid writing .pyc files during GENERATED_FILES scripts, but if those scripts call out to sys.executable to run more python, the -B flag will not be passed along. Instead we can use the environment variable to handle this case better.
I'm wondering why it is a bad idea to write .pyc file?
Tup checks that the files written by the subprocess match the outputs that are declared by the build system (in this case, the GENERATED_FILES line) as one of the dependency checks. This helps to avoid issues with unspecified or undeclared dependencies among dependent jobs where a build may appear to work if jobs are scheduled in one particular order, but fail if they are scheduled in a different way. We could add a rule to the tup backend to generate .pyc files before running any GENERATED_FILES scripts if that ends up being a performance win, but for now its easier to just skip generating them.
Attachment #8968879 - Flags: review?(core-build-config-reviews) → review?(nfroyd)
Comment on attachment 8968879 [details] Bug 1454826 - Tup backend: Use PYTHONDONTWRITEBYTECODE=1 instead of -B; https://reviewboard.mozilla.org/r/237614/#review243344
Attachment #8968879 - Flags: review?(nfroyd) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/0fc32c8b1286 Tup backend: Use PYTHONDONTWRITEBYTECODE=1 instead of -B; r=froydnj
You need to log in before you can comment on or make changes to this bug.