0ad failed to build from source in Fedora rawhide/f36 https://koji.fedoraproject.org/koji/taskinfo?taskID=81769380 For details on the mass rebuild see: https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Please fix 0ad at your earliest convenience and set the bug's status to ASSIGNED when you start fixing it. If the bug remains in NEW state for 8 weeks, 0ad will be orphaned. Before branching of Fedora 37, 0ad will be retired, if it still fails to build. For more details on the FTBFS policy, please visit: https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
Created attachment 1853512 [details] build.log file build.log too big, will only attach last 32768 bytes
Created attachment 1853513 [details] root.log file root.log too big, will only attach last 32768 bytes
Created attachment 1853514 [details] state.log
Right now my best guess is that this comment I found applies: "Make sure that the very first line of your file, before any #includes, says #define _USE_MATH_DEFINES (note the ‘S’ on the end of that). Unless you specify a specific standard, compilers will tend to include the math defines like M_PI. By providing the #define you override the standards-compliant behavior caused by -std=c++17. I suspect your invocation of cl did not specify a specific standard, and so it was not an issue." It will be a bit of a pain because it is in a bundled part of the code but I have an example patch I can work from and test the suggested work around.
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36.
N.B. I think there are at least two different problems here. The one in the attached build.log was ppc64le-specific, and should be fixed. Comment 4 refers to the second one, which is: ../../../source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp:32:13: error: expected unqualified-id before numeric constant 32 | const float M_PIf = 3.14159265f; | ^~~~~ But the quoted comment about _USE_MATH_DEFINES is referring to a Visual C++ macro, and is totally irrelevant to Fedora. The problem is a glibc change https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=math/math.h;h=27963ef6dcd4dcd718eccaca9844829dff03eab6;hp=7bd56c96486db045d35b7bc1e7efcec056b91446;hb=347a5b592c91f0230d52a5117fd83e1f75028207;hpb=e72ef23ee88187284b4b1ca9b2e314e618429d35 That defines M_PIf as a macro in <math.h> which means that it cannot be used as a variable name in the atlas source code. N.B. for me it now fails in rawhide with: Installing setuptools, pip, wheel... done. /builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/virtualenv.py:688: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.version import LooseVersion /builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/virtualenv.py:314: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead import distutils.sysconfig b"running build_ext\nbuilding 'psutil._psutil_linux' extension\ncreating build\ncreating build/temp.linux-x86_64-3.10\ncreating build/temp.linux-x86_64-3.10/psutil\ngcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build-debug/_virtualenvs/init_py3/include/python3.10 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.10/psutil/_psutil_common.o\ngcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build-debug/_virtualenvs/init_py3/include/python3.10 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-3.10/psutil/_psutil_linux.o\ngcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build-debug/_virtualenvs/init_py3/include/python3.10 -c psutil/_psutil_posix.c -o build/temp.linux-x86_64-3.10/psutil/_psutil_posix.o\ncreating build/lib.linux-x86_64-3.10\ncreating build/lib.linux-x86_64-3.10/psutil\ngcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -Wl,--build-id=sha1 -g -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -Wl,--build-id=sha1 -g build/temp.linux-x86_64-3.10/psutil/_psutil_common.o build/temp.linux-x86_64-3.10/psutil/_psutil_linux.o build/temp.linux-x86_64-3.10/psutil/_psutil_posix.o -L/usr/lib64 -o build/lib.linux-x86_64-3.10/psutil/_psutil_linux.cpython-310-x86_64-linux-gnu.so\nbuilding 'psutil._psutil_posix' extension\ngcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build-debug/_virtualenvs/init_py3/include/python3.10 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.10/psutil/_psutil_common.o\ngcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_LINUX=1 -I/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build-debug/_virtualenvs/init_py3/include/python3.10 -c psutil/_psutil_posix.c -o build/temp.linux-x86_64-3.10/psutil/_psutil_posix.o\ngcc -shared -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -Wl,--build-id=sha1 -g -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -Wl,--build-id=sha1 -g build/temp.linux-x86_64-3.10/psutil/_psutil_common.o build/temp.linux-x86_64-3.10/psutil/_psutil_posix.o -L/usr/lib64 -o build/lib.linux-x86_64-3.10/psutil/_psutil_posix.cpython-310-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.10/psutil/_psutil_linux.cpython-310-x86_64-linux-gnu.so -> psutil\ncopying build/lib.linux-x86_64-3.10/psutil/_psutil_posix.cpython-310-x86_64-linux-gnu.so -> psutil\n" Error processing command. Ignoring because optional. (optional:packages.txt:comm/build/virtualenv_packages.txt) Re-executing in the virtualenv Traceback (most recent call last): File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build-debug/../js/src/../../configure.py", line 181, in <module> sys.exit(main(sys.argv)) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build-debug/../js/src/../../configure.py", line 52, in main sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure')) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 445, in run self.include_file(path) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 436, in include_file exec_(code, self) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/util.py", line 53, in exec_ exec(object, globals, locals) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/moz.configure", line 7, in <module> include('build/moz.configure/init.configure') File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 773, in include_impl self.include_file(what) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 436, in include_file exec_(code, self) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/util.py", line 53, in exec_ exec(object, globals, locals) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build/moz.configure/init.configure", line 254, in <module> def virtualenv_python3(env_python, build_env, mozconfig, help): File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 756, in decorator depends = DependsFunction(self, func, dependencies, when=when) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 129, in __init__ sandbox._value_for(self) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 542, in _value_for return self._value_for_depends(obj) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/util.py", line 1018, in method_call cache[args] = self.func(instance, *args) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 551, in _value_for_depends value = obj.result() File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/util.py", line 1018, in method_call cache[args] = self.func(instance, *args) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 155, in result return self._func(*resolved_args) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/python/mozbuild/mozbuild/configure/__init__.py", line 1161, in wrapped return new_func(*args, **kwargs) File "/builddir/build/BUILD/0ad-0.0.25b-alpha/libraries/source/spidermonkey/mozjs-78.6.0/build/moz.configure/init.configure", line 378, in virtualenv_python3 if not distutils.sysconfig.get_python_lib(): AttributeError: module 'distutils' has no attribute 'sysconfig' ERROR: SpiderMonkey build failed
The atlas code probably needs to do something like: +#ifndef M_PIf const float M_PIf = 3.14159265f; +#endif
There's an upstream fix here https://github.com/0ad/0ad/commit/7df614338cbd41f5e254ce75f649490b2637e1d0
(In reply to Jonathan Wakely from comment #7) > The atlas code probably needs to do something like: > > +#ifndef M_PIf > const float M_PIf = 3.14159265f; > +#endif This would be a simpler workaround for fedora though.
Thanks for finding that extra information. I've been meaning to get back to this for a while. I'd like it to be working by the f36 release. I'll likely try to use the upstream fix.
Looking more at the commit in comment 8, it looks like most of the changes are style, not actually fixing the bug. It probably should have been two commits. I think the actual fix is just not defining a constsant an using the macro for the value of pi.
i.e. comment 7
It looks like 0.0.26 rc1 is available (https://releases.wildfiregames.com/rc/), so looking at moving to the next release is possible as a solution for this. That also would be a chunk of work to recheck licensing and bundled stuff and possibly other stuff I'm not aware of. We might be able to stop using the bundled mozjs. But that would happen in f37 first. There is a seperate build problem in f37 that makes fixing 0.0.25b harder. For f36, I should find some time to try the comment 7 fix out so we can stay on 0.0.25b until 0.0.26 is really released.
Would you mind letting me know when you fixed the build, so I can try building against updated gloox? gloox 1.0.24 comes with a soname bump, so 0ad needs to be build against the new gloox.
OK, this should be sorted out now. pcpa and I teamed up for this and he updated 0ad to 0.0.26 and I figured out how to backport mozjs patches to support Python 3.11 and setuptools 60+ that are in F37: https://src.fedoraproject.org/rpms/0ad/c/8dfbd049c0d6d6ccfcce3e392de84183a5bbeb86?branch=rawhide https://src.fedoraproject.org/rpms/0ad/c/5c30a2e401024844a77f851f34aae51e918d105f?branch=rawhide
FEDORA-2022-41f00827a6 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-41f00827a6
FEDORA-2022-dbb72c8ec0 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-dbb72c8ec0
FEDORA-2022-dbb72c8ec0 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2022-41f00827a6 has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-41f00827a6` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-41f00827a6 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-41f00827a6 has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report.