View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015666 | CMake | (No Category) | public | 2015-07-28 05:56 | 2016-03-07 09:12 | ||||
Reporter | Nils Gladitz | ||||||||
Assigned To | Nils Gladitz | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | Windows | OS | OS Version | ||||||
Product Version | CMake 3.3 | ||||||||
Target Version | CMake 3.4 | Fixed in Version | CMake 3.4 | ||||||
Summary | 0015666: Ninja may unnecessarily relink on windows | ||||||||
Description | I have the following windows specific test case: cmake_minimum_required(VERSION 3.3) project(Foo CXX) if(NOT EXISTS test.cpp) file(WRITE test.cpp "__declspec(dllexport) void foo() {}") endif() add_custom_target(touch COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_SOURCE_DIR}/test.cpp ) add_library(foo SHARED test.cpp) | ||||||||
Steps To Reproduce | I configured the given test project with the "Ninja" generator from a "Visual Studio 2013 (x64)" environment. 1. ninja # builds the project as expected 2. ninja # outputs "ninja: no work to do." as expected 3. ninja touch # touches test.cpp 4. ninja # recompiles and relinks as expected 5-n. ninja # unexpectedly relinks; expected is "ninja: no work to do." | ||||||||
Additional Information | It looks like the relink happens because the linker updates foo.dll but does not touch foo.lib. Which leads to (ninja -d explain): ninja explain: output foo.lib older than most recent input CMakeFiles/foo.dir/test.cpp.obj (459779794 vs 459780205) ninja explain: foo.dll is dirty [1/1] Linking CXX shared library foo.dll | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0039174) Brad King (manager) 2015-07-28 08:42 |
We may need to add "restat = 1" to the build statement for the link rule. |
(0039175) Nils Gladitz (developer) 2015-07-28 08:54 |
The issue seems to exist since ef42e57d470db499a41c8bca695391c3e3e5cb86. Adding the import library to byproducts (which then causes restat=1 to be added) instead of outputs seems to work around the issue for me. I pushed ninja-implib-byproduct: http://www.cmake.org/gitweb?p=stage/cmake.git;a=commit;h=35fb0bb8c09cfc5fd75ad87fac58799e5054b7ce [^] Does that look ok? |
(0039176) Brad King (manager) 2015-07-28 09:10 |
Re 0015666:0039175: Yes, that looks just right. That's how I would have done it if I had known that the .lib might not be updated. Thanks! |
(0039177) Nils Gladitz (developer) 2015-07-28 09:14 |
Thanks, I mergeded it to next for testing. |
(0039191) Nils Gladitz (developer) 2015-07-30 06:40 |
"ninja-implib-byproduct" has been merged to master. |
(0039192) Brad King (manager) 2015-07-30 08:48 |
Thanks for updating. We typically keep issues initially at "resolved" to allow others to comment. After 4 months of inactivity then we close. |
(0039194) Nils Gladitz (developer) 2015-07-30 08:58 |
Ah alright ... I think I asked Robert on IRC at some point while he was still active and thought the poliy was: - developer resolves issue - issue reporter closes issue after verifying the issue is indeed resolved I went straigt to close given that I was both. I did see resolved, inactive issues being closed after a while ... but I thought that was just because the original reporter did not do so himself. |
(0040605) Robert Maynard (manager) 2016-03-07 09:12 |
Closing resolved issues that have not been updated in more than 4 months. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2015-07-28 05:56 | Nils Gladitz | New Issue | |
2015-07-28 08:42 | Brad King | Note Added: 0039174 | |
2015-07-28 08:54 | Nils Gladitz | Note Added: 0039175 | |
2015-07-28 09:10 | Brad King | Note Added: 0039176 | |
2015-07-28 09:14 | Nils Gladitz | Note Added: 0039177 | |
2015-07-30 06:40 | Nils Gladitz | Note Added: 0039191 | |
2015-07-30 06:40 | Nils Gladitz | Status | new => closed |
2015-07-30 06:40 | Nils Gladitz | Assigned To | => Nils Gladitz |
2015-07-30 06:40 | Nils Gladitz | Resolution | open => fixed |
2015-07-30 06:40 | Nils Gladitz | Fixed in Version | => CMake 3.4 |
2015-07-30 08:48 | Brad King | Note Added: 0039192 | |
2015-07-30 08:48 | Brad King | Status | closed => resolved |
2015-07-30 08:48 | Brad King | Target Version | => CMake 3.4 |
2015-07-30 08:58 | Nils Gladitz | Note Added: 0039194 | |
2016-03-07 09:12 | Robert Maynard | Note Added: 0040605 | |
2016-03-07 09:12 | Robert Maynard | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |