Author Topic: Clean Workspace  (Read 14113 times)

Offline nacitar

  • Multiple posting newcomer
  • *
  • Posts: 27
Clean Workspace
« on: January 16, 2009, 09:06:32 pm »
I have a workspace with three projects configured to be built using scons (makefile project).  Everything works great the way I have it arranged on a per-project scale. And I have the build/rebuild workspace commands working fine (had to create a target "none" and put my files in that, that way it doesn't try to build using my makefile and THEN using codeblocks default build routines.. you'd think it wouldnt try to build normally on a makefile project, though...)

Anyway, I had previously assumed that build/rebuild/clean workspace just ran build/rebuild/clean for each project, but clearly that is not true.  I can't even get a workaround for clean workspace, no idea what it's doing but it is _definitely_ not running clean on each project, as if I clean them manually, in any order, it works.. but clean workspace doesn't.

Shouldn't the workspace commands just issue those commands for each project?  If so, this would work swimmingly... but unfortunately, it doesn't.

EDIT: It looks like it's cleaning the first project in the workspace, and then stopping saying it's done.
« Last Edit: January 16, 2009, 09:18:43 pm by nacitar »
Jacob McIntosh - Software Developer

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Clean Workspace
« Reply #1 on: January 16, 2009, 09:30:23 pm »
nacitar: I can confirm similar problem with clean workspace, only I'm using regular build system instead of custom makefiles. clean workspace only seems to clean the active project

i suspect the need to create a none target is also a bug.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Clean Workspace
« Reply #2 on: January 21, 2009, 07:47:05 am »
I actually test a patch for this problem on my system.

With the patch you can use build, rebuild and clean with makefile-based projects similar to C:B-projects.

You can also use pre- and post-build-steps, but no longer set neither compiler- and linker-options nor search-paths. Because that does not make sense for a makefile-based project.

You can also mix makefile- and C::B-projects and have dependencies between them.

There will be a fifth make-command used to look if a rebuild is needed.

And of course the user still has to setup parameters for makefiles correctly in "Build options -> Make commands".
And the parameters in the projects properties have to be fixed manually, especially the exe-path if the program shall be started or debugged from within C::B.

I don't want to apply the patch to trunk, unless it is tested by more devs/users, to make sure it does not break anything else.

I will provide it here (or more likely in an own thread) for testing purposes.

I do not use makefile-based project, so I only tested it (and the cooperation between the two project-types) with some wxWidgets example and a simple wizardscript created C::B-project.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: clean workspace
« Reply #3 on: January 21, 2009, 11:07:10 am »
Anyway, I had previously assumed that build/rebuild/clean workspace just ran build/rebuild/clean for each project, but clearly that is not true.  I can't even get a workaround for clean workspace, no idea what it's doing but it is _definitely_ not running clean on each project, as if I clean them manually, in any order, it works.. but clean workspace doesn't.

At first:
Please change your signature.

At second:

It does exactly what you expect, but not if you use makfile based projects.

I will start a new thread with patches for linux (created with diff) and for windows (created with tortoise-svn) this evening.
I just fixed some layout issues on win, but I have no linux system available at work in the moment, so I can not update the linux patch.

To make it clear: the patches are identical, I only create two different patch files to make it easier to apply them.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Clean Workspace
« Reply #4 on: January 21, 2009, 10:14:20 pm »
Just started a new thread with the patch(es) attached in the development forum: http://forums.codeblocks.org/index.php/topic,9966.0.html

Offline nacitar

  • Multiple posting newcomer
  • *
  • Posts: 27
Re: Clean Workspace
« Reply #5 on: January 30, 2009, 11:47:19 pm »
Well, that has DEFINITELY fixed all my makefile project problems, completely.. every one of them.  I was expecting a fix _eventually_, but not only was this fix fast it knocked the problem right out of the park!


I have two questions, though.

1) I've noticed now though that every time I build, it's doing a silent build.  Is there somewhere to choose between silent and non-silent builds for the project?  I looked around but didn't manage to find it.  Of course, I can always just make my silent build command identical to my non-silent build command.. but it looks to me like there must be an option I'm missing somewhere.

2) Exactly when is the "Ask if rebuild is needed" called?  Just curious on that.


Regards.
Jacob McIntosh - Software Developer

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Clean Workspace
« Reply #6 on: January 31, 2009, 09:48:43 am »
Well, that has DEFINITELY fixed all my makefile project problems, completely.. every one of them.  I was expecting a fix _eventually_, but not only was this fix fast it knocked the problem right out of the park!


I have two questions, though.

1) I've noticed now though that every time I build, it's doing a silent build.  Is there somewhere to choose between silent and non-silent builds for the project?  I looked around but didn't manage to find it.  Of course, I can always just make my silent build command identical to my non-silent build command.. but it looks to me like there must be an option I'm missing somewhere.

2) Exactly when is the "Ask if rebuild is needed" called?  Just curious on that.


Regards.

To see the build-outpu, just change "Setting -> Compiler and debugger... -> Global compiler settings -> <the compiler you use> -> Other settings (rightmost tab) -> Compiler logging:" to "Full command line".

The "Ask if rebuild is needed"-command is called before a build is done to decide, whether the project needs a rebuild or not, if not, you get the message "Target is up to date".
In the former version a build was always initiated, even if there was no need to do so.
On really large projects the  "Ask if rebuild is needed"-command might also take some time, but it will in almost every case be much faster than a really build, because no output is generated.

Quote
-q, --question
            ‘‘Question mode’’.  Do not run any commands, or print anything; just return an exit status that is zero if the specified targets are already up to date, nonzero otherwise.
quote from the make manpage.

I don't know if a similar command exists for other versions of make (borland, microsoft, watcom ...) so the user can use any command that behaves similar.
« Last Edit: January 31, 2009, 09:51:18 am by jens »

Offline nacitar

  • Multiple posting newcomer
  • *
  • Posts: 27
Re: Clean Workspace
« Reply #7 on: January 31, 2009, 11:05:47 pm »
That makes sense... thanks for the effort it took to get this feature working properly, too... as this wasn't something I was using as a personal project, but as a work project.  So, it helps a lot. :)
Jacob McIntosh - Software Developer