Enable an io-uring build

There exists a bug where calls that we previously thought were
non-blocking, actually do block when used with hwmon or filesystem fds.
This causes high latencies on the dbus interfaces when lots of sensors
are used in a single daemon, as is the case in PSUSensor.

This patchset moves the PSUSensor code over to using io-uring, through
boost asio, using the random_access_file class.  This helps with
performance in a number of ways, the largest of which being that sensor
reads are no longer blocking.

Tested:

Booted the sensor system on Tyan S7106;  dbus-monitor shows sensors
scanning normally.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I654eafcfab5a24b65b89c204ab43d81c7ae064cf
diff --git a/meson.build b/meson.build
index 48c7c27..8b29e64 100644
--- a/meson.build
+++ b/meson.build
@@ -11,6 +11,16 @@
     meson_version: '>=0.57.0',
 )
 
+# Note, there is currently an issue with CPUSensor when used in conjunction
+# with io_uring.  For the moment, we enable uring for all other daemons, but
+# we'd like to enable it for all daemons.
+# https://github.com/openbmc/dbus-sensors/issues/19
+uring_args = [
+    '-DBOOST_ASIO_HAS_IO_URING',
+    '-DBOOST_ASIO_DISABLE_EPOLL',
+    '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT',
+]
+
 add_project_arguments(
     '-Wno-psabi',
     '-Wuninitialized',
@@ -34,7 +44,13 @@
 # i2c-tools doesn't ship a pkg-config file for libi2c
 i2c = meson.get_compiler('cpp').find_library('i2c')
 
-sdbusplus = dependency('sdbusplus')
+sdbusplus = dependency('sdbusplus', required : false, include_type: 'system')
+if not sdbusplus.found()
+  sdbusplus_proj = subproject('sdbusplus', required: true)
+  sdbusplus = sdbusplus_proj.get_variable('sdbusplus_dep')
+  sdbusplus = sdbusplus.as_system('system')
+endif
+
 phosphor_logging_dep = dependency('phosphor-logging')
 
 if cpp.has_header('nlohmann/json.hpp')
@@ -49,10 +65,27 @@
     pkgconfig_define: ['prefix', get_option('prefix')])
 threads = dependency('threads')
 
+boost = dependency('boost',version : '>=1.79.0', required : false, include_type: 'system')
+if not boost.found()
+  subproject('boost', required: false)
+  boost_inc = include_directories('subprojects/boost_1_79_0/', is_system:true)
+  boost  = declare_dependency(include_directories : boost_inc)
+  boost = boost.as_system('system')
+endif
+
+uring = dependency('liburing', required : false, include_type: 'system')
+if not uring.found()
+  uring_proj = subproject('liburing', required: true)
+  uring = uring_proj.get_variable('uring')
+  uring = uring.as_system('system')
+endif
+
 default_deps = [
+    boost,
     nlohmann_json,
     phosphor_logging_dep,
     sdbusplus,
+    uring,
 ]
 
 thresholds_a = static_library(