Closed Bug 1454826 Opened Last year Closed Last year

Tup backend should use PYTHONDONTWRITEBYTECODE instead of -B


(Firefox Build System :: General, enhancement)

3 Branch
Not set


(firefox61 fixed)

Tracking Status
firefox61 --- fixed


(Reporter: mshal, Assigned: mshal)


(Blocks 1 open bug)



(1 file)

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;
Attachment #8968879 - Flags: review?(nfroyd) → review+
Pushed by
Tup backend: Use PYTHONDONTWRITEBYTECODE=1 instead of -B; r=froydnj
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.