gnw Posted May 14, 2023 Report Share Posted May 14, 2023 I am trying to build 0ad on Slackware-current using sbopkg (which runs this build script) but compilation stops trying to build spidermonkey. I get the error: --> /tmp/SBo/0ad-0.0.26-alpha/libraries/source/spidermonkey/mozjs-78.6.0/third_party/rust/encoding_rs/src/handles.rs:113:30 | 113 | let mut u: u16 = ::std::mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done | I attach the build log. 0ad.log Quote Link to comment Share on other sites More sharing options...
gnw Posted May 14, 2023 Author Report Share Posted May 14, 2023 Forgot to mention that I have rust-1.67.1 installed. Quote Link to comment Share on other sites More sharing options...
Norse_Harold Posted May 14, 2023 Report Share Posted May 14, 2023 (edited) From what I've seen of Slackware, it's almost like Linux from Scratch, meaning that package maintenance duties fall on the users. The issue here is that mozjs-78.6.0 is old, and the build environment you're using is new. By the way, please post the versions of gcc, g++, clang++ and llvm that you have. You can mimic how other distributions of Linux package 0ad, such as Debian, Arch and Gentoo. They have patches that fix building mozjs and build dependencies that control the versions of packages in the build environment. Debian's packaging is not always tested with the newest versions of build packages, but Arch and Gentoo are more likely to support the latest versions of build packages. Debian's packaging is proof that 0ad alpha 26 builds with rustc version 1.63 and lower, clang version 14.0 and lower, and gcc version 12.2.0 and lower. There might be code constructs in mozjs-78.6.0 that are deprecated by newer versions of rustc, clang and gcc. You might try using older versions of build packages. I also noticed that there are other errors logged before the error that you posted. At first, there's a warning about deprecated function. warning: use of deprecated function `std::mem::uninitialized`: use `mem::MaybeUninit` instead Then there's an error from clang++. cargo:warning=clang-16: error: unknown argument: '-fexperimental-new-pass-manager' which is apparently classed as a warning by the calling process. But, maybe if you fix that error (probably by using an older version of clang or adjusting the code to use mem::MaybeUninit) then build will be able to proceed ... until it encounters the next error. Fix the next error, and you'll find another error... Heh, hopefully not, but that's often what happens when one is trail blazing. Later, the use of ::std::mem::uninitialized is considered an error by your version of clang. I don't see that in my build log. I only see the earlier warnings about std::mem::uninitialized being deprecated. Alternatively, you could try using the AppImage, Flatpak or Snap of 0ad to run it from a sandbox. Or, you could try dual booting to a different distribution of Linux in order to build 0ad alpha 26 with known working build environment package versions. Edited May 14, 2023 by Norse_Harold Quote Link to comment Share on other sites More sharing options...
gnw Posted May 14, 2023 Author Report Share Posted May 14, 2023 Versions that I have installed: clang++ 16.0.2 gcc 12.2.0 gcc-g++ 12.2.0 I have mozjs version 102.10.0 installed, but 0ad is building with mozjs-78.6.0 because that is the version that comes packaged in the official release: http://releases.wildfiregames.com/0ad-0.0.26-alpha-unix-build.tar.xz, and the build scrip uses it. Quote Link to comment Share on other sites More sharing options...
Norse_Harold Posted May 14, 2023 Report Share Posted May 14, 2023 (edited) 34 minutes ago, gnw said: I have mozjs version 102.10.0 installed, but 0ad is building with mozjs-78.6.0 because that is the version that comes packaged in the official release: http://releases.wildfiregames.com/0ad-0.0.26-alpha-unix-build.tar.xz, and the build scrip uses it. Yes, and you can't use any version other than mozjs-78.6.0 with 0ad alpha 26 because 0ad assumes that every player is using the same version of mozjs in order to keep the game in sync. Is alpha 26 the only version of 0ad you're interested in currently? You could look at 0ad SVN master, which uses mozjs-91.13.1, and might in the future use an even newer version of mozjs prior to stable release. Edited May 14, 2023 by Norse_Harold Quote Link to comment Share on other sites More sharing options...
gnw Posted May 15, 2023 Author Report Share Posted May 15, 2023 I cloned bbae408 from https://github.com/0ad/0ad, then cd build/workspaces ./update-workspaces.sh -j8 > >(tee update-workspaces.log) 2>&1 got this error: error: failed to run custom build command for `mozglue-static v0.1.0 I attach update-workspaces.log update-workspaces.log.xz Quote Link to comment Share on other sites More sharing options...
hyperion Posted May 15, 2023 Report Share Posted May 15, 2023 (edited) Checking spidermonky sources "build/moz.configure/flags.configure" it looks like it possibly doesn't recognize clang-16 as clang, maybe try CXX=clang++ ./update-workspaces.sh -j8 instead. Edited May 15, 2023 by hyperion Quote Link to comment Share on other sites More sharing options...
gnw Posted May 15, 2023 Author Report Share Posted May 15, 2023 7 minutes ago, hyperion said: Checking spidermonky sources "build/moz.configure/flags.configure" it looks like it possibly doesn't recognize clang-16 as clang, maybe try CXX=clang++ ./update-workspaces.sh -j8 instead. I did that, but I got the same error. Quote Link to comment Share on other sites More sharing options...
hyperion Posted May 15, 2023 Report Share Posted May 15, 2023 (edited) I only have clang 14 and 15 installed, will take a while to build clang 16 ... Edit: Anyway you might want to file a bug on trac and mark it as release blocker in the meantime ... Edited May 15, 2023 by hyperion Quote Link to comment Share on other sites More sharing options...
hyperion Posted May 15, 2023 Report Share Posted May 15, 2023 Had SM 102 checked out For SM 91 it's obvious why it wouldn't work. Attached patch should get you past this error. 0001-Fix-clang-16-build-of-SM-91.patch Quote Link to comment Share on other sites More sharing options...
gnw Posted May 16, 2023 Author Report Share Posted May 16, 2023 After applying the patch update-workspaces.sh works fine, but after cd gcc make -j8 I get this error: /usr/include/fmt/core.h:1691:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.de\ v/latest/api.html#udt 1691 | formattable, | ^~~~~~~~~~~ I attach the log. make.log Quote Link to comment Share on other sites More sharing options...
hyperion Posted May 16, 2023 Report Share Posted May 16, 2023 That line appears wanting to format an int which should be fine ... What version of libfmt do you have installed? Quote Link to comment Share on other sites More sharing options...
gnw Posted May 16, 2023 Author Report Share Posted May 16, 2023 5 minutes ago, hyperion said: What version of libfmt do you have installed? 10.0.0 Quote Link to comment Share on other sites More sharing options...
hyperion Posted May 16, 2023 Report Share Posted May 16, 2023 Version 10.0.0 is apparently hard masked on my system, reason being it breaks lots of packages. Do you have an older version available? Quote Link to comment Share on other sites More sharing options...
gnw Posted May 16, 2023 Author Report Share Posted May 16, 2023 19 minutes ago, hyperion said: Version 10.0.0 is apparently hard masked on my system, reason being it breaks lots of packages. Do you have an older version available? I have 9.0.0 and 9.1.0 versions available but they might break things. I will see what I can do. Thanks. Quote Link to comment Share on other sites More sharing options...
hyperion Posted May 16, 2023 Report Share Posted May 16, 2023 I'm not keen on updating yet as some of the packages for which bugs are filed for I depend on which makes testing somewhat tedious. Anyway thanks for the report. @phosit told me he might have time over the somewhat lengthy weekend. Quote Link to comment Share on other sites More sharing options...
phosit Posted May 18, 2023 Report Share Posted May 18, 2023 I uploaded a fix for fmt 10 can you try with this patch applied. 2 Quote Link to comment Share on other sites More sharing options...
gnw Posted May 18, 2023 Author Report Share Posted May 18, 2023 2 hours ago, phosit said: I uploaded a fix for fmt 10 can you try with this patch applied. Worked fine with fmt 10.0.0. 1 Quote Link to comment Share on other sites More sharing options...
phosit Posted May 19, 2023 Report Share Posted May 19, 2023 Good to know. Thanks for testing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.