Author Topic: C::B & Uniwin  (Read 17493 times)

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
C::B & Uniwin
« on: November 21, 2006, 11:09:24 am »
How to make it work in nightly?

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: C::B & Uniwin
« Reply #1 on: November 21, 2006, 11:40:25 am »
Hi !

not very explicit...

Dje

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #2 on: November 21, 2006, 11:45:27 am »
C::B doing something weird. Creates temporary file, deletes original source file and renames temporary to original file name. This confuses Uniwin...

Is there any other way to remote compiling and debugging?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: C::B & Uniwin
« Reply #3 on: November 21, 2006, 12:13:43 pm »
C::B doing something weird.

No, it does something that keeps your files safe in the event of a failure during saving. If you think that's weird, I 'll pass...
Be patient!
This bug will be fixed soon...

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #4 on: November 21, 2006, 12:15:37 pm »
How can I turn this off?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B & Uniwin
« Reply #5 on: November 21, 2006, 01:16:37 pm »
You cannot turn it off. (You could modify the sources, but I won't help on this because it is madness).
This is a feature that ensures that no matter what happens, you never lose all your data (even if you pull the plug while saving files). As such, it cannot and should not be turned off.

Also, it should do something different: it creates a temporary file, writes to it, renames the old file, renames the temporary file, and deletes the old file after a grace period.

The behaviour that you describe is what wxTempFile does, but we don't use that any more, unless we have forgotten to change it somewhere. It is unsafe because it can delete both files under certain (although unlikely) conditions.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #6 on: November 21, 2006, 01:26:00 pm »
It seems Uniwin support totally broken.

No integrated remote develop in C::B...

But there is some scripting way to implement it...

I trying to do it with batch files, but stuck with setting enviroment variables right before build commands. Trying to "set REMOTE=bla.blabla.com" in Project>Build options>Commands>Pre-build steps fails to execute. Why?

Also there is trouble with backslashes. C::B forcefully replaces slashes with backslashes in Project>Build options>Directories>Compiler.
How can I avoid it?

PS: OS Windows
« Last Edit: November 21, 2006, 01:34:30 pm by Rigel »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: C::B & Uniwin
« Reply #7 on: November 21, 2006, 08:00:07 pm »
I trying to do it with batch files, but stuck with setting enviroment variables right before build commands. Trying to "set REMOTE=bla.blabla.com" in Project>Build options>Commands>Pre-build steps fails to execute. Why?
...because the set is issued in another context?! ;-)
Anyway: There is a plugin that does the job for such purposes: EnvVars (Environment variables plugin) - there you can setup/change environment variables in the focus of C::B and it's sub-processes.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #8 on: November 21, 2006, 08:49:07 pm »
I know about this plugin, but it useless for me because in current case i need to set diffrent enviroment variables for each target...

I currently developing client-server crossplatform application. Nightly's broken uniwin compatiblity completely confuses me... Rolled back to 08.11.2006 nightly...
« Last Edit: November 21, 2006, 08:55:32 pm by Rigel »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: C::B & Uniwin
« Reply #9 on: November 21, 2006, 09:13:30 pm »
I currently developing client-server crossplatform application. Nightly's broken uniwin compatiblity completely confuses me... Rolled back to 08.11.2006 nightly...
Ok, so we can make a deal: You explain to me how to attach uniwin to C::B (which I will then transfer into a WiKi article) and I'll look into it. It shouldn't be too hard to compare the sources of Now08 with the ones of today to track down that issue...
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #10 on: November 21, 2006, 09:39:15 pm »
Hmm... Uniwin looks for changes in specified directory and syncronizes with remote directory through sftp. Since C::B uses complex saving method, I don't think it is easy to make it compatible with Uniwin without breaking current save method. Tomorrow I will try to add *.tmp mask to sync files in Uniwin. I think this can help... I will report this.

Update: Adding *.tmp to sync files mask didn't help...
« Last Edit: November 21, 2006, 10:00:08 pm by Rigel »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: C::B & Uniwin
« Reply #11 on: November 21, 2006, 09:43:47 pm »
I think that way of saving files is already in CB way longer then 8nov2006. I remember that someone once posted that uniwin works with CB (search the forum), so it seems the problem might be something else.
Help Morton back track since when it did not work anymore so he can have a look at the code.
[EDIT] : http://forums.codeblocks.org/index.php?topic=2378
« Last Edit: November 21, 2006, 09:46:48 pm by killerbot »

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #12 on: November 21, 2006, 09:57:25 pm »
Yes, 08.11 nightly saves this way too. Uniwin catches file changes sometimes. i don't know why "sometimes", but it helps me somehow )

Thats why I looking forward at Enviroment Variables settings per target (or help how to set them at pre-build commands) and slashes\backslashes issue (maybe its nice to add option to switch replacement on/off?)...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: C::B & Uniwin
« Reply #13 on: November 21, 2006, 10:12:40 pm »
Thats why I looking forward at Enviroment Variables settings per target [...]
I guess I'm still missing something here: You said previously that you would like to pass specific variables per-target. Why don't you use user variables for this as they should get replaced also for the commands?! Thus in the command write something like:
Code: [Select]
call_my_batch.bat $MyUserVarAnd setup the user variable for this target e.g. as "123.234.123.234"...
Then inside the batch file you can do with it whatever you want, e.g.
Code: [Select]
@echo off
echo The command line provided is: %1.
the_app.exe "%1"
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #14 on: November 22, 2006, 06:43:31 am »
OK, I got you idea. Tried out and it works!

What about backslashes? How can I avoid replacement?