rticommunity / connextdds-py

Connext DDS Python API
Other
26 stars 12 forks source link

Issues with building out package in Jenkins pipeline #35

Closed huntrontrakkr closed 3 years ago

huntrontrakkr commented 3 years ago

Hello,

This is more likely an issue with the agent I'm using than a scripting issue. I was hoping for some guidance in this. When building out the wheel for dist, hitting an unexpected issue:

[ 74%] Building CXX object connextdds/CMakeFiles/connextdds.dir/src/dds/core/KeyedStringTopicType.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
connextdds/CMakeFiles/connextdds.dir/build.make:2356: recipe for target 'connextdds/CMakeFiles/connextdds.dir/src/dds/core/KeyedStringTopicType.cpp.o' failed
make[2]: *** [connextdds/CMakeFiles/connextdds.dir/src/dds/core/KeyedStringTopicType.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:133: recipe for target 'connextdds/CMakeFiles/connextdds.dir/all' failed
make[1]: *** [connextdds/CMakeFiles/connextdds.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "./setup.py", line 232, in <module>
    cmdclass=dict(build_ext=CMakeBuild)
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 204, in run
    self.run_command('build')
  File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.7/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "./setup.py", line 199, in run
    subprocess.check_call([cmake_cmd, '--build', '.'] + build_args, cwd=module_build_dir, env=env)
  File "/usr/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/lib/python3.7/dist-packages/cmake/data/bin/cmake', '--build', '.', '--config', 'Debug', '--parallel', '4']' returned non-zero exit status 2.

What would be a good first place for trying to get this resolved?

marc-chiesa commented 3 years ago

How many jobs are specified in the build config and how much RAM is available on the system? I think error 4 is “internal compiler error” which normally implies an out-of-memory issue with gcc. If you have more than 1 job configured, try changing to 1 and see if that resolves the error.

marc-chiesa commented 3 years ago

Ah yes, I see the dreaded “internal compiler error” on the second line, don’t know how I missed it on the first pass!

huntrontrakkr commented 3 years ago

I think that the agent is limited to one job, but is pretty limited in general. 2 cores at 8GBs. Maybe one or the other is doing that possibly?

marc-chiesa commented 3 years ago

Sorry I meant the arguments to configure.py. Try using -j 1 (or —jobs 1) if it is currently set higher. 8GB should be able to handle 2 and maybe more, but I’d like to make sure this is the cause.

huntrontrakkr commented 3 years ago

Good news! That seemed to do the trick. Now I'm running into what I can only assume is pathing issues:

[ 97%] Linking CXX shared library "/home/lmejenkinstest/workspace/AutonomyKit/connextdds-py compile (Linux)/connextdds-py/build/lib.linux-x86_64-3.7/rti/connextdds.cpython-37m-x86_64-linux-gnu.so"
/bin/sh: 1: Syntax error: "(" unexpected
connextdds/CMakeFiles/connextdds.dir/build.make:3525: recipe for target '/home/lmejenkinstest/workspace/AutonomyKit/connextdds-py compile (Linux)/connextdds-py/build/lib.linux-x86_64-3.7/rti/connextdds.cpython-37m-x86_64-linux-gnu.so' failed
make[2]: *** [/home/lmejenkinstest/workspace/AutonomyKit/connextdds-py compile (Linux)/connextdds-py/build/lib.linux-x86_64-3.7/rti/connextdds.cpython-37m-x86_64-linux-gnu.so] Error 2
make[2]: *** Deleting file '/home/lmejenkinstest/workspace/AutonomyKit/connextdds-py compile (Linux)/connextdds-py/build/lib.linux-x86_64-3.7/rti/connextdds.cpython-37m-x86_64-linux-gnu.so'
CMakeFiles/Makefile2:133: recipe for target 'connextdds/CMakeFiles/connextdds.dir/all' failed
make[1]: *** [connextdds/CMakeFiles/connextdds.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
huntrontrakkr commented 3 years ago

And just resolved that. Seems to be building now, much appreciated!