[cmake-developers] Export files in the build tree have a total path length which is unnecessarily long

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sun Aug 7 01:39:11 EDT 2016


I have a simple project called test_fortran which somone else is
testing for me on MinGW-w64/MSYS2, and it failed because the following
file

D:/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/build_tree/src_lib/CMakeFiles/Export/D_/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/install_tree/lib/cmake/test_fortran/export_test_fortran-noconfig.cmake

configured (or generated) by cmake had too long a pathname for that
platform.  The complete cmake output for this test_fortran project
was

-- The Fortran compiler identification is GNU 4.9.2
-- Check for working Fortran compiler: C:/msys64/usr/bin/f95.exe
-- Check for working Fortran compiler: C:/msys64/usr/bin/f95.exe  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether C:/msys64/usr/bin/f95.exe supports Fortran 90
-- Checking whether C:/msys64/usr/bin/f95.exe supports Fortran 90 -- yes
-- Configuring done
CMake Error: cannot write to file "D:/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/build_tree/src_lib/CMakeFiles/Export/D_/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/install_tree/lib/cmake/test_fortran/export_test_fortran-noconfig.cmake": No such file or directory
-- Generating done
-- Build files have been written to: D:/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/build_tree

(Another such file called

D:/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/build_tree/src_lib/CMakeFiles/Export/D_/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/install_tree/lib/cmake/test_fortran/export_test_fortran.cmake

just squeaked under the limit for that platform so was generated in
the build tree OK.  (Note for my test of that same project on Linux
these exported files in the build tree had similar long total path
lengths, but it is OK in that case because of the very long total path
length on Linux.)

Note that in all cases the total path length of those export files in
the build tree are significantly longer than they need to be. For
example, for this particular user's test of this project the build
tree prefix was

D:/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/build_tree

so we are stuck with that part of the path length, but why is
the install location of these export files (in this case

D:/plplot-svn/comprehensive_test_fortran_disposeable/shared/noninteractive/install_tree/lib/cmake/test_fortran

) included (in encoded form with D: replaced by D_) in the pathname for both
export files (export_test_fortran-noconfig.cmake and
export_test_fortran.cmake)?
That significantly increases the pathlength of these files to no purpose since the
install location of these files is already known to CMake by other means.

This issue is critical on platforms like MinGW-w64/MSYS2 with limited
total path length so it would be good to get it addressed.  If cmake
developers feel the fix for this issue will require sufficient time to
warrant bug triage, let me know, and I would be willing to start that
process by copying the above discussion to the bugtracker.  But
ideally it would require only a quick fix that does not require bug
triage.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the cmake-developers mailing list