Author Topic: SVN-HEAD binaries download  (Read 55530 times)

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: CVS binaries download
« Reply #30 on: December 06, 2005, 03:30:22 am »
would you be so kind and add SHFolder(before Shell32) to the link libraries of the sdk target for your builds - then Codeblocks could be used on W98 again.

Hello Revy

I have just recompiled CB with this lib, unfortunatelly, i dont have 98, can you test it pls?
I ll upload (rev1450) in a couple of minutes.

Thx

It works again on Windows 98SE!! Hooray!!!  :D :D :D
« Last Edit: December 06, 2005, 03:36:07 am by duncanka »

Revy

  • Guest
Re: CVS binaries download
« Reply #31 on: December 06, 2005, 09:46:00 am »
Hi Therion,

it works perfectly, many thanks to you Therion!  :D


would you be so kind and add SHFolder(before Shell32) to the link libraries of the sdk target for your builds - then Codeblocks could be used on W98 again.

Hello Revy

I have just recompiled CB with this lib, unfortunatelly, i dont have 98, can you test it pls?
I ll upload (rev1450) in a couple of minutes.

Thx


Revy

  • Guest
Re: CVS binaries download
« Reply #32 on: December 06, 2005, 10:30:01 am »
It looks like we were a bit too fast, it does start on w98 now, but you can't build any projects because someone hardcoded the shell command: :(

Execution of 'cmd /c mingw32-g++.exe  -IC:\MinGW\include  -c E:\Progr\CBT\Console\main.cpp -o .objs\main.o' in 'E:\Progr\CBT\Console' failed.

The option in the window where you are supposed to change this is disabled :/

Anyways thank you very much for your effort therion.

I guess I will just have to upgrade to W2k/XP and use MS Visual C++ again.
I'm a bit sad atm, because Code::Blocks is meant to be a portable IDE and can't even run on different Win32 platforms.
And the worst is, I'm absolutly sure the usage of W98 is higher than the usage of Linux.

Bye
A sad Revy

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: CVS binaries download
« Reply #33 on: December 06, 2005, 10:43:06 am »
I guess I will just have to upgrade to W2k/XP and use MS Visual C++ again.
I'm a bit sad atm, because Code::Blocks is meant to be a portable IDE and can't even run on different Win32 platforms.
And the worst is, I'm absolutly sure the usage of W98 is higher than the usage of Linux.

Bye
A sad Revy

Quote from: C::B sources
Code
    // TODO (mandrav#1#): Check windows version and substitute cmd.exe with command.com if needed.
        cmd->command = _T("cmd /c ") + cmd->command;

Revvy, you 're free to go whichever way you want but judging a program while it is still being developed is plain wrong.
You want to use the SVN-HEAD version. That's just fine. But if things don't work for you as expected (yet), you shouldn't complain about it. We 're working hard on this project and trying to make everybody happy. But things need to be coded to work. Code doesn't just write itself. So if I haven't had the time yet to fix this, it doesn't mean I never will.

If you want this to work now, provide a patch.
I don't work for you, nor any of the other developers. We do this on our free time and you have to respect it. If you don't like C::B, you 're free not to use it. But you don't have the right to demand from anyone here to work on your schedule.

You see Revvy, open source doesn't mean "free workers at your disposal". You got things all wrong...
Be patient!
This bug will be fixed soon...

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: CVS binaries download
« Reply #34 on: December 06, 2005, 10:45:58 am »
It shouldn't be that hard to change it, if there is a possibility to find which command to use (command or cmd) then it is very easy.. I will try to fix this tonight ;) (does this make youhappy again Revy :))
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: CVS binaries download
« Reply #35 on: December 06, 2005, 10:50:40 am »
It shouldn't be that hard to change it, if there is a possibility to find which command to use (command or cmd) then it is very easy..

No, it's not. It just needs some time which I don't have. If you can fix it, please do so :)
It's in plugins/compilergcc/compilergcc.cpp:773.
Be patient!
This bug will be fixed soon...

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: CVS binaries download
« Reply #36 on: December 06, 2005, 10:59:56 am »
Idea : you can either check the windows version or ....
in the windows system dir (C:\windows\system32 ) , don't remember if that exist on windows 98/SE/95 (well first part can be obtained from environment settings : windir or SystemRoot) you can check if exist :
  - cmd.exe
then use it, if not check if exist :
  - command.com
and then use that one.
If none exist, show dialog box instructing the user to :
 - log out
 - format c:
 - install linux


Cheers,
Lieven

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: CVS binaries download
« Reply #37 on: December 06, 2005, 11:15:23 am »
it is easy ;)
Code
        if(wxGetOsVersion() == wxWIN95)
            cmd->command = _T("command /c ") + cmd->command;
        else
            cmd->command = _T("cmd /c ") + cmd->command;
I didn't test it on win98, but it works on XP
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: CVS binaries download
« Reply #38 on: December 06, 2005, 11:17:38 am »
[I typed this before the last two posts, but I think my solution is better and cleaner, so here it is]

Quote from: C::B sources
Code
    // TODO (mandrav#1#): Check windows version and substitute cmd.exe with command.com if needed.
        cmd->command = _T("cmd /c ") + cmd->command;

More complete code sample:
Code
    // special shell used only for build commands
    if (!cmd->isRun)
    {
    #ifndef __WXMSW__
        // run the command in a shell, so backtick'd expressions can be evaluated
        cmd->command = GetConsoleShell() + _T(" '") + cmd->command + _T("'");
    #else
    // TODO (mandrav#1#): Check windows version and substitute cmd.exe with command.com if needed.
        cmd->command = _T("cmd /c ") + cmd->command;
    #endif
    }

I saw that change a while back, and I was wondering: Is there any particular reason "cmd /c " is prepended at all? Shouldn't it "just work" if you that wasn't done?

I see that according to the comments the reason a shell is prepended is to allow backticked expressions to execute, but I'm not aware of any windows version where that works (it's different for *nix of course). It certainly doesn't work in my win2000 cmd.exe...

I think this code should have the exact same effect, except it on win9x where it actually works now ;):
Code
#ifndef __WXMSW__
    // special shell used only for build commands
    if (!cmd->isRun)
    {
        // run the command in a shell, so backtick'd expressions can be evaluated
        cmd->command = GetConsoleShell() + _T(" '") + cmd->command + _T("'");
    }
#endif

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: CVS binaries download
« Reply #39 on: December 06, 2005, 11:26:25 am »
I saw that change a while back, and I was wondering: Is there any particular reason "cmd /c " is prepended at all? Shouldn't it "just work" if you that wasn't done?

I see that according to the comments the reason a shell is prepended is to allow backticked expressions to execute, but I'm not aware of any windows version where that works (it's different for *nix of course). It certainly doesn't work in my win2000 cmd.exe...

Yes, you 're right. The comment does not explain the reasoning for this change.
This was added to allow builtin shell commands to be used in pre-build and post-build steps, i.e. cp, del, etc. These do not work if not invoked within a shell.
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: CVS binaries download
« Reply #40 on: December 06, 2005, 11:47:52 am »
Yes, you 're right. The comment does not explain the reasoning for this change.
This was added to allow builtin shell commands to be used in pre-build and post-build steps, i.e. cp, del, etc. These do not work if not invoked within a shell.

Ah, I understand. But I think you meant copy. And I should mention cp has worked just fine for me so far :).
But still, wouldn't it be a cleaner solution to have GetConsoleShell() return the proper command? That way this code can be un-#ifdef'd, and if you put the code to detect cmd.exe/command.com in there it'll probably be easier to cache. You could even make it a setting like in the *nix version. Just enable that textbox in the compiler options, and autodetect only on first run.
Then the user could even change it if he prefers sh.exe for example ;). (though sh.exe would break copy again, but that's the user's choice: he gets backticks and other goodies in return. Besides, he could always create a copy script/alias for cp)

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: CVS binaries download
« Reply #41 on: December 06, 2005, 11:49:47 am »
I think this code should have the exact same effect, except it on win9x where it actually works now ;):
Code
#ifndef __WXMSW__
    // special shell used only for build commands
    if (!cmd->isRun)
    {
        // run the command in a shell, so backtick'd expressions can be evaluated
        cmd->command = GetConsoleShell() + _T(" '") + cmd->command + _T("'");
    }
