Author Topic: Dependencies issues  (Read 5178 times)

Offline b34r

  • Single posting newcomer
  • *
  • Posts: 4
Dependencies issues
« on: March 03, 2008, 06:19:00 pm »
Hi,

First of all, good work on finally getting the 8.02 version out.
It is a nice piece of software and a much needed modern, non make bloated (usable) IDE for Linux is finally available. 8)

But... I am having a hard time getting dependencies between my projects to work.
I checked the forum to no extend. And even followed the Wiki but couldn't sort it out.

My workspace consists of three projects of which two are executables depending on the third one: a shared static library.
Now, I did setup dependencies in the project Properties (Project's dependencies) but modifying the library code and invoking
'Build Workspace' leads to two different scenarios in a seemingly random fashion:

- The library does not get compiled (other projects remain unchanged IF they get checked, sometime they won't).
- The library compiles but the dependencies are not resolved and the projects (again if they get checked for modifications) are reported as up to date.

I then tried to include a binary dependency on the static library object (via the build targets external dependency file list).
And now when the library gets modified the projects are rebuild as expected.
The problem being that they won't always build. Build workspace still randomly skips one or both of the dependent projects (in a suspiciously fast way in my opinion).

So my only option for now is to manually compile every projects (3 of them hopefully) each time a modification is made.

Additional note: The IDE does not seem to check for modifications in header files, that would be a nice plus.
Thanks.

Offline b34r

  • Single posting newcomer
  • *
  • Posts: 4
Re: Dependencies issues
« Reply #1 on: March 04, 2008, 02:49:58 pm »
More on this topic...

A depends on B.
Modify B -> A won't build even with an explicit "build project A" unless one of A's source file is modified.

I have the feeling that Code::Blocks uses a project status cache in order to minimize builds.
That would explain why some projects compile while others won't when asking for a full workspace build.

Once a project has been successfully built it appears that it will never build again under any circumstances unless one of its own source file gets modified.

Even with a prior successful build the project should rebuild (or relink only in this case) if one of its dependencies was modified.


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Dependencies issues
« Reply #2 on: March 04, 2008, 03:52:06 pm »
Post a minimal workspace demonstrating your problem.
Dependencies work fine here so until I 'm able to actually see them fail, I can be of no use to you.
Be patient!
This bug will be fixed soon...

Offline b34r

  • Single posting newcomer
  • *
  • Posts: 4
Re: Dependencies issues
« Reply #3 on: March 05, 2008, 02:48:32 pm »
Ok, I managed to find some time to test the problem.
I could reproduce it on a minimal workspace but it's not as severe or random as I experience it on my full blown workspace.

Bug 1 steps:

- Open workspace.
- Build workspace, as I cleaned everything it should build all projects as expected.
- Navigate to the lib source change the + for a * in the Add() function.
- Build workspace, the lib and only one of the two dependent projects build but not the other.

Bug 2 steps:

- Clean workspace, only the lib and one of the two projects get cleaned.

The dependencies are setup correctly I expect. Correct me if I am wrong.
I don't think making more tests over this is necessary for now as it will almost always lead to this same 'missing from build' bug.
Hope it gives the same results for you.
Thanks.

Note: I am running Ubuntu Hardy, Code::Blocks 8.02 official packages on a Intel quad core.


[attachment deleted by admin]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Dependencies issues
« Reply #4 on: March 05, 2008, 03:49:31 pm »
In your first project you forgot to set the dependency on the library under "Properties... -> Project Settings -> Project's dependencies".
In your second project you depend on the wrong external file ("Properties... -> Build targetss -> Dependencies -> External dependency files".

The first is to make sure that every build of one of your projects (dep or dep2) look first if the libraries sourcecode has changed and therefore has to be newly build.
The second looks during binding if the dependend file(s) (in your case lib.a) has changed, and if yes force at least a re-bind.

Offline b34r

  • Single posting newcomer
  • *
  • Posts: 4
Re: Dependencies issues
« Reply #5 on: March 05, 2008, 04:47:04 pm »
Ooooh yeah...
So much for a bug report.

Alright. Obviously with these corrections made, it works.
Still my main project won't. I'll try to make a working example.
Sorry for the inconvenience.