acxz / pkgbuilds

PKGBUILDs for Arch Linux
25 stars 43 forks source link

[ros-noetic-rosgraph-msgs] No module named 'genmsg' #147

Closed maguilara closed 2 years ago

maguilara commented 3 years ago

Output from command:

yay -S ros-noetic-rosgraph-msgs
:: Checking for conflicts...
:: Checking for inner conflicts...
[Aur:1]  ros-noetic-rosgraph-msgs-1.11.3-1

  1 ros-noetic-rosgraph-msgs                 (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> A
:: Deleting (1/1): /home/username/.cache/yay/ros-noetic-rosgraph-msgs
:: (1/1) Downloaded PKGBUILD: ros-noetic-rosgraph-msgs
  1 ros-noetic-rosgraph-msgs                 (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> 
:: (1/1) Parsing SRCINFO: ros-noetic-rosgraph-msgs
==> Making package: ros-noetic-rosgraph-msgs 1.11.3-1 (Thu 09 Sep 2021 11:46:58 AM -05)
==> Retrieving sources...
  -> Downloading ros-noetic-rosgraph-msgs-1.11.3.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   125  100   125    0     0    219      0 --:--:-- --:--:-- --:--:--   219
100  2483    0  2483    0     0   2040      0 --:--:--  0:00:01 --:--:--  3928
==> Validating source files with sha256sums...
    ros-noetic-rosgraph-msgs-1.11.3.tar.gz ... Passed
==> Making package: ros-noetic-rosgraph-msgs 1.11.3-1 (Thu 09 Sep 2021 11:47:00 AM -05)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found ros-noetic-rosgraph-msgs-1.11.3.tar.gz
==> Validating source files with sha256sums...
    ros-noetic-rosgraph-msgs-1.11.3.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting ros-noetic-rosgraph-msgs-1.11.3.tar.gz with bsdtar
==> Sources are ready.
==> Making package: ros-noetic-rosgraph-msgs 1.11.3-1 (Thu 09 Sep 2021 11:47:01 AM -05)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting build()...
-- The C compiler identification is GNU 11.1.0
-- The CXX compiler identification is GNU 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/noetic
-- This workspace overlays: /opt/ros/noetic
-- Found PythonInterp: /usr/bin/python (found suitable version "3.9.6", minimum required is "3") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using default Python package layout
-- Found PY_em: /usr/lib/python3.9/site-packages/em.py  
-- Using empy: /usr/lib/python3.9/site-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Skip enable_testing() when building binary package
-- Using CATKIN_TEST_RESULTS_DIR: /home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found Python: /usr/bin/python3.9 (found version "3.9.6") found components: Interpreter 
-- Found Threads: TRUE  
-- Using Python nosetests: /usr/bin/nosetests-3.9
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
/opt/ros/noetic/share/genmsg/cmake/pkg-genmsg.cmake.em:56: error: <class 'ModuleNotFoundError'>: No module named 'genmsg'
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/em.py", line 3303, in <module>
    if __name__ == '__main__': main()
  File "/usr/lib/python3.9/site-packages/em.py", line 3301, in main
    invoke(sys.argv[1:])
  File "/usr/lib/python3.9/site-packages/em.py", line 3284, in invoke
    interpreter.wrap(interpreter.file, (file, name))
  File "/usr/lib/python3.9/site-packages/em.py", line 2295, in wrap
    self.fail(e)
  File "/usr/lib/python3.9/site-packages/em.py", line 2284, in wrap
    callable(*args)
  File "/usr/lib/python3.9/site-packages/em.py", line 2359, in file
    self.safe(scanner, done, locals)
  File "/usr/lib/python3.9/site-packages/em.py", line 2401, in safe
    self.parse(scanner, locals)
  File "/usr/lib/python3.9/site-packages/em.py", line 2421, in parse
    token.run(self, locals)
  File "/usr/lib/python3.9/site-packages/em.py", line 1425, in run
    interpreter.execute(self.code, locals)
  File "/usr/lib/python3.9/site-packages/em.py", line 2596, in execute
    _exec(statements, self.globals, locals)
  File "<string>", line 5, in <module>
ModuleNotFoundError: No module named 'genmsg'
CMake Error at /opt/ros/noetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):

  execute_process(/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/catkin_generated/env_cached.sh
  "/usr/bin/python" "/usr/lib/python3.9/site-packages/em.py" "--raw-errors"
  "-F"
  "/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/cmake/rosgraph_msgs-genmsg-context.py"
  "-o"
  "/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/cmake/rosgraph_msgs-genmsg.cmake"
  "/opt/ros/noetic/share/genmsg/cmake/pkg-genmsg.cmake.em") returned error
  code 1
Call Stack (most recent call first):
  /opt/ros/noetic/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process)
  /opt/ros/noetic/share/genmsg/cmake/genmsg-extras.cmake:303 (em_expand)
  CMakeLists.txt:12 (generate_messages)

