Author Topic: Custom makefile "execution failed" on Windows?  (Read 9721 times)

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Custom makefile "execution failed" on Windows?
« on: March 11, 2013, 10:04:43 pm »
Hey all --

I recently set up a Linux side for my C::B project, a great big old sort of thing which uses a SCons script with platform-specific rules for compilation.  While doing so I made a mess of my old build configuration and also noticed Code::Blocks 12.11 was out!  (Somehow I'm a few months late on that; is there an RSS feed?)

Anyway, the commands for executing my custom makefile are failing quite stubbornly.  "Scons -f Sconstruct.py mode=Release -c" fails, and for that matter so do trivial commands like "dir".  I had an issue on the Linux side where the makefile commands would not cooperate until the project compiler matched the target compiler, but that didn't help here...

The SCons command runs fine on the command prompt.  (It actually fails due to a bad environment variable, but this would show up in Code::Blocks' log)

I'm posting in this forum as I'm unsure whether this is a bug or some kind of user error.

Code
Running command: scons -f SConstruct.py mode=Release -j 4
Execution of 'scons -f SConstruct.py mode=Release -j 4' in 'C:\Creations\Plaidgadget\dev' failed.
Nothing to be done (all items are up-to-date).

Using Code::Blocks 12.11, fresh install but with configuration files left over from an older version.
Project is multiplatform, with root configured for GCC, "Lin-Profile", "Lin-Debug", "Lin-Release" configurations set up for GCC/SCons, and Win-* configurations set up for MSVC/SCons.
The project directory, SCons file and build root are all in /dev, with the project using ./ to refer to the file's location.


I've noticed that my Linux custom makefile commands don't appear on Windows.

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Custom makefile "execution failed" on Windows?
« Reply #1 on: March 12, 2013, 12:51:21 am »
I tried making an empty project and setting it up to point at the same script.  Still fails.  Tried a trivial command.  Still fails.  :(

This might be bug report material...


EDIT:  But the same failure is occurring with the old version of Code::Blocks I had been using!  Baffling!  What changed?
« Last Edit: March 12, 2013, 01:15:21 am by cellulose »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Custom makefile "execution failed" on Windows?
« Reply #2 on: March 12, 2013, 01:32:34 am »
Most likely the executable scons is not available in your system path variable.  If this is the case, there are several solutions.  Use the full path to scons, use the Environment Variables plugin, add scons to your system path, or add the path to scons to the "Additional paths" of the compiler you use.

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Custom makefile "execution failed" on Windows?
« Reply #3 on: March 12, 2013, 01:34:43 am »
scons is definitely in my system path and the commands I list work fine in command prompt.  I've tried sure-to-succeed things like "dir" as makefile commands and the failure still occurs.

Using command prompt for builds now.  I hope I can track down the cause soon because this is massively breaking my workflow.  ;_;

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Custom makefile "execution failed" on Windows?
« Reply #4 on: March 12, 2013, 01:39:46 am »
Have you tried adding cmd /c in front of your command?  Have you tried full paths?

Offline cellulose

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Custom makefile "execution failed" on Windows?
« Reply #5 on: March 12, 2013, 01:43:52 am »
Full paths didn't work.  cmd /c works!  Huzzah!  <3 <3 <3

Why does that fix the issue, though?

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Custom makefile "execution failed" on Windows?
« Reply #6 on: March 12, 2013, 01:55:07 am »
It worked in command prompt, and cmd /c asks command prompt to interpret the command following it, so I thought it was worth a try.  (wxExecute, which is what Code::Blocks uses to launch commands, sometimes has issues if it is given something that is not a native executable.)