Closed Bug 1625461 Opened 4 years ago Closed 4 years ago

Build bustage: TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'.

Categories

(Toolkit :: Application Update, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox-esr68 --- unaffected
firefox74 --- unaffected
firefox75 --- unaffected
firefox76 --- fixed

People

(Reporter: RyanVM, Assigned: bytesized)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Confirmed via local bisection that this was a regression from bug 1568994. If it matters, I build with the updater disabled.

build/application.ini.stub
build/application.ini.h.stub
toolkit/components/telemetry/TelemetryHistogramData.inc.stub
Traceback (most recent call last):
  File "C:\mozilla-build\python3\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\mozilla-build\python3\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "c:\Users\Ryan\repos\mozilla\python\mozbuild\mozbuild\action\file_generate.py", line 124, in <module>
    sys.exit(main(sys.argv[1:]))
  File "c:\Users\Ryan\repos\mozilla\python\mozbuild\mozbuild\action\file_generate.py", line 72, in main
    ret = module.__dict__[method](output, *args.additional_arguments, **kwargs)
  File "c:/Users/Ryan/repos/mozilla/build/appini_header.py", line 35, in main
    print >>sys.stderr, \
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'. Did you mean "print(<message>, file=<output_stream>)"?
mozmake.EXE[4]: *** [backend.mk;23: .deps/application.ini.h.stub] Error 1
mozmake.EXE[3]: *** [c:/Users/Ryan/repos/mozilla/config/recurse.mk;101: build/export] Error 2
Flags: needinfo?(ksteuber)

Yes. I have this patch to fix the prints in appini_header.py

diff --git a/build/appini_header.py b/build/appini_header.py
--- a/build/appini_header.py
+++ b/build/appini_header.py
@@ -27,18 +27,18 @@ def main(output, file):
                    for s in config.sections() for o in config.options(s))
     appdata['flags'] = ' | '.join(sorted(flags)) if flags else '0'
     appdata['App:profile'] = ('"%s"' % appdata['App:profile']
                               if 'App:profile' in appdata else 'NULL')
     expected = ('App:vendor', 'App:name', 'App:remotingname', 'App:version', 'App:buildid',
                 'App:id', 'Gecko:minversion', 'Gecko:maxversion', 'AppUpdate:url')
     missing = [var for var in expected if var not in appdata]
     if missing:
-        print >>sys.stderr, \
-            "Missing values in %s: %s" % (file, ', '.join(missing))
+        print("Missing values in %s: %s" % (file, ', '.join(missing)),
+              file=sys.stderr)
         sys.exit(1)
 
     if 'Crash Reporter:serverurl' not in appdata:
         appdata['Crash Reporter:serverurl'] = ''
 
     if 'App:sourcerepository' in appdata and 'App:sourcestamp' in appdata:
         appdata['App:sourceurl'] = '"%(App:sourcerepository)s/rev/%(App:sourcestamp)s"' % appdata
     else:
@@ -63,9 +63,10 @@ def main(output, file):
                  "%(AppUpdate:url)s"https://mail.yahoo.com/d/folders/1
              };''' % appdata)
 
 
 if __name__ == '__main__':
     if len(sys.argv) != 1:
         main(sys.stdout, sys.argv[1])
     else:
-        print >>sys.stderr, "Usage: %s /path/to/application.ini" % sys.argv[0]
+        print("Usage: %s /path/to/application.ini" % sys.argv[0],
+              file=sys.stderr)

With that installed it is obvious from the build that it fails because of disabling updater.

hmm i guess i need to attach that rather than just adding

Attached file appini-header.patch
See Also: → 1625466

Print statement fix over in bug 1625466

Can we remove Windows from the summary since this issue is OS independent?

Depends on: 1625466
See Also: 1625466
Summary: Windows build bustage: TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'. → Build bustage: TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'.
OS: Windows → All
Hardware: Unspecified → All

I can reproduce this if I disable building the updater. I think that the problem is that I conditionally included the update URL in application.ini, but didn't ifdef out the handling of the URL. It would be quite messy to ifdef out everything that propagates the url through appinfo, so I think instead I'll just unconditionally include the URL in application.ini.

Flags: needinfo?(ksteuber)
Assignee: nobody → ksteuber
Status: NEW → ASSIGNED

That seems reasonable. I'll update the patch.

Would you mind choosing a reviewer who is still working right now?

I ask because my (and probably others') local GeckoView build is broken right now without manually applying this patch, and assuming that glandium isn't coming back to work until Monday in Japan, you won't see any response until our Sunday night at the earliest.

Flags: needinfo?(ksteuber)

Yeah. Let me find someone.

Flags: needinfo?(ksteuber)
Attachment #9136401 - Attachment description: Bug 1625461 - Fix bug where conditionally including the update URL in application.ini breaks building without the updater r=glandium → Bug 1625461 - Fix bug where conditionally including the update URL in application.ini breaks building without the updater r=froydnj
Attachment #9136401 - Attachment description: Bug 1625461 - Fix bug where conditionally including the update URL in application.ini breaks building without the updater r=froydnj → Bug 1625461 - Fix bug where conditionally including the update URL in application.ini breaks building without the updater r=glandium

Any update? local build is busted for everybody right now :/

I've got a patch up that seems to fix things. Just waiting for code review.

Please find a reviewer for this.

Pushed by ksteuber@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/91721122ded4
Fix bug where conditionally including the update URL in application.ini breaks building without the updater r=rstewart

It breaks geckoview unconditionally, I assume because it never builds an updater.

Correct. GV doesn't use the updater. Also this broke lint automation too: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=295662564&repo=try&lineNumber=1043

Blocks: 1625523
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: