Re: [cmake-developers] cmake 3.7.0-rc3 regression

2016-11-08 Thread Brad King
On 11/08/2016 02:16 PM, Robert Goulet wrote:
> +  if (cmSystemToolsCMakeRoot.empty()) {
> +std::string dir = cmSystemTools::GetFilenamePath(exe_dir);

Please see my sibling response for why more logic is needed.

-Brad

-- 

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


Re: [cmake-developers] cmake 3.7.0-rc3 regression

2016-11-08 Thread Robert Goulet
Anyhow, here's a quick patch that fixes it.

Thanks.

-Original Message-
From: Robert Goulet 
Sent: Tuesday, November 8, 2016 2:09 PM
To: 'Rolf Eike Beer' ; cmake-developers@cmake.org
Subject: RE: [cmake-developers] cmake 3.7.0-rc3 regression

Not sure I understand why is this part of a build switch now? And what if we 
don't build CMake ourselves but instead, using prebuilt binaries from the CMake 
website?

-Original Message-
From: Rolf Eike Beer [mailto:e...@sf-mail.de]
Sent: Tuesday, November 8, 2016 2:04 PM
To: cmake-developers@cmake.org
Cc: Robert Goulet 
Subject: Re: [cmake-developers] cmake 3.7.0-rc3 regression

Am Dienstag, 8. November 2016, 18:59:34 schrieb Robert Goulet:
> Hi,
> 
> After trying to upgrade to CMake 3.7.0-rc3, we've found the following
> regression:
> 
> Previously, we were able to put multiple platform CMake executables in 
> the same root by just renaming the "bin" folder, so that they don't 
> overlap each other, as such:
> 
> cmake/win/cmake.exe
> cmake/mac/cmake
> cmake/linux/cmake
> cmake/share/...
> cmake/doc/...
> 
> However in 3.7.0-rc3 this is broken, no longer works if the CMake 
> binary folder isn't named specifically "bin". CMake will fail to 
> start, reporting "CMake Error: Could not find CMAKE_ROOT !!!".
> 
> Traced it back to this commit:
> 
> Commit: 18bfbc972fd3daf3e973f80072c4de09ec7e852b
> 
> Add option to control 'bin' directory of CMake's own installation
> (#16076)
> 
> Add a `CMAKE_BIN_DIR` cache entry to CMake's own build configuration.
> Add a `--bindir` option to the `bootstrap` script to set it.
> 
> If this wasn't intentional, can we get a fix before 3.7.0 is released?

If you read the commit message you should be able to fix your problem: just 
build the different CMake instances with different --bindir switches.

Eike


0001-Fix-CMake-regression-unable-to-locate-cmake-root-dir.patch
Description: 0001-Fix-CMake-regression-unable-to-locate-cmake-root-dir.patch
-- 

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

Re: [cmake-developers] cmake 3.7.0-rc3 regression

2016-11-08 Thread Brad King
On 11/08/2016 01:59 PM, Robert Goulet wrote:
> Commit: 18bfbc972fd3daf3e973f80072c4de09ec7e852b
> Add option to control 'bin' directory of CMake's own installation (#16076)

I suspect it is caused by this hunk:

> -  // Install tree has "/bin/cmake" and "".
> -  std::string dir = cmSystemTools::GetFilenamePath(exe_dir);
> -  cmSystemToolsCMakeRoot = dir + CMAKE_DATA_DIR;
> -  if (!cmSystemTools::FileExists(
> +  // Install tree has
> +  // - "/cmake"
> +  // - ""
> +  if (cmHasSuffix(exe_dir, CMAKE_BIN_DIR)) {
> +std::string const prefix =
> +  exe_dir.substr(0, exe_dir.size() - strlen(CMAKE_BIN_DIR));
> +cmSystemToolsCMakeRoot = prefix + CMAKE_DATA_DIR;
> +  }
> +  if (cmSystemToolsCMakeRoot.empty() ||
> +  !cmSystemTools::FileExists(

Prior to that we would blindly strip one directory off the location no
matter its name.  Now we need to look for and strip the exactly-configured
name of the bin directory because it may be more than one layer deep.

CMake locates its own resources relative to its executable in order to
make it relocatable.  This means we don't expect the layout of the install
tree to be changed after installation.  You're doing that, so your use case
is not supported.

However, what the above commit did was give you a first-class way of
supporting your use case by building with `CMAKE_BIN_DIR` set to the
platform-specific name.  You can use that to achieve the same result.

Alternatively, if you *really* want to support your original use case
you can work on a change to the above logic to count the number of path
components in CMAKE_BIN_DIR and strip that many blindly instead of looking
for the exact suffix.  I won't be holding up 3.7 for that though.

-Brad

-- 

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


Re: [cmake-developers] cmake 3.7.0-rc3 regression

2016-11-08 Thread Rolf Eike Beer
Am Dienstag, 8. November 2016, 18:59:34 schrieb Robert Goulet:
> Hi,
> 
> After trying to upgrade to CMake 3.7.0-rc3, we've found the following
> regression:
> 
> Previously, we were able to put multiple platform CMake executables in the
> same root by just renaming the "bin" folder, so that they don't overlap
> each other, as such:
> 
> cmake/win/cmake.exe
> cmake/mac/cmake
> cmake/linux/cmake
> cmake/share/...
> cmake/doc/...
> 
> However in 3.7.0-rc3 this is broken, no longer works if the CMake binary
> folder isn't named specifically "bin". CMake will fail to start, reporting
> "CMake Error: Could not find CMAKE_ROOT !!!".
> 
> Traced it back to this commit:
> 
> Commit: 18bfbc972fd3daf3e973f80072c4de09ec7e852b
> 
> Add option to control 'bin' directory of CMake's own installation
> (#16076)
> 
> Add a `CMAKE_BIN_DIR` cache entry to CMake's own build configuration.
> Add a `--bindir` option to the `bootstrap` script to set it.
> 
> If this wasn't intentional, can we get a fix before 3.7.0 is released?

If you read the commit message you should be able to fix your problem: just 
build the different CMake instances with different --bindir switches.

Eike

signature.asc
Description: This is a digitally signed message part.
-- 

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

Re: [cmake-developers] cmake 3.7.0-rc3 regression

2016-11-08 Thread Robert Goulet
Not sure I understand why is this part of a build switch now? And what if we 
don't build CMake ourselves but instead, using prebuilt binaries from the CMake 
website?

-Original Message-
From: Rolf Eike Beer [mailto:e...@sf-mail.de] 
Sent: Tuesday, November 8, 2016 2:04 PM
To: cmake-developers@cmake.org
Cc: Robert Goulet 
Subject: Re: [cmake-developers] cmake 3.7.0-rc3 regression

Am Dienstag, 8. November 2016, 18:59:34 schrieb Robert Goulet:
> Hi,
> 
> After trying to upgrade to CMake 3.7.0-rc3, we've found the following
> regression:
> 
> Previously, we were able to put multiple platform CMake executables in 
> the same root by just renaming the "bin" folder, so that they don't 
> overlap each other, as such:
> 
> cmake/win/cmake.exe
> cmake/mac/cmake
> cmake/linux/cmake
> cmake/share/...
> cmake/doc/...
> 
> However in 3.7.0-rc3 this is broken, no longer works if the CMake 
> binary folder isn't named specifically "bin". CMake will fail to 
> start, reporting "CMake Error: Could not find CMAKE_ROOT !!!".
> 
> Traced it back to this commit:
> 
> Commit: 18bfbc972fd3daf3e973f80072c4de09ec7e852b
> 
> Add option to control 'bin' directory of CMake's own installation
> (#16076)
> 
> Add a `CMAKE_BIN_DIR` cache entry to CMake's own build configuration.
> Add a `--bindir` option to the `bootstrap` script to set it.
> 
> If this wasn't intentional, can we get a fix before 3.7.0 is released?

If you read the commit message you should be able to fix your problem: just 
build the different CMake instances with different --bindir switches.

Eike
-- 

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


[cmake-developers] cmake 3.7.0-rc3 regression

2016-11-08 Thread Robert Goulet
Hi,

After trying to upgrade to CMake 3.7.0-rc3, we've found the following 
regression:

Previously, we were able to put multiple platform CMake executables in the same 
root by just renaming the "bin" folder, so that they don't overlap each other, 
as such:

cmake/win/cmake.exe
cmake/mac/cmake
cmake/linux/cmake
cmake/share/...
cmake/doc/...

However in 3.7.0-rc3 this is broken, no longer works if the CMake binary folder 
isn't named specifically "bin". CMake will fail to start, reporting "CMake 
Error: Could not find CMAKE_ROOT !!!".

Traced it back to this commit:

Commit: 18bfbc972fd3daf3e973f80072c4de09ec7e852b

Add option to control 'bin' directory of CMake's own installation (#16076)

Add a `CMAKE_BIN_DIR` cache entry to CMake's own build configuration.
Add a `--bindir` option to the `bootstrap` script to set it.

If this wasn't intentional, can we get a fix before 3.7.0 is released?

Thanks!
-- 

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