Author Topic: Replacing compiler settings with a build script?  (Read 26225 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Replacing compiler settings with a build script?
« Reply #15 on: March 25, 2014, 12:03:50 pm »
it would be nice if you let us to help you. Some more detail about the problem?
There were also some ppa with nightlies, but they aren't updated since quite some time...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #16 on: March 25, 2014, 08:15:26 pm »
You don't need newer builds to make things work. I've just added more logging. 13.12 is perfectly fine and could do the job.
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7576
    • My Best Post
Re: Replacing compiler settings with a build script?
« Reply #17 on: March 25, 2014, 08:28:36 pm »
You don't need newer builds to make things work. I've just added more logging. 13.12 is perfectly fine and could do the job.

I found a possible problem; setting compiler to "No Compiler" fails to work on my suggestion of command only.
It works great with the mingw gcc as the compiler; but, it does give the nothing to be done message.

Code
Running target pre-build steps
CMD /c dir
 Volume in drive E is Backup
 Volume Serial Number is 2A96-F81C
 Directory of E:\OpenSourceCode\Test\script_only
03/25/2014  03:23 PM    <DIR>          .
03/25/2014  03:23 PM    <DIR>          ..
03/25/2014  03:23 PM             1,019 script_only.cbp
               1 File(s)          1,019 bytes
               2 Dir(s)   1,312,088,064 bytes free

-------------- Build: script in script_only (compiler: GNU GCC Compiler)---------------

Target is up to date.
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Attached my cbp projects 7zipped.
custom Makefile also fails if "no compiler" is used.

All this tested on CB 13.12 running on Windows 7 32-bit

Tim S.


[attachment deleted by admin]
« Last Edit: March 25, 2014, 08:48:43 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #18 on: March 25, 2014, 08:47:23 pm »
Hm, are you sure you've archived the correct project. I see simple gcc based project.
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7576
    • My Best Post
Re: Replacing compiler settings with a build script?
« Reply #19 on: March 25, 2014, 08:50:02 pm »
Hm, are you sure you've archived the correct project. I see simple gcc based project.

I attached the one(s) that works; not the one(s) that fails.
Just change the compiler to no compiler and it fails to work under CB 13.12.

I attached a custom makefile using "no compile" to this message.

Code
"makefile_only_bad - make_only": The compiler's setup (*No Compiler*) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto "Settings->Compiler...->Global compiler settings->*No Compiler*->Toolchain executables" and fix the compiler's setup.
Skipping...
Nothing to be done (all items are up-to-date).

Tim S.
« Last Edit: March 25, 2014, 08:55:06 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7576
    • My Best Post
Re: Replacing compiler settings with a build script?
« Reply #20 on: March 25, 2014, 09:10:26 pm »
Do you see your python script being executed in the log?
If not then you've not setup custom makefile!

Or his python script does NOT do output to stdout or stderr.

Does CB display both stdout and stderr?

My testing seem to implies that it does on Windows 7.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #21 on: March 25, 2014, 09:13:19 pm »
Yes it does display both stdout and stderr.

But you've made the same mistake as colin - the ask for rebuild command is empty, it must be set and it must return proper value (0 or 1). C::B uses it to see if there is something to build or not.

edit: I've not looked at the reported error. It is invalid on my machine, too, but this is to be expected. Probably Alpha should comment when *No compiler* should be used. I think he has added it.
« Last Edit: March 25, 2014, 09:15:51 pm by oBFusCATed »
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7576
    • My Best Post
Re: Replacing compiler settings with a build script?
« Reply #22 on: March 25, 2014, 09:18:09 pm »
Yes it does display both stdout and stderr.

But you've made the same mistake as colin - the ask for rebuild command is empty, it must be set and it must return proper value (0 or 1). C::B uses it to see if there is something to build or not.

edit: I've not looked at the reported error. It is invalid on my machine, too, but this is to be expected. Probably Alpha should comment when *No compiler* should be used. I think he has added it.

It works with the value empty on windows 7 32 bit.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #23 on: March 25, 2014, 09:27:24 pm »
Hm, it works on linux, too.
(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 colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Replacing compiler settings with a build script?
« Reply #24 on: March 27, 2014, 04:55:38 pm »
The script always output to stdout and stderr, and works fine when as a pre-step.
I have finally reduced my backlog so I will make some time next week to look at this further as I personally prefer Code::Blocks to Eclipse.

Thanks again everyone so far for feedback, I should have more time from Monday to continue looking into this problem.


UPDATE:
I'm currently not able to look into this any further as the business is not allowing any extra time to proceed with solving this problem, so I will have to try and deal with this is my own time.

Colin.
« Last Edit: April 07, 2014, 09:45:45 am by colin »

Offline colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Replacing compiler settings with a build script?
« Reply #25 on: April 15, 2014, 11:35:04 am »
Okay I'm back on looking at this today and tomorrow, but I'm curious why the IDE should care about asking for rebuild?
I shouldn't care or want the IDE to check for this if all of that checking is done using an external script, I just want to IDE to assume it will build every time and let the script skip whatever it wants.

Anyway I will re-read the comments left behind since I looked at this last time and provide any new information.

Thanks,
Colin.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #26 on: April 15, 2014, 07:51:44 pm »
Probably to print a user friendly message like "Program is up-to-date" or something similar.
(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 cartographer

  • Single posting newcomer
  • *
  • Posts: 2
Re: Replacing compiler settings with a build script?
« Reply #27 on: April 21, 2014, 08:49:01 pm »
I was having a similar issue and came up with a work-around, so I figured I would share.

In my case I did the following:
Compiler Settings -> Copy GCC -> Name it something
Select the new compiler -> Toolchain Executables and set the following (excluding quotes):

Compiler's Installation Directory: "/"
C, C++, Dynamic Linker, Static Linker, Make Program: "true" (aka "true(1): do nothing, successfully")

Then I just made a new build target set to "Commands only" and set it to use the new compiler. That is to say, all I really did was set the compiler to a program that does nothing, for my linux distribution it was the executable true located in my root bin directory. If you don't have such a program you can easily make one, just compile "int main() {return 0;}". Note that for some reason if I just changed the toolchain for the built-in "* No Compiler *" codeblocks would just crash when I tried to compile, I had to duplicate an existing compiler for some reason. Hope this helps.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #28 on: April 22, 2014, 09:02:09 pm »
cartographer: Can you post the exact steps needed to make C::B crash?
(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 cartographer

  • Single posting newcomer
  • *
  • Posts: 2
Re: Replacing compiler settings with a build script?
« Reply #29 on: April 24, 2014, 05:29:34 pm »
cartographer: Can you post the exact steps needed to make C::B crash?
Sure, I've also attached the debug report generated when it crashes. Using Lubuntu 14.04 LTS and code::blocks 13.12.

Steps:
File->New->Project->Console application
Language: C++
Compiler: *No Compiler* (reset to default settings)

Settings->Compiler..->*No Compiler*->Toolchain executables
Options: See attached toolchain.png

Build->Build (crash here)


[attachment deleted by admin]