Jump to content

cxxtest build failed


danto
 Share

Recommended Posts

ok, i solved this problem but now when i run make i get another error

Generating test root file
/home/user/0ad/libraries/source/cxxtest-4.4/bin/cxxtestgen --root  --include=precompiled.h --runner=ErrorPrinter -o /home/user/0ad/source/test_root.cpp
/usr/bin/env: "python": File or directory does not exist
make[1]: *** [cxxtestroot.make:36: ../../../binaries/system/cxxtestroot] Error 127
make: *** [Makefile:199: cxxtestroot] Error 2

EDIT:

For those who need: to fix the cxxtest build failed error run git status and then use git restore to add the missing paths that git status reported.

Edited by danto
Link to comment
Share on other sites

I am trying to build the game from your Gitea source code and have encountered similar failures with cxxtest. I am trying to build the source libraries by running

$ ./libraries/build-source-libs.sh

And the output is:

Building third-party dependencies...

./build-source-libs.sh: line 61: ./source/cxxtest-4.4/build.sh: No such file or directory
ERROR: cxxtest build failed

 

 

I then tried to parse in the arguments mentioned above:

$ ./build-source-libs.sh --with-system-cxxtest 

And I was hit with FCollada build failure due to missing files:


Building third-party dependencies...


./build-source-libs.sh: line 64: ./source/fcollada/build.sh: No such file or directory
ERROR: FCollada build failed

 

Before starting the build, I have installed the dependencies exactly as specified by this page: https://gitea.wildfiregames.com/0ad/0ad/wiki/BuildInstructions

It may be worth noting that the zlib dependency is in conflict with my zlib-ng-compat package. Below is the error from my package manager:

  • resolving dependencies...
    looking for conflicting packages...
    :: zlib-1:1.3.1-2.1 and zlib-ng-compat-2.2.2-6 are in conflict. Remove zlib-ng-compat? [y/N]  
    error: unresolvable package conflicts detected
    error: failed to prepare transaction (conflicting dependencies)
    :: zlib-1:1.3.1-2.1 and zlib-ng-compat-2.2.2-6 are in conflict

     

Link to comment
Share on other sites

Looking at libraries/clean-source-libs.sh I think I know what went wrong.

From the base directory run

git checkout libraries

to restore the extra files deleted by ./libraries/clean-source-libs.sh, then try again.

if you pass --with-system-cxxtest to ./libraries/build-source-libs.sh, then you have to do the same to build/workspaces/update-workspaces.sh and have the cxxtest package installed via package manager.

Edit: https://gitea.wildfiregames.com/0ad/0ad/pulls/7130

  • Thanks 1
Link to comment
Share on other sites

33 minutes ago, hyperion said:

From the base directory run

git checkout libraries

to restore the extra files deleted by ./libraries/clean-source-libs.sh, then try again.

 

Thank you, after following your steps, the build processed advanced a bit further until a new error is encountered:

 

Checked out revision 28209.
Building SpiderMonkey...

SpiderMonkey build options: --disable-tests
           --disable-jemalloc
           --disable-js-shell
           --without-intl-api
           --enable-shared-js
           --disable-jitspew         
patching file js/src/moz.build
patching file js/src/old-configure
patching file python/mozbuild/mozbuild/virtualenv.py
patching file third_party/python/virtualenv/virtualenv/discovery/py_info.py
patching file python/mozbuild/mozbuild/action/process_define_files.py
patching file python/mozbuild/mozbuild/backend/base.py
patching file python/mozbuild/mozbuild/preprocessor.py
patching file python/mozbuild/mozbuild/util.py
patching file python/mozbuild/mozpack/files.py
patching file build/moz.configure/flags.configure
/home/username/build/0ad/libraries/source/spidermonkey/spidermonkey-build/mozjs-91.13.1/python/mozbuild/mozbuild/configure/__init__.py:915: SyntaxWarning: invalid escape sequence '\.'
  RE_MODULE = re.compile("^[a-zA-Z0-9_\.]+$")