#endif
It doesn't have the same effect. it has to be done without quotes, else it will not compile (on XP) (with I mean with 'not compile' is that the command is not correct when I want to compile a file with the "new" version. The compiler plugin compiles correctly):
Code
    #ifndef __WXMSW__
        // run the command in a shell, so backtick'd expressions can be evaluated
        cmd->command = GetConsoleShell() + _T(" '") + cmd->command + _T("'");
    #else
        cmd->command = GetConsoleShell() + cmd->command;
    #endif
« Last Edit: December 06, 2005, 11:51:50 am by mispunt »
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: CVS binaries download
« Reply #42 on: December 06, 2005, 11:54:30 am »
Yes, you 're right. The comment does not explain the reasoning for this change.
This was added to allow builtin shell commands to be used in pre-build and post-build steps, i.e. cp, del, etc. These do not work if not invoked within a shell.

Ah, I understand. But I think you meant copy. And I should mention cp has worked just fine for me so far :).

Well, yes, I meant copy :)

But still, wouldn't it be a cleaner solution to have GetConsoleShell() return the proper command? That way this code can be un-#ifdef'd, and if you put the code to detect cmd.exe/command.com in there it'll probably be easier to cache. You could even make it a setting like in the *nix version. Just enable that textbox in the compiler options, and autodetect only on first run.
Then the user could even change it if he prefers sh.exe for example ;). (though sh.exe would break copy again, but that's the user's choice: he gets backticks and other goodies in return. Besides, he could always create a copy script/alias for cp)

I didn't re-use GetConsoleShell() because it was initially created for non-windows installations. This has the side-effect that everyone has it now in their configuration as "/bin/sh". Do you see the problem?
Eventually, we will use GetConsoleShell() but we 'll have to check its value too...

EDIT: and mispunt is right about the quotes. I forgot to mention it...

EDIT2: Do you understand now why I said it needs some time to be correctly fixed/implemented?
« Last Edit: December 06, 2005, 11:56:03 am by mandrav »
Be patient!
This bug will be fixed soon...

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: CVS binaries download
« Reply #43 on: December 06, 2005, 12:00:48 pm »
I think this code should have the exact same effect, except it on win9x where it actually works now ;):
Code
#ifndef __WXMSW__
    // special shell used only for build commands
    if (!cmd->isRun)
    {
        // run the command in a shell, so backtick'd expressions can be evaluated
        cmd->command = GetConsoleShell() + _T(" '") + cmd->command + _T("'");
    }
#endif
It doesn't have the same effect. it has to be done without quotes, else it will not compile (on XP) (with I mean with 'not compile' is that the command is not correct when I want to compile a file with the "new" version. The compiler plugin compiles correctly):

I have a feeling you missed the #ifdef around it :).
On the windows version it would just run the command itself without any extra shell and without any extra quotes, just like it always did.

I didn't re-use GetConsoleShell() because it was initially created for non-windows installations. This has the side-effect that everyone has it now in their configuration as "/bin/sh". Do you see the problem?
Eventually, we will use GetConsoleShell() but we 'll have to check its value too...

The configuration file has a version number, so the most elegant way would be to bump it and have the conversion code take care of it, I think. Though bumping it for so minor a change might be an objection...
This solution does mean you wouldn't have to check the value, though. Just load the config normally but replace this particular setting by the default shell if on Windows and the config file version was 1.

Quote
EDIT: and mispunt is right about the quotes. I forgot to mention it...

See above

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: CVS binaries download
« Reply #44 on: December 06, 2005, 12:27:47 pm »
Quote
EDIT: and mispunt is right about the quotes. I forgot to mention it...

See above

Mispunt is referring to using GetConsoleShell() under both platforms. For windows it would be cmd /c arguments while for linux it would be /bin/sh 'arguments' (notice the quotes).
Your solution is to revert to the previous way, which does not allow for builtin shell commands (i.e. for windows, no command shell).
Be patient!
This bug will be fixed soon...