openbmc / sdbusplus

C++ bindings for systemd dbus APIs
Apache License 2.0
101 stars 80 forks source link

no setup.py file after ninja install #68

Closed victorwang-tw closed 2 years ago

victorwang-tw commented 2 years ago

Hi, I'm new to OpenBMC. I'm trying to build sdbusplus with the commands that readme file instructs.

meson build
cd build
ninja
ninja test
ninja install

When I execute ninja command, some notes show like this. This is just one of the notes and I think this is not a problem(maybe?).

/home/test/sdk/romulus-2021-11-02/sysroots/arm1176jzs-openbmc-linux-gnueabi/usr/include/c++/11.2.0/bits/vector.tcc:340:5: note: parameter passing for argument of type ‘std::vector<std::pair<std::__cxx11::basic_string<char>, std::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int, float, double> > >::const_iterator’ changed in GCC 7.1
  340 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~

Then I run ninja test, it seems that it skips all tests.

[0/1] Running all tests.
 1/16 test_bus_list_names                 SKIP            0.00s   exit status 77
 2/16 test_bus_match                      SKIP            0.00s   exit status 77
 3/16 test_exception_sdbus_error          SKIP            0.00s   exit status 77
 4/16 test_message_append                 SKIP            0.00s   exit status 77
 5/16 test_message_call                   SKIP            0.00s   exit status 77
 6/16 test_message_read                   SKIP            0.00s   exit status 77
 7/16 test_message_native_types           SKIP            0.00s   exit status 77
 8/16 test_message_types                  SKIP            0.00s   exit status 77
 9/16 test_timer                          SKIP            0.00s   exit status 77
10/16 test_unpack_properties              SKIP            0.00s   exit status 77
11/16 test_utility_tuple_to_array         SKIP            0.00s   exit status 77
12/16 test_utility_type_traits            SKIP            0.00s   exit status 77
13/16 test-bus_aio                        SKIP            0.00s   exit status 77
14/16 test-vtable                         SKIP            0.00s   exit status 77
15/16 test-server                         SKIP            0.00s   exit status 77
16/16 test-server-message-variant         SKIP            0.00s   exit status 77

Ok:                 0
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            16
Timeout:            0

Full log written to /home/test/Code/sdbusplus/build/meson-logs/testlog.txt

I'm not sure if this is a problem so I continue to execute ninja install and I got this.

...
Installing /home/test/Code/sdbusplus/include/sdbusplus/server/transaction.hpp to /usr/local/include/sdbusplus/server
Installing /home/test/Code/sdbusplus/include/sdbusplus/server/README.md to /usr/local/include/sdbusplus/server
Installing /home/test/Code/sdbusplus/include/sdbusplus/server/manager.hpp to /usr/local/include/sdbusplus/server
Installing /home/test/Code/sdbusplus/include/sdbusplus/message/append.hpp to /usr/local/include/sdbusplus/message
Installing /home/test/Code/sdbusplus/include/sdbusplus/message/read.hpp to /usr/local/include/sdbusplus/message
Installing /home/test/Code/sdbusplus/include/sdbusplus/message/types.hpp to /usr/local/include/sdbusplus/message
Installing /home/test/Code/sdbusplus/include/sdbusplus/message/native_types.hpp to /usr/local/include/sdbusplus/message
Installing libsdbusplus.so.1.0.0 to /usr/local/lib
RPATH changes at install time disabled
Installing /home/test/Code/sdbusplus/build/meson-private/sdbusplus.pc to /usr/local/lib/pkgconfig

Finally, there's no setup.py file in sdbusplus/build/tools so I can't go further.

Thanks, Victor.

williamspatrick commented 2 years ago

Finally, there's no setup.py file in sdbusplus/build/tools so I can't go further.

This repository supplies two different install flows for two different components.

  1. the sdbusplus library, which is C++ and often used on target devices.
  2. the sdbus++ tool, which is Python, generates dbus interface bindings (C++ headers), and is usually used on build systems (in Yocto terms the “native” context).

Ninja/Meson will handle flow 1 and Python Setuptools can handle flow 2. The setuptools file exists already under tools. These two flows aren’t tied together in any way because usually you are using one or the other, and not both, on a particular compile target.

Then I run ninja test, it seems that it skips all tests.

Based on the “romulus” and “arm” in the paths of your log, it looks like you’ve sourced an SDK build script (which is fine). This means that Meson/Ninja are cross-compiling for ARM. When you run “ninja test”, it is aware that all the binaries are cross-compiled and not native and so it knows it can’t run the test executables and just “skips” them. You can’t run ARM test cases on an x86 build system.

If you want to run the test cases you need to either: