News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Project File Corruption (reproducable)

Started by gmb300, September 06, 2007, 09:34:29 AM

Previous topic - Next topic

gmb300

Version: SVN 4420 (September 1, 2007)
OS: Linux

I am reporting 3 bugs in CodeBlocks, all are reproducable.

BUG #1
* When saving a workspace, the '.workspace' extension must be explicitly added.
BUG #2
* CodeBlocks only recognizes a workspace if it has the extension '.workspace'.
BUG #3 [SERIOUS]
* CodeBlocks erases project files without warning!

Steps to reproduce:

Deleted... See my next few posts.

thomas

1) fixed in rev 4428
2) not a bug
3) still looking
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Der Meister

What about this thread? Will the extension be changed or does revision 4428 mean that it will remain ".workspace"?
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

thomas

I haven't changed anything to the extension as such (and won't for now).

Though I'm 100% for the change to .cbw, I don't want to tamper with extensions for now, as long as extension handling is  OBUH (one big ugly hack). Actually I wouldn't have done revision 4428 either, since it adds another piece of hardcode... but it's such an obvious dumb mistake which will annoy users every time they encounter it, so it should be "fixed" nevertheless.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

gmb300

#4
I've narrowed the steps down.

Deleted... See my next post.

troels

Quote from: gmb300 on September 06, 2007, 09:05:02 PM
I've narrowed the steps down.
This happens on Windows too (following the steps -> empty project)
/Troels

gmb300

New Set of Steps to Reproduce

1). Open fresh codeblocks
2). File -> New -> Project
3). Create console application
4). Reasonable defaults are okay
5). Project -> Properties
6). Click Build Targets Tab
7). Set Type to 'Dynamic library'
8). Uncheck the box Auto-generate filename extension
9). Set Output Filename to 'bin/Debug/testcb.dll'
10). Click OK
11). File -> Save Project
12). Click 'Rebuild' on the toolbar
13). File -> Close Project
14). File -> Open ... The project file does not exist!

gmb300

The problem is with Clean() ing, CodeBlocks thinks the project file is a static library. So C::B adds the project file to the list of files to be deleted.

Pseudo-Code:

if (project_target_type == ttDynamicLib &&
    m_PrefixGenerationPolicy == tgfpPlatformDefault &&
    m_ExtensionGenerationPolicy == tgfpNone)
  then
    call DirectCommands::GetTargetCleanCommands()
      return List_of_Files_To_Be_Deleted(Object Files, Project File)

Biplab

Bug confirmed. Thanks for the report. Hopefully we'll be able to fix this soon. :)
Be a part of the solution, not a part of the problem.

Biplab

Fix committed in revision 4435. Thanks for pointing this nasty bug. :)
Be a part of the solution, not a part of the problem.