Closed Bug 1454826 Opened 6 years ago Closed 6 years ago

Tup backend should use PYTHONDONTWRITEBYTECODE instead of -B

Categories

(Firefox Build System :: General, enhancement)

3 Branch
enhancement
Not set
normal

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: mshal, Assigned: mshal)

References

Details

Attachments

(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;

https://reviewboard.mozilla.org/r/237614/#review243344
Attachment #8968879 - Flags: review?(nfroyd) → review+
Pushed by mshal@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0fc32c8b1286
Tup backend: Use PYTHONDONTWRITEBYTECODE=1 instead of -B; r=froydnj
https://hg.mozilla.org/mozilla-central/rev/0fc32c8b1286
Status: NEW → RESOLVED
Closed: 6 years ago
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.