News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Replacing compiler settings with a build script?

Started by colin, March 17, 2014, 04:36:16 PM

Previous topic - Next topic

BlueHazzard

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...

oBFusCATed

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!]

stahta01

#17
Quote from: oBFusCATed 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.

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.

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]
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

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!]

stahta01

#19
Quote from: oBFusCATed on March 25, 2014, 08:47:23 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.

"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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

Quote from: oBFusCATed on March 18, 2014, 09:07:57 AM
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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

#21
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.
(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!]

stahta01

Quote from: oBFusCATed 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.

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

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

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!]

colin

#24
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.

colin

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.

oBFusCATed

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!]

cartographer

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.

oBFusCATed

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!]

cartographer

Quote from: oBFusCATed on April 22, 2014, 09:02:09 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]