libpldm: Rationalise the local and installed path of pldm.h
Since chopping libpldm out of openbmc/pldm.git there's been a symlink
from `include/libpldm/pldm.h` pointing to
`include/libpldm/requester/pldm.h`. The file list contained in the
`libpldm_headers` variable defined by `include/libpldm/meson.build`
contained an entry for `requester/pldm.h`, though not the symlink found
at `include/libpldm/pldm.h`.
Prior to a7989cd65d51 ("meson: Fix for OEM header collision issue")
`install_headers(libpldm_headers, ...)` directive didn't specify
`preserve_path: true`, therefore the `requester/pldm.h` header file was
installed directly under `${INCLUDEDIR}/libpldm` as
`${INCLUDEDIR}/libpldm/pldm.h`, and no file was installed to
`${INCLUDEDIR}/libpldm/requester/pldm.h`.
All dependent applications using the declarations in `pldm.h` therefore
included the header using the directive `#include <libpldm/pldm.h>`.
However, internal to the libpldm implementation we were using the
non-symlinked path in the local tree:
`#include "libpldm/requester/pldm.h"`
With a7989cd65d51 ("meson: Fix for OEM header collision issue") we
rationalised the meson variables used to install the headers as part of
properly separating OEM headers from one-another. This lead to
specifying `preserve_path: true` for the
`install_headers(libpldm_headers, ...)` meson directive, which further
lead to the installed location of `pldm.h` changing to
`${INCLUDEDIR}/libpldm/requester/pldm.h`. This broke all consuming
applications which were necessarily using `#include <libpldm/pldm.h>` as
outlined above.
Get rid of the symlink at `include/libpldm/pldm.h`, move
`include/libpldm/requester/pldm.h` there instead, and fix up all
internal references to the header. This unbreaks applications consuming
libpldm, and prevents internal inconsistencies going forward.
Fixes: a7989cd65d51 ("meson: Fix for OEM header collision issue")
Change-Id: I24f1e25303890c41fd3da6323c67d838022cc55d
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8284317..16dc0b4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,10 @@
2. transport: af-mctp: Stabilise pldm_transport_af_mctp_bind()
3. libpldm: Fix header use
+### Fixed
+
+1. libpldm: Rationalise the local and installed path of pldm.h
+
## [0.7.0] - 2023-08-29
### Added
diff --git a/include/libpldm/meson.build b/include/libpldm/meson.build
index 076b0aa..f1988cd 100644
--- a/include/libpldm/meson.build
+++ b/include/libpldm/meson.build
@@ -9,7 +9,7 @@
'pdr.h',
'platform.h',
'pldm_types.h',
- 'requester/pldm.h',
+ 'pldm.h',
'state_set.h',
'states.h',
'transport.h',
diff --git a/include/libpldm/pldm.h b/include/libpldm/pldm.h
deleted file mode 120000
index 7d352b9..0000000
--- a/include/libpldm/pldm.h
+++ /dev/null
@@ -1 +0,0 @@
-requester/pldm.h
\ No newline at end of file
diff --git a/include/libpldm/requester/pldm.h b/include/libpldm/pldm.h
similarity index 100%
rename from include/libpldm/requester/pldm.h
rename to include/libpldm/pldm.h
diff --git a/src/requester/instance-id.c b/src/requester/instance-id.c
index aaeca3e..7b6de87 100644
--- a/src/requester/instance-id.c
+++ b/src/requester/instance-id.c
@@ -2,7 +2,7 @@
// NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
#define _GNU_SOURCE
#include <libpldm/instance-id.h>
-#include <libpldm/requester/pldm.h>
+#include <libpldm/pldm.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/src/requester/pldm.c b/src/requester/pldm.c
index c771091..d01a2ad 100644
--- a/src/requester/pldm.c
+++ b/src/requester/pldm.c
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
#include <libpldm/base.h>
-#include <libpldm/requester/pldm.h>
+#include <libpldm/pldm.h>
#include <libpldm/transport.h>
#include <bits/types/struct_iovec.h>
diff --git a/src/responder.c b/src/responder.c
index 9940fa0..8e70e4a 100644
--- a/src/responder.c
+++ b/src/responder.c
@@ -2,7 +2,7 @@
#include "responder.h"
#include <libpldm/base.h>
-#include <libpldm/requester/pldm.h>
+#include <libpldm/pldm.h>
#include <stdbool.h>
diff --git a/src/transport/transport.c b/src/transport/transport.c
index bc01000..295e78d 100644
--- a/src/transport/transport.c
+++ b/src/transport/transport.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
#include "libpldm/transport.h"
#include "libpldm/base.h"
-#include "libpldm/requester/pldm.h"
+#include "libpldm/pldm.h"
#include "transport.h"
#include <errno.h>
diff --git a/src/transport/transport.h b/src/transport/transport.h
index 81d7b61..9887216 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -3,7 +3,7 @@
#define LIBPLDM_SRC_TRANSPORT_TRANSPORT_H
#include "libpldm/base.h"
-#include "libpldm/requester/pldm.h"
+#include "libpldm/pldm.h"
struct pollfd;
/**