Closed
Bug 882856
Opened 11 years ago
Closed 11 years ago
mozbuild: backend/recursivemake.py - backend_file.write() buffering problem
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: joey, Unassigned)
References
Details
From bug # 870366
http://bugzilla.mozilla.org/show_bug.cgi?id=870366
backend_file.write() seems to not be flushing the final written line to disk.
writing an extra newline is the difference between this unit test passing or failing:
elif isinstance(obj, JSPreferenceFiles):
backend_file.write('PREF_JS_EXPORTS = %s\n' % obj.js_preference_files)
backend_file.write('\n') # intentional: workaround until buffering problem fixed.
With extra newline to force flushing:
=====================================
TEST-PASS | /media/_Q/mozilla/bugs/870366/python/mozbuild/mozbuild/test/backend/test_recursivemake.py | test_xpcshell_master_manifest
CALLING: write PREF_JS_EXPORTS = [aa/aa.js]
CALLING: write PREF_JS_EXPORTS = [bb/bb.js]
CALLING: write PREF_JS_EXPORTS = [cc/cc.js]
CALLING: write PREF_JS_EXPORTS = [dd/dd.js]
CALLING: write PREF_JS_EXPORTS = [valid_val/pref.js]
==================================================
backend.mk
['PREF_JS_EXPORTS = aa/aa.js', 'PREF_JS_EXPORTS = bb/bb.js', 'PREF_JS_EXPORTS = cc/cc.js', 'PREF_JS_EXPORTS = dd/dd.js', 'PREF_JS_EXPORTS = valid_val/pref.js']
==================================================
# Without backend_file.write('\n')
==================================
[870366] cat ~/bad
TEST-UNEXPECTED-FAIL | /media/_Q/mozilla/bugs/870366/python/mozbuild/mozbuild/test/backend/test_recursivemake.py | line 243, test_js_preference_files: Lists differ: ['PREF_JS_EXPORTS = aa/aa.js',... != ['PREF_JS_EXPORTS = aa/aa.js',...
Second list contains 1 additional elements.
First extra element 4:
PREF_JS_EXPORTS = valid_val/pref.js
['PREF_JS_EXPORTS = aa/aa.js',
'PREF_JS_EXPORTS = bb/bb.js',
'PREF_JS_EXPORTS = cc/cc.js',
- 'PREF_JS_EXPORTS = dd/dd.js']
? ^
+ 'PREF_JS_EXPORTS = dd/dd.js',
? ^
+ 'PREF_JS_EXPORTS = valid_val/pref.js']
TEST-PASS | /media/_Q/mozilla/bugs/870366/python/mozbuild/mozbuild/test/backend/test_recursivemake.py | test_makefile_conversion
[snip]
TEST-PASS | /media/_Q/mozilla/bugs/870366/python/mozbuild/mozbuild/test/backend/test_recursivemake.py | test_xpcshell_master_manifest
CALLING: write PREF_JS_EXPORTS = [aa/aa.js]
CALLING: write PREF_JS_EXPORTS = [bb/bb.js]
CALLING: write PREF_JS_EXPORTS = [cc/cc.js]
CALLING: write PREF_JS_EXPORTS = [dd/dd.js]
CALLING: write PREF_JS_EXPORTS = [valid_val/pref.js]
==================================================
backend.mk
['PREF_JS_EXPORTS = aa/aa.js', 'PREF_JS_EXPORTS = bb/bb.js', 'PREF_JS_EXPORTS = cc/cc.js', 'PREF_JS_EXPORTS = dd/dd.js']
==================================================
gmake: *** [run-/media/_Q/mozilla/bugs/870366/python/mozbuild/mozbuild/test/backend/test_recursivemake.py] Error 1
Reporter | ||
Updated•11 years ago
|
Comment 1•11 years ago
|
||
I suspect this is just the test code not reading the file properly. The files should all be closed by the time the test code opens and reads them. I highly doubt there is a buffering issue.
Comment 2•11 years ago
|
||
I strongly feel this was the result of user error. If we had a buffering problem writing backend.mk files, we'd see all kinds of random failures. We haven't.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•