-- Configuring incomplete, errors occurred!
See also "/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeOutput.log".
See also "/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeError.log".
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: ros-noetic-rosgraph-msgs

Also the log mentioned in the last few lines (/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeError.log)

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_1b3bc/fast && /usr/bin/make  -f CMakeFiles/cmTC_1b3bc.dir/build.make CMakeFiles/cmTC_1b3bc.dir/build
make[1]: Entering directory '/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_1b3bc.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection  -o CMakeFiles/cmTC_1b3bc.dir/src.c.o -c /home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_1b3bc
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1b3bc.dir/link.txt --verbose=1
/usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now  -rdynamic CMakeFiles/cmTC_1b3bc.dir/src.c.o -o cmTC_1b3bc 
/usr/bin/ld: CMakeFiles/cmTC_1b3bc.dir/src.c.o: in function `main':
src.c:(.text.startup+0x2a): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text.startup+0x34): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text.startup+0x3e): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text.startup+0x4a): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_1b3bc.dir/build.make:99: cmTC_1b3bc] Error 1
make[1]: Leaving directory '/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_1b3bc/fast] Error 2

Source file was:
#include <pthread.h>

static void* test_func(void* data)
{
  return data;
}

int main(void)
{
  pthread_t thread;
  pthread_create(&thread, NULL, test_func, NULL);
  pthread_detach(thread);
  pthread_cancel(thread);
  pthread_join(thread, NULL);
  pthread_atfork(NULL, NULL, NULL);
  pthread_exit(NULL);

  return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make -f Makefile cmTC_8cd16/fast && /usr/bin/make  -f CMakeFiles/cmTC_8cd16.dir/build.make CMakeFiles/cmTC_8cd16.dir/build
make[1]: Entering directory '/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8cd16.dir/CheckFunctionExists.c.o
/usr/bin/cc   -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_8cd16.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.21/Modules/CheckFunctionExists.c
Linking C executable cmTC_8cd16
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8cd16.dir/link.txt --verbose=1
/usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -DCHECK_FUNCTION_EXISTS=pthread_create -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now  -rdynamic CMakeFiles/cmTC_8cd16.dir/CheckFunctionExists.c.o -o cmTC_8cd16  -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_8cd16.dir/build.make:99: cmTC_8cd16] Error 1
make[1]: Leaving directory '/home/username/.cache/yay/ros-noetic-rosgraph-msgs/src/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:127: cmTC_8cd16/fast] Error 2

I tried solving it by installing ros-noetic-genmsg, but no joy.

maguilara commented 2 years ago

Scratch that, it seems that there is an incompatibility between the way arch4edu installs the packages and your PKGBUILD do it. It failed because I used some packages from them. Now that I purged all of their packages (and their repo), it has finally compiled :) ps: what a wild ride compiling gazebo

EDIT: but I don't know if arch4edu and your PKGBUILDS are meant to work together or not, so I'll reopen this issue and let you decide what seems like the best choice.

acxz commented 2 years ago

They should be working, however they need to be recompiled. Sorry you had to go through this realization yourself. Let's keep this issue open for now, so that others can easily come across this.

acxz commented 2 years ago

I'll go ahead and close this as I just realized this is in the wrong repo. You probably meant to post this at https://github.com/ros-noetic-arch