Author Topic: Saving everything automatically before every build  (Read 676 times)

Offline cacb

  • Regular
  • ***
  • Posts: 372
Saving everything automatically before every build
« on: March 01, 2018, 07:31:32 pm »
I've been using Code::blocks for quite a while and really love it. I am now running 17.12 on Win7 and Linux Kubuntu 17.10.

But I have not found out if there is a feature to save everything before every build. I would like to enable such a feature because I sometimes (too often!) run into issues like this
  • Forgetting to save everything before I check in the project to source control, therefore missing updated files.
  • Losing recently added files in the project or project settings when C::B crashes (it happens!)
So, is there a way to always automatically run the equivalent of "Save Everything" (Shift+Alt+S) just before every build (Ctrl+F9 / F9 / Ctril+F11)? This would work for me.

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1968
Re: Saving everything automatically before every build
« Reply #1 on: March 01, 2018, 09:22:44 pm »
this option does not exist and this bothers me since a long time.

There is a ticket on SF with a workaround (basically a squirrel script in every project that makes a save as pre build step). But SF is down right now (for 24h? without update....) so i can not find it...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11040
    • Travis build status
Re: Saving everything automatically before every build
« Reply #2 on: March 01, 2018, 10:46:42 pm »
I have a patch applied for some time, but there is a concern that this will force a CC reparse which means there will would be slowdowns.
So I'm reluctant to apply it... If anyone is willing to modify the patch to prevent this reparse, I'll be happy to apply it.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11040
    • Travis build status
Re: Saving everything automatically before every build
« Reply #3 on: March 01, 2018, 10:47:25 pm »
But if you're loosing work because of C::B crashes then it is better to report the crashes, so they could be tracked and fixed.
(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 cacb

  • Regular
  • ***
  • Posts: 372
Re: Saving everything automatically before every build
« Reply #4 on: March 01, 2018, 11:01:41 pm »
But if you're loosing work because of C::B crashes then it is better to report the crashes, so they could be tracked and fixed.
Agreed if they are repeatable. But it is not always so.

Offline cacb

  • Regular
  • ***
  • Posts: 372
Re: Saving everything automatically before every build
« Reply #5 on: March 01, 2018, 11:10:19 pm »
I have a patch applied for some time, but there is a concern that this will force a CC reparse which means there will would be slowdowns.
So I'm reluctant to apply it... If anyone is willing to modify the patch to prevent this reparse, I'll be happy to apply it.

I guess all the source files are already saved when you run a build, so it is mostly the project file and possibly some wxsmith files that are affected. Will saving the project file force a reparse? Even if the answer is yes, I would consider enabling such an option.

[ In my experience reparsing sometimes does not happen often enough, finding definitions does not always work ]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11040
    • Travis build status
Re: Saving everything automatically before every build
« Reply #6 on: March 02, 2018, 09:37:41 am »
Agreed if they are repeatable. But it is not always so.
If you are on linux it is pretty easy to always run under debugger. This way if it crashes you can gather the backtrace.
(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 cacb

  • Regular
  • ***
  • Posts: 372
Re: Saving everything automatically before every build
« Reply #7 on: March 05, 2018, 09:03:39 am »
Will saving the project file force a reparse?

Any answer?