Re: [CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-22 Thread Malfettone, Kris
Thank you Nils, will do.

From: Nils Gladitz [mailto:nilsglad...@gmail.com]
Sent: Wednesday, February 22, 2017 4:17 PM
To: Malfettone, Kris <kris.malfett...@msx.bala.susq.com>; cmake@cmake.org
Subject: Re: [CMake] Potential bug: Having executables named "test" causes 
Ninja generator to generate ambiguous rules...

On 22.02.2017 22:11, Malfettone, Kris wrote:
Is there a bug tracker or somewhere that I should report this as well?  I just 
want to make sure I put the right information in the right spot so the ninja 
generator maintainer might see it.

I am not sure there is a dedicated maintainer for the Ninja generator currently 
but either way the users mailing list might not be the best place to reach the 
developers.
The issue tracker is available here: 
https://gitlab.kitware.com/cmake/cmake/issues
The developers mailing list here: 
https://cmake.org/mailman/listinfo/cmake-developers

Nils



IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or her employer nor any of 
their respective affiliates makes any warranties as to the completeness or 
accuracy of any of the information contained herein or that this message or any 
of its attachments is free of viruses.
-- 

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

Re: [CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-22 Thread Nils Gladitz

On 22.02.2017 22:11, Malfettone, Kris wrote:


Is there a bug tracker or somewhere that I should report this as 
well?  I just want to make sure I put the right information in the 
right spot so the ninja generator maintainer might see it.




I am not sure there is a dedicated maintainer for the Ninja generator 
currently but either way the users mailing list might not be the best 
place to reach the developers.
The issue tracker is available here: 
https://gitlab.kitware.com/cmake/cmake/issues
The developers mailing list here: 
https://cmake.org/mailman/listinfo/cmake-developers


Nils
-- 

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

Re: [CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-22 Thread Malfettone, Kris
Is there a bug tracker or somewhere that I should report this as well?  I just 
want to make sure I put the right information in the right spot so the ninja 
generator maintainer might see it.

From: Nils Gladitz [mailto:nilsglad...@gmail.com]
Sent: Wednesday, February 15, 2017 9:41 AM
To: Malfettone, Kris <kris.malfett...@msx.bala.susq.com>; cmake@cmake.org
Subject: Re: [CMake] Potential bug: Having executables named "test" causes 
Ninja generator to generate ambiguous rules...

On 15.02.2017 15:16, Malfettone, Kris wrote:
Just noticed a problem in my example.  In my attempt to simplify my example I 
moved both outputs into the same folder which in my opinion is invalid because 
both output file names are the same.  However, the same basic setup does 
reproduce the problem if you move the two targets into their own subdirs.  I 
was just trying to avoid describing that in the email.  Here is what I mean 
below:

I thought you meant you had a target named "test" but apparently only your 
output is named that way.
That certainly isn't covered by the existing policy.

Nils



IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or her employer nor any of 
their respective affiliates makes any warranties as to the completeness or 
accuracy of any of the information contained herein or that this message or any 
of its attachments is free of viruses.
-- 

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

Re: [CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-15 Thread Nils Gladitz

On 15.02.2017 15:16, Malfettone, Kris wrote:


Just noticed a problem in my example.  In my attempt to simplify my 
example I moved both outputs into the same folder which in my opinion 
is invalid because both output file names are the same.  However, the 
same basic setup does reproduce the problem if you move the two 
targets into their own subdirs. I was just trying to avoid describing 
that in the email. Here is what I mean below:




I thought you meant you had a target named "test" but apparently only 
your output is named that way.

That certainly isn't covered by the existing policy.

Nils
-- 

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

Re: [CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-15 Thread Malfettone, Kris
Just noticed a problem in my example.  In my attempt to simplify my example I 
moved both outputs into the same folder which in my opinion is invalid because 
both output file names are the same.  However, the same basic setup does 
reproduce the problem if you move the two targets into their own subdirs.  I 
was just trying to avoid describing that in the email.  Here is what I mean 
below:

Top level CMakeLists.txt:
cmake_minimum_required(VERSION 3.7)
enable_testing()
project("bugreproduce")
add_subdirectory("subdir")
add_subdirectory("subdir2")
subdir with CMakeLists.txt:
add_executable( "Foo.test" foo_test.cpp )
set_target_properties("Foo.test" PROPERTIES OUTPUT_NAME test )
add_test(NAME "Foo.test" COMMAND test)
subdir2 with CMakeLists.txt:
add_executable( "Bar.test" bar_test.cpp )
set_target_properties("Bar.test" PROPERTIES OUTPUT_NAME test )
add_test(NAME "Bar.test" COMMAND test )

Contents of both source files (obviously in their respective subdirectories):
int main( int, char** )
{
   return 0;
}

Sorry for that.

From: Malfettone, Kris
Sent: Wednesday, February 15, 2017 9:07 AM
To: Malfettone, Kris <kris.malfett...@msx.bala.susq.com>; Nils Gladitz 
<nilsglad...@gmail.com>; cmake@cmake.org
Subject: RE: [CMake] Potential bug: Having executables named "test" causes 
Ninja generator to generate ambiguous rules...

So I was able to reproduce the problem with this very simple CMakeLists.txt 
setup.  I cannot attach source files due to my company's mail server 
automatically stripping them out attachments with code but here is all you 
would need to reproduce the problem:

Single CMakeLists.txt with the following:
cmake_minimum_required(VERSION 3.7)
enable_testing()
project("bugreproduce")
add_executable( "Foo.test" foo_test.cpp )
add_executable( "Bar.test" bar_test.cpp )
set_target_properties("Foo.test" PROPERTIES OUTPUT_NAME test )
set_target_properties("Bar.test" PROPERTIES OUTPUT_NAME test )
add_test(NAME "Foo.test" COMMAND test)
add_test(NAME "Bar.test" COMMAND test )
Two source files named foo_test.cpp and bar_test.cpp both containing the 
following code in the same directory:
int main( int, char** )
{
   return 0;
}

If you generate a Makefile based solution everything works fine.  However, if 
you generate a ninja based solution then you get the following:
ninja: warning: multiple rules generate test. builds involving this target will 
not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate test. builds involving this target will 
not be correct; continuing anyway [-w dupbuild=warn]

-Kris

From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Malfettone, Kris
Sent: Wednesday, February 15, 2017 8:27 AM
To: Nils Gladitz <nilsglad...@gmail.com<mailto:nilsglad...@gmail.com>>; 
cmake@cmake.org<mailto:cmake@cmake.org>
Subject: Re: [CMake] Potential bug: Having executables named "test" causes 
Ninja generator to generate ambiguous rules...

Good to know.  Thanks for the quick response.  Though I do not believe I am 
violating that particular rule here.  That is why I do not receive either a 
warning or error from CMake in my output.

The only warning I see is from ninja:
ninja: warning: multiple rules generate MD/MDF/Formats/SIG/BCP/v0_1/test. 
builds involving this target will not be correct; continuing anyway [-w 
dupbuild=warn]
ninja: warning: multiple rules generate MD/MDF/Formats/SIG/BCP/v0_2/test. 
builds involving this target will not be correct; continuing anyway [-w 
dupbuild=warn]
ninja: warning: multiple rules generate test. builds involving this target will 
not be correct; continuing anyway [-w dupbuild=warn]

I think the difference is that my target names are:
MD.MDF.Formats.SIG.BCP.v0_1.test
MD.MDF.Formats.SIG.BCP.v0_2.test

It is the ninja generator that is trying to setup aliases for each of them as a 
shortened form.  So I think one of the following statements are true:

* The cmake rule intended for the above two target names to be invalid. 
 But the check to issue a warning or error has a bug causing them to be missed. 
 This would explain why I do not get the error in my configure results.

* The cmake rule intended for the above two target names to be valid.  
However, on further reflection the rule should be made stricter to include my 
target names above.  This would then require and update to the cmake code 
checking that policy and lead to me actually getting a warning or error from 
cmake during configure.

* The ninja generator has a bug and is setting up ambiguous aliases for 
what CMake considers valid target names.

My project is huge so I will try and craft a simplified CMakeLists.txt example 
to reproduce the problem as well.

Does this make sense?  Am I still missing something?

-Kris


Re: [CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-15 Thread Malfettone, Kris
So I was able to reproduce the problem with this very simple CMakeLists.txt 
setup.  I cannot attach source files due to my company's mail server 
automatically stripping them out attachments with code but here is all you 
would need to reproduce the problem:

Single CMakeLists.txt with the following:
cmake_minimum_required(VERSION 3.7)
enable_testing()
project("bugreproduce")
add_executable( "Foo.test" foo_test.cpp )
add_executable( "Bar.test" bar_test.cpp )
set_target_properties("Foo.test" PROPERTIES OUTPUT_NAME test )
set_target_properties("Bar.test" PROPERTIES OUTPUT_NAME test )
add_test(NAME "Foo.test" COMMAND test)
add_test(NAME "Bar.test" COMMAND test )
Two source files named foo_test.cpp and bar_test.cpp both containing the 
following code in the same directory:
int main( int, char** )
{
   return 0;
}

If you generate a Makefile based solution everything works fine.  However, if 
you generate a ninja based solution then you get the following:
ninja: warning: multiple rules generate test. builds involving this target will 
not be correct; continuing anyway [-w dupbuild=warn]
ninja: warning: multiple rules generate test. builds involving this target will 
not be correct; continuing anyway [-w dupbuild=warn]

-Kris

From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Malfettone, Kris
Sent: Wednesday, February 15, 2017 8:27 AM
To: Nils Gladitz <nilsglad...@gmail.com>; cmake@cmake.org
Subject: Re: [CMake] Potential bug: Having executables named "test" causes 
Ninja generator to generate ambiguous rules...

Good to know.  Thanks for the quick response.  Though I do not believe I am 
violating that particular rule here.  That is why I do not receive either a 
warning or error from CMake in my output.

The only warning I see is from ninja:
ninja: warning: multiple rules generate MD/MDF/Formats/SIG/BCP/v0_1/test. 
builds involving this target will not be correct; continuing anyway [-w 
dupbuild=warn]
ninja: warning: multiple rules generate MD/MDF/Formats/SIG/BCP/v0_2/test. 
builds involving this target will not be correct; continuing anyway [-w 
dupbuild=warn]
ninja: warning: multiple rules generate test. builds involving this target will 
not be correct; continuing anyway [-w dupbuild=warn]

I think the difference is that my target names are:
MD.MDF.Formats.SIG.BCP.v0_1.test
MD.MDF.Formats.SIG.BCP.v0_2.test

It is the ninja generator that is trying to setup aliases for each of them as a 
shortened form.  So I think one of the following statements are true:

* The cmake rule intended for the above two target names to be invalid. 
 But the check to issue a warning or error has a bug causing them to be missed. 
 This would explain why I do not get the error in my configure results.

* The cmake rule intended for the above two target names to be valid.  
However, on further reflection the rule should be made stricter to include my 
target names above.  This would then require and update to the cmake code 
checking that policy and lead to me actually getting a warning or error from 
cmake during configure.

* The ninja generator has a bug and is setting up ambiguous aliases for 
what CMake considers valid target names.

My project is huge so I will try and craft a simplified CMakeLists.txt example 
to reproduce the problem as well.

Does this make sense?  Am I still missing something?

-Kris

From: Nils Gladitz [mailto:nilsglad...@gmail.com]
Sent: Wednesday, February 15, 2017 3:36 AM
To: Malfettone, Kris 
<kris.malfett...@msx.bala.susq.com<mailto:kris.malfett...@msx.bala.susq.com>>; 
cmake@cmake.org<mailto:cmake@cmake.org>
Subject: Re: [CMake] Potential bug: Having executables named "test" causes 
Ninja generator to generate ambiguous rules...

On 14.02.2017 22:53, Malfettone, Kris wrote:
If so, are executables named "test" no longer supported?
Am I missing something or wrong in some way?


Issues existed before 3.0 but since 3.0 "test" and similarly problematic target 
names have been explicitly reserved.

Any CMake Version >= 3.0 will issue a warning (when the required version is < 
3.0) or an error (when the required version is >= 3.0) by default:
https://cmake.org/cmake/help/v3.8/policy/CMP0037.html

Nils



IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or he

Re: [CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-15 Thread Malfettone, Kris
Good to know.  Thanks for the quick response.  Though I do not believe I am 
violating that particular rule here.  That is why I do not receive either a 
warning or error from CMake in my output.

The only warning I see is from ninja:
ninja: warning: multiple rules generate MD/MDF/Formats/SIG/BCP/v0_1/test. 
builds involving this target will not be correct; continuing anyway [-w 
dupbuild=warn]
ninja: warning: multiple rules generate MD/MDF/Formats/SIG/BCP/v0_2/test. 
builds involving this target will not be correct; continuing anyway [-w 
dupbuild=warn]
ninja: warning: multiple rules generate test. builds involving this target will 
not be correct; continuing anyway [-w dupbuild=warn]

I think the difference is that my target names are:
MD.MDF.Formats.SIG.BCP.v0_1.test
MD.MDF.Formats.SIG.BCP.v0_2.test

It is the ninja generator that is trying to setup aliases for each of them as a 
shortened form.  So I think one of the following statements are true:

* The cmake rule intended for the above two target names to be invalid. 
 But the check to issue a warning or error has a bug causing them to be missed. 
 This would explain why I do not get the error in my configure results.

* The cmake rule intended for the above two target names to be valid.  
However, on further reflection the rule should be made stricter to include my 
target names above.  This would then require and update to the cmake code 
checking that policy and lead to me actually getting a warning or error from 
cmake during configure.

* The ninja generator has a bug and is setting up ambiguous aliases for 
what CMake considers valid target names.

My project is huge so I will try and craft a simplified CMakeLists.txt example 
to reproduce the problem as well.

Does this make sense?  Am I still missing something?

-Kris


From: Nils Gladitz [mailto:nilsglad...@gmail.com]
Sent: Wednesday, February 15, 2017 3:36 AM
To: Malfettone, Kris <kris.malfett...@msx.bala.susq.com>; cmake@cmake.org
Subject: Re: [CMake] Potential bug: Having executables named "test" causes 
Ninja generator to generate ambiguous rules...

On 14.02.2017 22:53, Malfettone, Kris wrote:
If so, are executables named "test" no longer supported?
Am I missing something or wrong in some way?


Issues existed before 3.0 but since 3.0 "test" and similarly problematic target 
names have been explicitly reserved.

Any CMake Version >= 3.0 will issue a warning (when the required version is < 
3.0) or an error (when the required version is >= 3.0) by default:
https://cmake.org/cmake/help/v3.8/policy/CMP0037.html

Nils



IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or her employer nor any of 
their respective affiliates makes any warranties as to the completeness or 
accuracy of any of the information contained herein or that this message or any 
of its attachments is free of viruses.
-- 

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

Re: [CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-15 Thread Nils Gladitz

On 14.02.2017 22:53, Malfettone, Kris wrote:


If so, are executables named “test” no longer supported?
Am I missing something or wrong in some way?



Issues existed before 3.0 but since 3.0 "test" and similarly problematic 
target names have been explicitly reserved.


Any CMake Version >= 3.0 will issue a warning (when the required version 
is < 3.0) or an error (when the required version is >= 3.0) by default:

https://cmake.org/cmake/help/v3.8/policy/CMP0037.html

Nils
-- 

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

[CMake] Potential bug: Having executables named "test" causes Ninja generator to generate ambiguous rules...

2017-02-14 Thread Malfettone, Kris
Hi,
I am trying to migrate a very large project from cmake 2.8.11.2 + ninja 1.3.4 
to cmake 3.7.2 + ninja 1.7.2 and found what might be a bug with the ninja 
generator.  In my project we have a number of executables that are named 
"test".  This is normally not a problem since each one as a different target 
name that is unique.  However, with the move to CMake 3.7.2 the Ninja generator 
seems to generate ambiguous target aliases for the project.  If I rename my 
outputs to something such as "testfoo", the problem goes away.  Looking at the 
build.ninja that is generated there are clearly multiple ambiguous targets.  
One that I generates the output file named "test" and one I believe meant to 
run our unit tests.  That second part I believe is what is different between 
the versions of CMake that I am using.

The other thing is I believe even if those are removed there would be a final 
ambiguity between my executable and built in "test" command because the portion 
of the code the generates the section of the build.ninja file commented as "# 
Target aliases." seems to try and avoid ambiguities between targets but fails 
to consider built in cmake targets such as "test,install,install/strip,etc..."

Again, I am not a build.ninja expert so I may be wrong in my understanding.  
Some further info, this does not occur on windows because on windows the 
targets all end with ".exe" and it does not happen with the Makefile generator 
on Linux.

Is this expected behavior?
If so, are executables named "test" no longer supported?
Am I missing something or wrong in some way?

Any help would be appreciated.

Thanks,
Kris Malfettone



IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or her employer nor any of 
their respective affiliates makes any warranties as to the completeness or 
accuracy of any of the information contained herein or that this message or any 
of its attachments is free of viruses.
-- 

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