Traceback (most recent call last):
  File "/home/username/build/0ad/libraries/source/spidermonkey/spidermonkey-build/mozjs-91.13.1/build-debug/../js/src/../../configure.py", line 22, in <module>
    from mozbuild.configure import (
  File "/home/username/build/0ad/libraries/source/spidermonkey/spidermonkey-build/mozjs-91.13.1/python/mozbuild/mozbuild/configure/__init__.py", line 13, in <module>
    from six.moves import builtins as __builtin__
ModuleNotFoundError: No module named 'six.moves'
ERROR: SpiderMonkey build failed

This looks like Python attempting to import a non  existent module 'six.moves'. However, I do have the python-six package installed.

Link to comment
Share on other sites

Thank you @hyperion, your solution worked. Below are the fully updated build instructions for anyone who is having similar issues:

1. Install the build dependencies as specified in the dependencies section https://trac.wildfiregames.com/wiki/BuildInstructions

But on top of this, you will need to install cxxtest, python-virtualenv, python3.10, git-lfs

 

2. Download the source code from Gitea; the SVN source resulted in permission errors. Run all commands in your terminal:

git lfs install
git clone https://gitea.wildfiregames.com/0ad/0ad.git

 

3. Enter the downloaded folder and create a Python environment there. I named my virtual environment 0ad_build.

cd 0ad
python -m virtualenv 0ad_build --python=python3.10
source 0ad_build/bin/activate

 

4. Now you are in the activated Python 3.10 environment. Build the libraries under this environment:

./libraries/build-source-libs.sh --with-system-cxxtest 

You can add a -j$(nproc) flag to speed up things at the cost of your CPU consumption

 

5. Workspace update:

./build/workspaces/update-workspaces.sh --with-system-cxxtest


6. Making:

cd /build/workspaces/gcc/
make 

 

7. Running:

cd ../../../
binaries/system/pyrogenesis

 

We can put this into a full build script for your convenience, see attached .sh file. Don't forget to chmod +x ;)

0adbuild.sh

Edited by AInur
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...

I followed the steps above, but the last step  make completed successfully without giving me the pyrogenesis executable. I tried to re-execute the make and this error appeared

Running build commands
mkdir -p generated
/usr/bin/cxxtestgen  --root  --have-std --have-eh --include=precompiled.h --runner=ErrorPrinter -o ./generated/test_root.cpp
Traceback (most recent call last):
  File "/usr/bin/cxxtestgen", line 15, in <module>
    import cxxtest
ModuleNotFoundError: No module named 'cxxtest'
make[1]: *** [cxxtestroot.make:44: generated/test_root.cpp] Error 1
make: *** [Makefile:192: cxxtestroot] Error 2
make: *** Waiting for unfinished jobs....

There is a Python script trying to import a cxxtest module which obviously doesn't exist. What's the workaround?

 

The system libraries were built successfully and the previous steps executed without error. 

Edited by Seleucids
Link to comment
Share on other sites

I have retried the build, from the library step. This time I added no --with-system-mozjs and no --with-system-cxxtest flags. I ran into this error while building the libraries:

 0:02.71 checking for clang for bindgen... /usr/bin/clang++
 0:02.73 checking for libclang for bindgen... /usr/lib/libclang.so
 0:02.74 checking that libclang is new enough...
 0:02.74 ERROR: The libclang located at /usr/lib/libclang.so is too old (need at least 5.0).
 0:02.74 Please make sure to update it or point to a newer libclang using
 0:02.74 --with-libclang-path.
*** Fix above errors and then restart with "./mach build"
ERROR: SpiderMonkey build failed

My Clang version is already 19.1.7-2. I am building from a Python3.10 environment. Would installing clang 5.0 help? Thanks

Link to comment
Share on other sites

4 hours ago, Stan` said:

You need to install llvm possibly

I have installed llvm but this error is still persisting:

0:02.55 checking whether the C++ compiler supports -fno-sized-deallocation... yes
0:02.57 checking whether the C++ compiler supports -fno-aligned-new... yes
0:02.57 checking for llvm_profdata... /usr/bin/llvm-profdata
0:02.57 checking for rustc... /usr/bin/rustc
0:02.57 checking for cargo... /usr/bin/cargo
0:02.61 checking rustc version... 1.84.1
0:02.62 checking cargo version... 1.84.1
0:02.69 checking for rust host triplet... x86_64-unknown-linux-gnu
0:02.73 checking for rust target triplet... x86_64-unknown-linux-gnu
0:02.73 checking for rustdoc... /usr/bin/rustdoc
0:02.73 checking for rustfmt... /usr/bin/rustfmt
0:02.73 checking for clang for bindgen... /usr/bin/clang++
0:02.74 checking for libclang for bindgen... /usr/lib/libclang.so
0:02.74 checking that libclang is new enough...
0:02.74 ERROR: The libclang located at /usr/lib/libclang.so is too old (need at least 5.0).
0:02.74 Please make sure to update it or point to a newer libclang using
0:02.74 --with-libclang-path.
*** Fix above errors and then restart with "./mach build"
ERROR: SpiderMonkey build failed


I have also installed multiple versions of libclang and they are all greater than version 5.0
@hyperion do you think this could be related to Python versions? I created a conda environment with python 3.10

Edited by Seleucids
Link to comment
Share on other sites

That's not necessarily an unusual location, that's one of the locations where you'd might expect to find it on a Linux system, depending on the distribution.

 

@Seleucids, some questions:

  1. What OS/Distro are you using?
  2. When you state "I have also installed multiple versions of libclang", did you remove the other versions between tries, or are they all installed at the same time?
  3. What is the output of the following: ls -l /usr/bin/libclang.so
  4. If on Linux and you have the locate utility installed, what is the output of the following: locate libclang.so
  5. Have you ever managed to build successfully before; and if so when and with which version of the code?
  • Thanks 1
Link to comment
Share on other sites

43 minutes ago, s0600204 said:

What OS/Distro are you using?

Cachy OS (Based on Arch Linux)

43 minutes ago, s0600204 said:

When you state "I have also installed multiple versions of libclang", did you remove the other versions between tries, or are they all installed at the same time?

They are all installed at the same time. I installed them via the AUR

46 minutes ago, s0600204 said:

What is the output of the following: ls -l /usr/bin/libclang.so

ls: cannot access '/usr/bin/libclang.so': No such file or directory

 

 

1 hour ago, s0600204 said:

If on Linux and you have the locate utility installed, what is the output of the following: locate libclang.so

/home/rena/.conda/envs/cloudphysics/lib/libclang.so
/home/rena/.conda/envs/cloudphysics/lib/libclang.so.13
/home/rena/.conda/envs/cloudphysics/lib/libclang.so.14.0.6
/home/rena/.conda/envs/ncl_stable/lib/libclang.so.13
/home/rena/.conda/pkgs/libclang-14.0.6-default_hc6dbbc7_2/lib/libclang.so
/home/rena/.conda/pkgs/libclang13-14.0.6-default_he11475f_2/lib/libclang.so.13
/home/rena/.conda/pkgs/libclang13-14.0.6-default_he11475f_2/lib/libclang.so.14.0.6
/home/rena/.conda/pkgs/libclang13-19.1.7-default_h9c6a7e4_1/lib/libclang.so.13
/home/rena/miniconda3/lib/libclang.so
/home/rena/miniconda3/lib/libclang.so.13
/home/rena/miniconda3/lib/libclang.so.14.0.6
/opt/anaconda/lib/libclang.so
/opt/anaconda/lib/libclang.so.13
/opt/anaconda/lib/libclang.so.14.0.6
/opt/anaconda/pkgs/libclang-14.0.6-default_hc6dbbc7_1/lib/libclang.so
/opt/anaconda/pkgs/libclang13-14.0.6-default_he11475f_1/lib/libclang.so.13
/opt/anaconda/pkgs/libclang13-14.0.6-default_he11475f_1/lib/libclang.so.14.0.6
/usr/lib/libclang.so
/usr/lib/libclang.so.19.1
/usr/lib/libclang.so.19.1.7
/usr/lib32/libclang.so
/usr/lib32/libclang.so.19.1
/usr/lib32/libclang.so.19.1.7
 

1 hour ago, s0600204 said:

Have you ever managed to build successfully before; and if so when and with which version of the code?

Yes, but it was before the release of A27; I successfully built the development version of A27. The last successful attempt was in December 2024 where I followed the steps from the posts above to workaround the errors.

Link to comment
Share on other sites

12 minutes ago, Seleucids said:
1 hour ago, s0600204 said:

What is the output of the following: ls -l /usr/bin/libclang.so

ls: cannot access '/usr/bin/libclang.so': No such file or directory

Heh, I did mean to write /usr/lib/libclang.so - my mistake, sorry.

  • Like 1
Link to comment
Share on other sites

After some digging, the problem has been resolved and my build was successful. For future Linux users:

Solution:

1. Create a new system user account. Keep it fresh and don't change any settings or environment variables for this user. Your old user where the build failed likely has contaminated environments.

My main user account had conda installed and many environment variables changed to accommodate my other projects. This conflicted with 0AD build environment. 

2. Install key dependencies for the build, including cxxtest, python3.10 but excluding zlib if you have zlib-compat already. 

3. Follow this instruction here. I would recommend building all of the libraries using cloned 0ad ingredients instead of system packages, then stick to built 0ad libraries instead of  system libs. You do not need to create python virtual environments in this case; I am using python 3.13.1 and it worked.

4. DO NOT type

export WX_CONFIG=wx-config-gtk3 

Unless you have fatal errors otherwise. You should first try installing wxwidgets-gtk2 before resorting to this. 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...