[haiku-appserver] Re: testing under R5

  • From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Thu, 01 Sep 2005 14:44:30 +0200

On 2005-09-01 at 13:55:02 [+0200], Adi Oanca wrote:
> Ingo Weinhold wrote:
> > On 2005-09-01 at 11:46:39 [+0200], Adi Oanca wrote:
> > [...]
> > 
> >>    Well with all these advices I managed to have the server working.
> >>    However, I feel there are some things wrong with our build system.
> >>For example: when I build for r5, in system/lib directory I'm getting 2
> >>libbe libraries: libopenbeos.so and libbe.so. Now, why does libbe.so needs
> >>to be build when target platform is r5? It doesn't have to be built!
> > 
> > 
> > Right, but that probably holds for 90% of the targets of the build system.
> 
>     You know better.
>     IMO this can easily be changed. When building for r5 apps should be 
>     linked
> against $(LIBBE) and LIBBE = libopenbeos.so. For haiku LIBBE = libbe.so.

Well, that's generally actually not the case. When building e.g. StyledEdit 
for platform "r5" the intention is to get an executable that runs under R5, 
not under the app server test environment. We probably need a more suitable 
target "test".

Anyway, with targets that in most cases don't make sense being built for R5 I 
actually meant things like the kernel, kernel modules, etc.

> > The main target is Haiku and disable the build for non-Haiku target
> > platforms would require to clutter the whole build system with "if
> > $(TARGET_PLATFORM) == haiku) {...".
> 
>     Can you do it another way?

Yes, by modifying the invoked rules to be platform aware.

> > Besides, in theory a libbe.so for R5
> > would makes sense, if it were possible to replace the system library 
> > (which
> > it isn't, I know).
> 
>     :-) Then there's no point for it there...
>     It breaks my test environment. :-)
>     I test the server by having app_server built in system/ not 
>     system/servers/,
> so that the lib/ be in the same directory. In there you can find also 
> libbe.so, and
> because of that ./app_server will not run. Deleting this file every time is 
> annoying;
> the other way of modifying the src/kits/Jamfile not to build libbe.so is 
> not hard, but
> it's not practical.
>     So, in the end, libbe.so under r5 obstructs ( my :) ) app_server 
>     testing.

Ever thought about creating a test directory somewhere and create links in it 
to the executables and libraries you need?

> > The next reincarnation of the build system might support marking targets
> > suitable for building for a certain platform, but for the moment I'd 
> > rather
> > not try that with the current build system.
> 
>     I'm afraid we're doing that already. Check the jamfile from 
>     tests/servers/app.

I was thinking of a more sophisticated method, like invoking a rule:

  BuildForPlatforms haiku_app_server : r5 ;

The default would be "haiku", so that most Jamfiles wouldn't need to be 
changed, while you could invoke the rule with other/additional platforms when 
needed. But this would require some more extensive changes to the build 
system.

> >>    Another thing: if I want to build the app_server for r5, I must go
> >>to src/tests/servers/app. Why? This is annoying. I want to be able to 
> >>build
> >>the app server from src/servers/app, the right location IMO.
> > 
> > Well, one can argue about that. In fact you don't want to build the app
> > server, but a special test version of it.
> 
>     True. :-) It's another way of seeing things.
>     90% of time I test the server with my own applications, so for me it 
>     makes
> much more sense to set a target platform, go into src/servers/app and build 
> by app_server.

Wouldn't it make even more sense to go to src/tests/servers/app and build 
both the test app server and all test apps at once? :-P

> > Anyway, doing a "jam
> > haiku_app_server" builds haiku_app_server regardless of where you invoke 
> > it,
> > if that helps.
> 
>     99% of cases I'm in src/servers/app because of svn, grep, ...
>     A simple jam with the platform set seems appropriate to me...
> 
> >>    If nobody has something to say, I'll modify the build system so that:
> >>- ./configure --target=xxx
> 
>     I wanted to say that before any building invoke ./configure 
>     --target=<wanted>

Sure.

> >>- in src/kits when building for r5 *only* libopenbeos.so be built (no
> >>libbe.so!)
> > 
> > If it really annoys you, do it, but I'd actually rather see the build 
> > rules
> > for libopenbeos be moved to src/tests/kits/Jamfile just analog to how it 
> > was
> > done for the test app server.
> 
>     Yep, that's what I had in mind. :-)

Really? OK then...

> >>- app_server be built in src/servers/app no matter the platform.
> > Please don't.
> 
>     Why not?
>     A if($(TARGET_PLATFORM) == haiku) { ... } else { ... } in
> src/servers/app/Jamfile would solve my problem.

Moving the test app server build stuff out of that Jamfile considerably 
cleaned it up, making it far more readable.

Well, add your "if $(TARGET_PLATFORM) = haiku {...} else {...}" but please 
only put a

  LocalDepends all : haiku_app_server ;

in the "else" branch, not anything from src/tests/servers/app/Jamfile. Note, 
that this will be reverted with the new build system. There you'll have a 
local settings file, where you can do things like that.

CU, Ingo

Other related posts: