Details
-
Bug
-
Resolution: Low Priority
-
Minor
-
Lustre 2.0.0
-
Lustre 2.0.66
-
3
-
8639
Description
The dependencies listed for the libcfsutil.a target are incorrect. The sources for that library are listed in libcfs/libcfs/autoMakefile.am as:
libcfsutil_a_SOURCES = nidstrings.c util/parser.c util/parser.h util/platform.h \ util/l_ioctl.c util/util.c
Expanding out the above relative pathnames for the referenced [parser|platform].h files gives the following files:
libcfs/libcfs/util/parser.h libcfs/libcfs/util/platform.h
The problem is these files do not exist. My assumption is, the dependencies it is intending to use are the following files:
libcfs/include/libcfs/util/parser.h libcfs/include/libcfs/util/platform.h
Even worse, the [parser|platform].c files do not reference [parser|platform].h directly. These files are included through the directive:
#include <libcfs/libcfsutil.h>
But a dependency on libcfsutil.h is not in the *_SOURCES variable.
I think the right thing to do in this situation would be to fix these path issues using an "absolute" path to the needed files, using a reference to the top of the source tree. For example:
libcfsutil_a_SOURCES = $(top_srcdir)/libcfs/libcfs/util/nidstrings.c \ $(top_srcdir)/libcfs/libcfs/util/parser.c \ $(top_srcdir)/libcfs/libcfs/util/l_ioctl.c \ $(top_srcdir)/libcfs/libcfs/util/util.c \ $(top_srcdir)/libcfs/include/libcfs/util/parser.h \ $(top_srcdir)/libcfs/include/libcfs/util/platform.h \ $(top_srcdir)/libcfs/include/libcfs/libcfsutil.h
Although, full pathnames are not used throughout the build system for Lustre, thus the inconsistency of using full pathnames here is not ideal.
The patch submitted for LU-455, http://review.whamcloud.com/#change,1092, "fixes" this issue simply by removing the [parser|platform].h dependencies from the list of *_SOURCES.
Mostly I want to be clear that we think this is likely a common problem in the build system. I don't think there is a point to fixing just these two. If we fix it, we should figure out the correct solution and apply it everywhere that it is needed.
I see no hurry to fix this either. I think that making some of the bigger changes like moving ldiskfs and the lustre kernel patches out of the lustre tree would be excellent first steps to cleaning up the build system. Once those are done, it will be easier to start some of the finer cleanup like this.
I would not suggest using the full path when the files are in the same directory as the makefile, or in subdirectories below the make file. I would perhaps only use the $(top_builddir) form of the path when we need to walk back up the tree. I am not really particularly opposed to using "..", though.