Author Topic: Missing cpp file doesn't break the build?!  (Read 5813 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Missing cpp file doesn't break the build?!
« on: January 24, 2010, 02:55:23 pm »
I renamed a .cpp file outside C::B, then I've rebuild the project and the build succeeded.

Here is part of the log:
Code
WARNING: Can't read file's timestamp: /home/obfuscated/projects/myproj/myfile.cpp

Is it possible to make the build fail in this kind of situations?
I can do it, if the patch will be accepted.

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: Missing cpp file doesn't break the build?!
« Reply #1 on: January 24, 2010, 03:30:18 pm »
I renamed a .cpp file outside C::B, then I've rebuild the project and the build succeeded.
Well, if the build succeeded it means that this file is actually not needed. So why set the build as failed? If the file would really be needed the linker would complain and the build would fail, indeed. Can you clarify why this should be an error?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Missing cpp file doesn't break the build?!
« Reply #2 on: January 24, 2010, 03:49:46 pm »
It also succeeds if the appropriate object-file remains and can be linked.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Missing cpp file doesn't break the build?!
« Reply #3 on: January 24, 2010, 04:19:02 pm »
It also succeeds if the appropriate object-file remains and can be linked.
This is my case.
Is it possible to make this error?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9699
Re: Missing cpp file doesn't break the build?!
« Reply #4 on: January 24, 2010, 04:43:34 pm »
Is it possible to make this error?
What about a warning like:
"Warning: Probably linking against an obsolete object file (source file not accessible anmyore)."
Because probably you only have the object file. And then it wouldn't be an error.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Missing cpp file doesn't break the build?!
« Reply #5 on: January 24, 2010, 05:33:11 pm »
At the moment it is a warning (not showing in the build messages by the way),
I want it to be error, because if you hit "Rebuild All" the build will fail with:

Code
g++: .obj/tests/debug/src/myfile.o: There is no such file or directory

If it is an error, C::B would detect the problem (the source file is missing) earlier.

Because probably you only have the object file. And then it wouldn't be an error.
This is another case and should be handled differently -> you add the object file to the project or in the Linker settings (the former looks more like the correct way).
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]