On 2016-08-09 10:11-0400 Brad King wrote:

On 08/08/2016 02:54 PM, Alan W. Irwin wrote:
For all such staging areas, would it be straightforward to hash the
paths for the cmake-generated EXPORT files in the build tree to
substantially reduce their pathlengths for the absolute install
location case while still avoiding name collisions?

Actually it looks like we already do this, but the logic forgot
to account for the length of the file name.  Please try this fix:

install(EXPORT): Fix support for mid-length install destinations on Windows
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c7a319ab


Hi Brad:

I don't have access to Windows, but I tried this fix on Linux with a
very long CMAKE_INSTALL_PREFIX (to trigger the hashing), and all seems
to be well.

software@raven> ~/cmake/install-c7a319a/bin/cmake 
-DCMAKE_INSTALL_PREFIX=$(pwd)/42397430947234398793874973983732987249739347293472938729487239472439782394723492374294847234927423497971498749237349723958749473934873497235987549023475/92752349572349053475945729729527234957349735209573999725497834957249524752904573975295742957349857934539709925294754973957493720274903485230252239/42397430947234398793874973983732987249739347293472938729487239472439782394723492374294847234927423497971498749237349723958749473934873497235987549023475/92752349572349053475945729729527234957349735209573999725497834957249524752904573975295742957349857934539709925294754973957493720274903485230252239/42397430947234398793874973983732987249739347293472938729487239472439782394723492374294847234927423497971498749237349723958749473934873497235987549023475/92752349572349053475945729729527234957349735209573999725497834957249524752904573975295742957349857934539709925294754973957493720274903485230252239/423974309472343987
93874973983732987249739347293472938729487239472439782394723492374294847234927423497971498749237349723958749473934873497235987549023475/92752349572349053475945729729527234957349735209573999725497834957249524752904573975295742957349857934539709925294754973957493720274903485230252239/42397430947234398793874973983732987249739347293472938729487239472439782394723492374294847234927423497971498749237349723958749473934873497235987549023475/92752349572349053475945729729527234957349735209573999725497834957249524752904573975295742957349857934539709925294754973957493720274903485230252239/42397430947234398793874973983732987249739347293472938729487239472439782394723492374294847234927423497971498749237349723958749473934873497235987549023475/92752349572349053475945729729527234957349735209573999725497834957249524752904573975295742957349857934539709925294754973957493720274903485230252239/4239743094723439879387497398373298724973934729347293872948723947243978239472349237429484723492742349797149874923734
9723958749473934873497235987549023475/92752349572349053475945729729527234957349735209573999725497834957249524752904573975295742957349857934539709925294754973957493720274903485230252239/42397430947234398793874973983732987249739347293472938729487239472439782394723492374294847234927423497971498749237349723958749473934873497235987549023475/92752349572349053475945729729527234957349735209573999725497834957249524752904573975295742957349857934539709925294754973957493720274903485230252239/install_tree
 -DBUILD_TEST=ON ..
-- The Fortran compiler identification is GNU 4.9.2
-- Check for working Fortran compiler: /usr/bin/f95
-- Check for working Fortran compiler: /usr/bin/f95  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 -- yes
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/software/plplot/HEAD/plplot.git/cmake/test_fortran/build_dir

Despite that long install prefix (note the numbers have "/" embedded
periodically to avoid going over the individual filename length limit
on Linux), the exported files in the build-tree staging area appeared
in hashed form, e.g.,

software@raven> pwd
/home/software/plplot/HEAD/plplot.git/cmake/test_fortran/build_dir
software@raven> find $(pwd) -type f |grep -i export
/home/software/plplot/HEAD/plplot.git/cmake/test_fortran/build_dir/src_lib/CMakeFiles/Export/57a65d04a859ba876e044822264a11fe/export_test_fortran.cmake
/home/software/plplot/HEAD/plplot.git/cmake/test_fortran/build_dir/src_lib/CMakeFiles/Export/57a65d04a859ba876e044822264a11fe/export_test_fortran-noconfig.cmake

and after "make install" were installed in unhashed form (pathname
length as large as 2471 for this particular test case) without issues.

By the way, an install prefix of roughly 500 in length did not trigger
the hashing.  But I assume that lack of hashing for smaller-sized
prefixes on Linux is due to some knowledge CMake has about pathname
length limits on that platform, and hashing will be triggered for much
smaller install prefixes on MinGW-w64/MSYS2 because of the known much
smaller total pathname length limits on that platform.

By the way, you already know about this from our off-list discussions,
but for others here it will likely be September before that platform
can be tested by the guy who originally reported the issue to me to
make sure this fix solves the issue he discovered.

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
__________________________
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to