View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014497CMakeCMakepublic2013-10-21 03:512016-06-10 14:31
ReporterGregoire 
Assigned ToRobert Maynard 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 2.8.12 
Target VersionFixed in Version 
Summary0014497: Ninja & CMake 2.8.12: warning when generating resource file out of source tree
Description
Issue happens when I generate a resource file in the build tree (out of source) on windows (msvc or mingw) using "Ninja" generator.

If I generate the resource inside the source tree, no issue.
If I generate a source (not a resource), no issue for both in source and build trees.
If I use native build tool (nmake or mingw32-make), no issue.
Steps To Reproduce(See attached project)
Under Windows, use Ninja generator under windows in an out of source build tree to generate the project.
The warning is displayed at build time when invoking ninja.
TagsNo tags attached.
Attached Fileszip file icon sources-ninja-resource-warning.zip [^] (1,337 bytes) 2013-10-21 03:51

 Relationships

  Notes
(0034176)
Gregoire (reporter)
2013-10-21 03:53

Nicolas Despres told me that he could not reproduce this issue on Linux:

"I did not succeed to reproduce it on Linux. The rc file gets removed from the executable source list."
(0034535)
Thomas Sondergaard (reporter)
2013-11-24 10:59

I am seeing this warning too for a generated rc file (out of source)
(0034538)
Peter Kuemmel (developer)
2013-11-25 03:45

This bug is a regression due to this commit:

http://cmake.org/gitweb?p=cmake.git;a=commit;h=539356f1281902f5494828eca963d95e2b726dda [^]

It adds rules like

build A: phony A

which make not much sense.

There should be a better solution to the mentioned issue described in the commit message.
(0034548)
Robert Maynard (manager)
2013-11-25 09:12

I am interested in finding a better way to handle unknown output of custom commands, but currently I don't know a better way.

Currently the output of calls such as add_custom_command( PRE_BUILD | PRE_LINK | POST_BUILD ...) don't have a way to list which files they are going to generate. Those file could be listed as source files for another target. Without something like the mentioned commit, ninja won't run at all for projects using those commands.
(0034552)
Peter Kuemmel (developer)
2013-11-25 12:09

Do you have a test case?

Will it work when you change it to this:

build A-phony: phony /a/absolute/path/to/A
(0034553)
Peter Kuemmel (developer)
2013-11-25 12:16

Ninja docu:

phony can also be used to create dummy targets for files which may not exist at build time. If a phony build statement is written without any dependencies, the target will be considered out of date if it does not exist. Without a phony build statement, Ninja will report an error if the file does not exist and is required by the build.

http://martine.github.io/ninja/manual.html#_the_literal_phony_literal_rule [^]
(0034554)
Robert Maynard (manager)
2013-11-25 13:35

I am confused. The above commit goals is to create dummy targets for files which don't exist at build time.

The test that exposes this problem is:
http://cmake.org/gitweb?p=cmake.git;a=commit;h=88d27ad0140ac2274e886c10ac2bf9f8eede54c7 [^]
(0034555)
Peter Kuemmel (developer)
2013-11-25 15:51

Sorry for the confusion ;)

But now I think the problem is that resources files are not unknown, see the exmaple CMakeLists.txt:

set (_target_rc "versioninfo.rc")
-> does not trigger creation of phone rule

set (_target_rc "${CMAKE_BINARY_DIR}/versioninfo.rc")
-> triggers phony rule creation


So it's because of the absolute path.
(0034556)
Robert Maynard (manager)
2013-11-25 16:22

Yeah we will need to dig into this. I expect that the problem is that we aren't converting it to a ninja path when adding it to the knownDependencies set inside the WriteUnknownExplicitDependencies method.

That would explain why when it is a relative path we see the ninja generator behaving properly, but when
being an absolute path it doesn't.
(0034557)
Peter Kuemmel (developer)
2013-11-25 16:28

BTW, absolute/relative path handling in the ninja generator is really a mess, for instance here

http://public.kitware.com/Bug/view.php?id=13894 [^]

I finally have to revert.
(0034558)
Robert Maynard (manager)
2013-11-25 16:30

Have to revert what?
(0034559)
Peter Kuemmel (developer)
2013-11-25 16:39

I had to revert the patch of the ticket 0013894.
(0035047)
Gregoire (reporter)
2014-02-07 04:12

Could this issue be fixed in a 2.x.x version? I need some 2.8.12 features but I cannot upgrade due to this issue.
(0036452)
Gregoire (reporter)
2014-07-24 11:38

I do not see this issue any more with CMake 3.0.0 and the attached sample.
(0036495)
Thomas Sondergaard (reporter)
2014-07-30 05:53

I'm also not seeing these warnings anymore after upgrading to CMake 3.0.0. I've tested with ninja 1.4.0 and ninja 1.5.1.
(0042397)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2013-10-21 03:51 Gregoire New Issue
2013-10-21 03:51 Gregoire File Added: sources-ninja-resource-warning.zip
2013-10-21 03:53 Gregoire Note Added: 0034176
2013-10-21 10:36 Brad King Assigned To => Peter Kuemmel
2013-10-21 10:36 Brad King Status new => assigned
2013-11-24 10:59 Thomas Sondergaard Note Added: 0034535
2013-11-25 03:40 Peter Kuemmel Assigned To Peter Kuemmel => Robert Maynard
2013-11-25 03:45 Peter Kuemmel Note Added: 0034538
2013-11-25 09:12 Robert Maynard Note Added: 0034548
2013-11-25 12:09 Peter Kuemmel Note Added: 0034552
2013-11-25 12:16 Peter Kuemmel Note Added: 0034553
2013-11-25 13:35 Robert Maynard Note Added: 0034554
2013-11-25 15:51 Peter Kuemmel Note Added: 0034555
2013-11-25 16:22 Robert Maynard Note Added: 0034556
2013-11-25 16:28 Peter Kuemmel Note Added: 0034557
2013-11-25 16:30 Robert Maynard Note Added: 0034558
2013-11-25 16:39 Peter Kuemmel Note Added: 0034559
2013-11-26 06:19 Peter Kuemmel Status assigned => confirmed
2014-02-07 04:12 Gregoire Note Added: 0035047
2014-07-24 11:38 Gregoire Note Added: 0036452
2014-07-30 05:53 Thomas Sondergaard Note Added: 0036495
2016-06-10 14:29 Kitware Robot Note Added: 0042397
2016-06-10 14:29 Kitware Robot Status confirmed => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team