Open Bug 1520127 Opened 5 years ago Updated 2 years ago

xml.parsers.expat.ExpatError: not well-formed (invalid token) on mach build

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: johannh, Unassigned)

References

Details

Attachments

(1 file)

I get the following error when trying to do a clobber build on OSX. HG bisect points to bug 1500504. I'm using SDK 10.13.

 0:01.30 Traceback (most recent call last):
 0:01.30   File "/Users/johann/Development/firefox2/configure.py", line 123, in <module>
 0:01.30     sys.exit(main(sys.argv))
 0:01.30   File "/Users/johann/Development/firefox2/configure.py", line 29, in main
 0:01.30     sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 435, in run
 0:01.30     self._value_for(option)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 504, in _value_for
 0:01.30     return self._value_for_option(obj)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.30     cache[args] = self.func(instance, *args)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 521, in _value_for_option
 0:01.30     not self._value_for(implied_option.when)):
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 501, in _value_for
 0:01.30     return self._value_for_depends(obj)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.30     cache[args] = self.func(instance, *args)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 510, in _value_for_depends
 0:01.30     return obj.result()
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.30     cache[args] = self.func(instance, *args)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 223, in result
 0:01.30     return self._func(resolved_args)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 222, in <genexpr>
 0:01.30     for d in self.dependencies)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 501, in _value_for
 0:01.30     return self._value_for_depends(obj)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.30     cache[args] = self.func(instance, *args)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 510, in _value_for_depends
 0:01.30     return obj.result()
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.30     cache[args] = self.func(instance, *args)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 146, in result
 0:01.30     for d in self.dependencies]
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 501, in _value_for
 0:01.30     return self._value_for_depends(obj)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.30     cache[args] = self.func(instance, *args)
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 510, in _value_for_depends
 0:01.30     return obj.result()
 0:01.30   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.30     cache[args] = self.func(instance, *args)
 0:01.31   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 146, in result
 0:01.31     for d in self.dependencies]
 0:01.31   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 501, in _value_for
 0:01.31     return self._value_for_depends(obj)
 0:01.31   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.31     cache[args] = self.func(instance, *args)
 0:01.31   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 510, in _value_for_depends
 0:01.31     return obj.result()
 0:01.31   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/util.py", line 944, in method_call
 0:01.31     cache[args] = self.func(instance, *args)
 0:01.31   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 147, in result
 0:01.31     return self._func(*resolved_args)
 0:01.31   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 1027, in wrapped
 0:01.31     return new_func(*args, **kwargs)
 0:01.31   File "/Users/johann/Development/firefox2/build/moz.configure/util.configure", line 446, in wrapper
 0:01.31     return func(*args)
 0:01.31   File "/Users/johann/Development/firefox2/python/mozbuild/mozbuild/configure/__init__.py", line 1027, in wrapped
 0:01.31     return new_func(*args, **kwargs)
 0:01.31   File "/Users/johann/Development/firefox2/build/moz.configure/toolchain.configure", line 233, in macos_sdk
 0:01.31     obj = readPlist(os.path.join(value[0], 'SDKSettings.plist'))
 0:01.31   File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 78, in readPlist
 0:01.31     rootObject = p.parse(pathOrFile)
 0:01.31   File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 406, in parse
 0:01.31     parser.ParseFile(fileobj)
 0:01.31 xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 8
 0:01.33 *** Fix above errors and then restart with               "./mach build"
 0:01.33 make: *** [configure] Error 1

:mshal, any idea what's going on here? :)

Thanks!

Flags: needinfo?(mshal)

What's the content of the SDKSettings.plist file?

Flags: needinfo?(jhofmann)

Ok that pointed me in the right direction. For some reason SDKSettings.plist said the SDK version was 10.14, though the SDK was clearly 10.13 (compilation and running Firefox worked fine before bug 1500504). I linked in a fresh 10.13 SDK and it looks like it's compiling now.

Thank you for the help. Feel free to either close this bug or figure out if there's something to improve here :)

Flags: needinfo?(jhofmann)

Do you by chance still have the old SDKSettings.plist file? If so, can you attach it to this bug? In case other people hit the same issue it might be helpful to have it to compare.

It does seem odd that you would have a version of the file that fails to parse at all, which is what the error message seems to indicate. If it is common for this to happen, we could catch that and provide a better error message.

Flags: needinfo?(mshal) → needinfo?(jhofmann)

No, I overwrote it, sorry, should have thought of that :((

It opened fine in the XCode viewer.

Flags: needinfo?(jhofmann)
Attached file SDKSettings.plist

I also hit this bug. Here is the SDKSettings.plist. I reinstalled Xcode immediately before I found this bug. The version of Xcode is Version 10.1 (10B61).

Ah, sorry, looks like that reinstalling (or updating) Xcode makes the SDK updated 10.14 too. However, anyway, the xml.parsers.expat.ExpatError: not well-formed (invalid token) error is odd, though.

The file in comment 5 is a binary plist file. It looks like those are shipped with xcode these days, I found an unrelated problem caused by one while trying to get a mac build working today.

We also hit the binary plist issue in bug 1522931. Is there some other way to query the version given the path to the SDK?

Could we change things such that if the current .mozconfig doesn't specify ac_add_options --with-macos-sdk=XXX, we check the currently installed macOS SDK by executing the following command:

xcodebuild -showsdks

This will print something similar to:

iOS SDKs:
iOS 12.1 -sdk iphoneos12.1

iOS Simulator SDKs:
Simulator - iOS 12.1 -sdk iphonesimulator12.1

macOS SDKs:
macOS 10.14 -sdk macosx10.14

tvOS SDKs:
tvOS 12.1 -sdk appletvos12.1

tvOS Simulator SDKs:
Simulator - tvOS 12.1 -sdk appletvsimulator12.1

watchOS SDKs:
watchOS 5.1 -sdk watchos5.1

watchOS Simulator SDKs:
Simulator - watchOS 5.1 -sdk watchsimulator5.1

If the macOS SDK in the output is macOS 10.14 or higher, we should prevent the build and ask the developer to specify an SDK via .mozconfig. Note that we should make sure that developers can build with the 10.14 SDK or higher if it is specified in .mozconfig. We will need to have this option to start fixing compatibility issues with the 10.14 SDK.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: