Contrib tests fail if core jar is not up to date

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Contrib tests fail if core jar is not up to date

Shai Erera
Hi

I've noticed that sometimes, after I run test-core and test-contrib, and then change core code, test-contrib fail on NoSuchMethodError and stuff like that. I've noticed that core.jar exists under build, and I assumed it's used by test-contrib, and probably is not recreated after core code has changed.

I verified it when looking in contrib-build.xml, which defines a property lucene.jar.present which is set to true if the jar is ... well, present. Which I believe is the reason for these failures. I've been thinking how to resolve that, and I can think of two ways:

(1) have test-core always delete that file, but that has two issues:
(1.1) It's redundant if the code hasn't changed.
(1.2) It forces you to either jar-core or test-core before you test-contrib, if you want to make sure you run w/ the latest jar.

or

(2) have test-contrib always call jar-core, which will first delete the file and then re-create it by compiling first. Compiling should not do anything if the code hasn't changed. So the only waste would be to create the .jar, but I think that's quite fast?

Does anyone, with more Ant skills than me, know of a better way to detect from test-contrib that core code has changed and only then rebuild the jar?

Shai
Reply | Threaded
Open this post in threaded view
|

Re: Contrib tests fail if core jar is not up to date

Robert Muir
On Thu, Mar 18, 2010 at 5:33 PM, Shai Erera <[hidden email]> wrote:

> Hi
>
> I've noticed that sometimes, after I run test-core and test-contrib, and
> then change core code, test-contrib fail on NoSuchMethodError and stuff like
> that. I've noticed that core.jar exists under build, and I assumed it's used
> by test-contrib, and probably is not recreated after core code has changed.
>
> I verified it when looking in contrib-build.xml, which defines a property
> lucene.jar.present which is set to true if the jar is ... well, present.
> Which I believe is the reason for these failures. I've been thinking how to
> resolve that, and I can think of two ways:
>
> (1) have test-core always delete that file, but that has two issues:
> (1.1) It's redundant if the code hasn't changed.
> (1.2) It forces you to either jar-core or test-core before you test-contrib,
> if you want to make sure you run w/ the latest jar.
>
> or
>
> (2) have test-contrib always call jar-core, which will first delete the file
> and then re-create it by compiling first. Compiling should not do anything
> if the code hasn't changed. So the only waste would be to create the .jar,
> but I think that's quite fast?
>
> Does anyone, with more Ant skills than me, know of a better way to detect
> from test-contrib that core code has changed and only then rebuild the jar?
>
> Shai
>

In addition to what Shai mentioned, I wanted to say that there are
other oddities about how the contrib tests run in ant. For example,
I'm not sure why we create the junitfailed.flag files (I think it has
something to do with detecting top-level that a single contrib
failed).

I noticed this when working on
https://issues.apache.org/jira/browse/LUCENE-1709, as I guess we
should really fix it before doing that issue.

--
Robert Muir
[hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Contrib tests fail if core jar is not up to date

Uwe Schindler
In reply to this post by Shai Erera

Hi Shai,

 

there is no way to do this with ant (detecting code change). The ant script *always* builds the jar file. In this case, it is just missing the dependency to jar-core in test-contrib. Alternatively, test-contrib should not use the jar file at all and simply add build/classes/java to classpath.

 

The fix is simple, can do that tomorrow.

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Shai Erera [mailto:[hidden email]]
Sent: Thursday, March 18, 2010 10:34 PM
To: [hidden email]
Subject: Contrib tests fail if core jar is not up to date

 

Hi

I've noticed that sometimes, after I run test-core and test-contrib, and then change core code, test-contrib fail on NoSuchMethodError and stuff like that. I've noticed that core.jar exists under build, and I assumed it's used by test-contrib, and probably is not recreated after core code has changed.

I verified it when looking in contrib-build.xml, which defines a property lucene.jar.present which is set to true if the jar is ... well, present. Which I believe is the reason for these failures. I've been thinking how to resolve that, and I can think of two ways:

(1) have test-core always delete that file, but that has two issues:
(1.1) It's redundant if the code hasn't changed.
(1.2) It forces you to either jar-core or test-core before you test-contrib, if you want to make sure you run w/ the latest jar.

or

(2) have test-contrib always call jar-core, which will first delete the file and then re-create it by compiling first. Compiling should not do anything if the code hasn't changed. So the only waste would be to create the .jar, but I think that's quite fast?

Does anyone, with more Ant skills than me, know of a better way to detect from test-contrib that core code has changed and only then rebuild the jar?

Shai

Reply | Threaded
Open this post in threaded view
|

Re: Contrib tests fail if core jar is not up to date

hossman
In reply to this post by Robert Muir

: In addition to what Shai mentioned, I wanted to say that there are
: other oddities about how the contrib tests run in ant. For example,
: I'm not sure why we create the junitfailed.flag files (I think it has
: something to do with detecting top-level that a single contrib
: failed).

Correct ... even if one contrib fails, test-contrib attempts to run the
tests for all the other contribs, and then fails if any junitfailed.flag
files are found in any contribs.

The assumption was if you were specificly testing a single contrib you'd
be using the contrib specific build from it's own directory, and it would
still fail fast -- it's only if you run "test-contrib" from the top level
that it ignores when "ant test" fails for individual contribs, and then
reports the failure at the end.

It's a hack, but it's a useful hack for getting nightly builds that can
report on the tests for all contribs, even if the first one fails (it's
less useful when one contrib depends on another, but that's a more complex
issue)

-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Contrib tests fail if core jar is not up to date

Robert Muir
On Thu, Mar 18, 2010 at 5:50 PM, Chris Hostetter
<[hidden email]> wrote:

>
> It's a hack, but it's a useful hack for getting nightly builds that can
> report on the tests for all contribs, even if the first one fails (it's
> less useful when one contrib depends on another, but that's a more complex
> issue)
>
> -Hoss
>

Hoss, thanks, that makes sense.



--
Robert Muir
[hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Contrib tests fail if core jar is not up to date

Shai Erera
Uwe,

(1) the problem is not the missing dependency, but rather the use of lucene.jar.present. So you'll need to remove it as well.
(2) Adding build/classes/java is not enough - you'll need to add a target dependency on compile-core or something.

I guess you already know that. Just pointing it out :).

Thanks for taking care of this,

Shai

On Thu, Mar 18, 2010 at 11:51 PM, Robert Muir <[hidden email]> wrote:
On Thu, Mar 18, 2010 at 5:50 PM, Chris Hostetter
<[hidden email]> wrote:

>
> It's a hack, but it's a useful hack for getting nightly builds that can
> report on the tests for all contribs, even if the first one fails (it's
> less useful when one contrib depends on another, but that's a more complex
> issue)
>
> -Hoss
>

Hoss, thanks, that makes sense.



--
Robert Muir
[hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

RE: Contrib tests fail if core jar is not up to date

Uwe Schindler

Hi Shai,

 

Good morning!

 

(1)    if you add the dependency to jar-core to the task, the jar is rebuild (everytime, as ANT has no idea if something changed, no need to delete). Jar-core depends also on compile-core, so the core compilation is always updates.

(2)    In this case we simply need compile-core instead of jar-core as dependency.

 

I will take care and will check all variants of calling when fixing the problem.

 

Can you open an issue, I’ll attach a patch there?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Shai Erera [mailto:[hidden email]]
Sent: Friday, March 19, 2010 5:25 AM
To: [hidden email]
Subject: Re: Contrib tests fail if core jar is not up to date

 

Uwe,

(1) the problem is not the missing dependency, but rather the use of lucene.jar.present. So you'll need to remove it as well.
(2) Adding build/classes/java is not enough - you'll need to add a target dependency on compile-core or something.

I guess you already know that. Just pointing it out :).

Thanks for taking care of this,

Shai

On Thu, Mar 18, 2010 at 11:51 PM, Robert Muir <[hidden email]> wrote:

On Thu, Mar 18, 2010 at 5:50 PM, Chris Hostetter
<[hidden email]> wrote:

>
> It's a hack, but it's a useful hack for getting nightly builds that can
> report on the tests for all contribs, even if the first one fails (it's
> less useful when one contrib depends on another, but that's a more complex
> issue)
>
> -Hoss
>

Hoss, thanks, that makes sense.




--
Robert Muir
[hidden email]

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

 

Reply | Threaded
Open this post in threaded view
|

RE: Contrib tests fail if core jar is not up to date

Uwe Schindler

Hi Shai again,

 

the whole thing is more complicated, sorry; on the first insight it seemed simple, but: I had this problem, too. But I didn’t care as I simply did “ant clean” and all was fine. Adding “jar-core” to the build-contrib task would principally work, but only for build-contrib. During my failures, I had the problem, that I was inside a contrib module and changed something in core, and tried ant compile or ant test. Both of then were probably fail. The problem here is that contrib. does not depend on the compilation/jarify of the top-level build, it just checks if the folders/jars are there. This explains, why the updates in core are not cause a contrib to update its core.

 

To fix this, the easiest is to change in contrib/common-build.xml both “unless”-attributes in “build-lucene” and “build-lucene-test”. We did not do this for speed reasons (as far as I know), because for each contrib (also during top-level build contrib.), the jar compilation would be triggered (and that’s very often, even if javac only recompiled changed files, but jar building is heavy, too)

 

An idea how to  fix this would be to change the “unless” to some check like that:

-          If the task is solely started from a contrib folder, the build-core tasks are run (as no special property is set, e.g. “build.from.core”. The “unless” would contain this undefined property, so it would always run)

-          If the task is started from main build.xml (build/test-contrib), the main build sets the above property on calling subant, that would be checked by the unless part. The core build.xml would compile the core one time, sets the property. “build.from.core” and the contrib’s check for unless would simply leave out.

 

That sounds like a solution. I am currently hacking that. Can you still open an issue?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 8:27 AM
To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai,

 

Good morning!

 

(1)    if you add the dependency to jar-core to the task, the jar is rebuild (everytime, as ANT has no idea if something changed, no need to delete). Jar-core depends also on compile-core, so the core compilation is always updates.

(2)    In this case we simply need compile-core instead of jar-core as dependency.

 

I will take care and will check all variants of calling when fixing the problem.

 

Can you open an issue, I’ll attach a patch there?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Shai Erera [mailto:[hidden email]]
Sent: Friday, March 19, 2010 5:25 AM
To: [hidden email]
Subject: Re: Contrib tests fail if core jar is not up to date

 

Uwe,

(1) the problem is not the missing dependency, but rather the use of lucene.jar.present. So you'll need to remove it as well.
(2) Adding build/classes/java is not enough - you'll need to add a target dependency on compile-core or something.

I guess you already know that. Just pointing it out :).

Thanks for taking care of this,

Shai

On Thu, Mar 18, 2010 at 11:51 PM, Robert Muir <[hidden email]> wrote:

On Thu, Mar 18, 2010 at 5:50 PM, Chris Hostetter
<[hidden email]> wrote:

>
> It's a hack, but it's a useful hack for getting nightly builds that can
> report on the tests for all contribs, even if the first one fails (it's
> less useful when one contrib depends on another, but that's a more complex
> issue)
>
> -Hoss
>

Hoss, thanks, that makes sense.




--
Robert Muir
[hidden email]

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

 

Reply | Threaded
Open this post in threaded view
|

RE: Contrib tests fail if core jar is not up to date

Uwe Schindler

Hi Shai,

 

attached is a patch hat fixes your issue, as described in the previous mail. It now does not do any “short-circuit” checks for the core.jar available, instead solely uses a property that is set by the parent.

 

This works good, now always when you compile a contrib solely (inside its folder), the core is compiled. If you run from top-level build.xml the top-level build compiles the core as dependency and passes the “core.compiled” property down to the contrib-crawl.

 

In contrib are still other short-circuits like this. E.g. The benchmark contrib checks, if the jar files of other contribs it depends on are available and only if not recompiles. This leads to the same problem is you change one of the depends-on contribs source code. In this case there is no way around a top-level clean, sorry.

 

Please still open an issue J

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 8:47 AM
To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai again,

 

the whole thing is more complicated, sorry; on the first insight it seemed simple, but: I had this problem, too. But I didn’t care as I simply did “ant clean” and all was fine. Adding “jar-core” to the build-contrib task would principally work, but only for build-contrib. During my failures, I had the problem, that I was inside a contrib module and changed something in core, and tried ant compile or ant test. Both of then were probably fail. The problem here is that contrib. does not depend on the compilation/jarify of the top-level build, it just checks if the folders/jars are there. This explains, why the updates in core are not cause a contrib to update its core.

 

To fix this, the easiest is to change in contrib/common-build.xml both “unless”-attributes in “build-lucene” and “build-lucene-test”. We did not do this for speed reasons (as far as I know), because for each contrib (also during top-level build contrib.), the jar compilation would be triggered (and that’s very often, even if javac only recompiled changed files, but jar building is heavy, too)

 

An idea how to  fix this would be to change the “unless” to some check like that:

-          If the task is solely started from a contrib folder, the build-core tasks are run (as no special property is set, e.g. “build.from.core”. The “unless” would contain this undefined property, so it would always run)

-          If the task is started from main build.xml (build/test-contrib), the main build sets the above property on calling subant, that would be checked by the unless part. The core build.xml would compile the core one time, sets the property. “build.from.core” and the contrib’s check for unless would simply leave out.

 

That sounds like a solution. I am currently hacking that. Can you still open an issue?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 8:27 AM
To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai,

 

Good morning!

 

(1)    if you add the dependency to jar-core to the task, the jar is rebuild (everytime, as ANT has no idea if something changed, no need to delete). Jar-core depends also on compile-core, so the core compilation is always updates.

(2)    In this case we simply need compile-core instead of jar-core as dependency.

 

I will take care and will check all variants of calling when fixing the problem.

 

Can you open an issue, I’ll attach a patch there?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Shai Erera [mailto:[hidden email]]
Sent: Friday, March 19, 2010 5:25 AM
To: [hidden email]
Subject: Re: Contrib tests fail if core jar is not up to date

 

Uwe,

(1) the problem is not the missing dependency, but rather the use of lucene.jar.present. So you'll need to remove it as well.
(2) Adding build/classes/java is not enough - you'll need to add a target dependency on compile-core or something.

I guess you already know that. Just pointing it out :).

Thanks for taking care of this,

Shai

On Thu, Mar 18, 2010 at 11:51 PM, Robert Muir <[hidden email]> wrote:

On Thu, Mar 18, 2010 at 5:50 PM, Chris Hostetter
<[hidden email]> wrote:

>
> It's a hack, but it's a useful hack for getting nightly builds that can
> report on the tests for all contribs, even if the first one fails (it's
> less useful when one contrib depends on another, but that's a more complex
> issue)
>
> -Hoss
>

Hoss, thanks, that makes sense.




--
Robert Muir
[hidden email]

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

 



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

shai-compile-fix.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Contrib tests fail if core jar is not up to date

Uwe Schindler

I opened an issue:

https://issues.apache.org/jira/browse/LUCENE-2333

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 9:19 AM
To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai,

 

attached is a patch hat fixes your issue, as described in the previous mail. It now does not do any “short-circuit” checks for the core.jar available, instead solely uses a property that is set by the parent.

 

This works good, now always when you compile a contrib solely (inside its folder), the core is compiled. If you run from top-level build.xml the top-level build compiles the core as dependency and passes the “core.compiled” property down to the contrib-crawl.

 

In contrib are still other short-circuits like this. E.g. The benchmark contrib checks, if the jar files of other contribs it depends on are available and only if not recompiles. This leads to the same problem is you change one of the depends-on contribs source code. In this case there is no way around a top-level clean, sorry.

 

Please still open an issue J

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 8:47 AM
To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai again,

 

the whole thing is more complicated, sorry; on the first insight it seemed simple, but: I had this problem, too. But I didn’t care as I simply did “ant clean” and all was fine. Adding “jar-core” to the build-contrib task would principally work, but only for build-contrib. During my failures, I had the problem, that I was inside a contrib module and changed something in core, and tried ant compile or ant test. Both of then were probably fail. The problem here is that contrib. does not depend on the compilation/jarify of the top-level build, it just checks if the folders/jars are there. This explains, why the updates in core are not cause a contrib to update its core.

 

To fix this, the easiest is to change in contrib/common-build.xml both “unless”-attributes in “build-lucene” and “build-lucene-test”. We did not do this for speed reasons (as far as I know), because for each contrib (also during top-level build contrib.), the jar compilation would be triggered (and that’s very often, even if javac only recompiled changed files, but jar building is heavy, too)

 

An idea how to  fix this would be to change the “unless” to some check like that:

-          If the task is solely started from a contrib folder, the build-core tasks are run (as no special property is set, e.g. “build.from.core”. The “unless” would contain this undefined property, so it would always run)

-          If the task is started from main build.xml (build/test-contrib), the main build sets the above property on calling subant, that would be checked by the unless part. The core build.xml would compile the core one time, sets the property. “build.from.core” and the contrib’s check for unless would simply leave out.

 

That sounds like a solution. I am currently hacking that. Can you still open an issue?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 8:27 AM
To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai,

 

Good morning!

 

(1)    if you add the dependency to jar-core to the task, the jar is rebuild (everytime, as ANT has no idea if something changed, no need to delete). Jar-core depends also on compile-core, so the core compilation is always updates.

(2)    In this case we simply need compile-core instead of jar-core as dependency.

 

I will take care and will check all variants of calling when fixing the problem.

 

Can you open an issue, I’ll attach a patch there?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Shai Erera [mailto:[hidden email]]
Sent: Friday, March 19, 2010 5:25 AM
To: [hidden email]
Subject: Re: Contrib tests fail if core jar is not up to date

 

Uwe,

(1) the problem is not the missing dependency, but rather the use of lucene.jar.present. So you'll need to remove it as well.
(2) Adding build/classes/java is not enough - you'll need to add a target dependency on compile-core or something.

I guess you already know that. Just pointing it out :).

Thanks for taking care of this,

Shai

On Thu, Mar 18, 2010 at 11:51 PM, Robert Muir <[hidden email]> wrote:

On Thu, Mar 18, 2010 at 5:50 PM, Chris Hostetter
<[hidden email]> wrote:

>
> It's a hack, but it's a useful hack for getting nightly builds that can
> report on the tests for all contribs, even if the first one fails (it's
> less useful when one contrib depends on another, but that's a more complex
> issue)
>
> -Hoss
>

Hoss, thanks, that makes sense.




--
Robert Muir
[hidden email]

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

 

Reply | Threaded
Open this post in threaded view
|

Re: Contrib tests fail if core jar is not up to date

Shai Erera
Sorry Uwe, I didn't have access to a computer all day :).

I'll take a look at the patch later though (if you'll wait) as even now I have brief access to a computer, w/ no code on it :).

Shai

On Fri, Mar 19, 2010 at 12:25 PM, Uwe Schindler <[hidden email]> wrote:

I opened an issue:

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 9:19 AM


To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai,

 

attached is a patch hat fixes your issue, as described in the previous mail. It now does not do any “short-circuit” checks for the core.jar available, instead solely uses a property that is set by the parent.

 

This works good, now always when you compile a contrib solely (inside its folder), the core is compiled. If you run from top-level build.xml the top-level build compiles the core as dependency and passes the “core.compiled” property down to the contrib-crawl.

 

In contrib are still other short-circuits like this. E.g. The benchmark contrib checks, if the jar files of other contribs it depends on are available and only if not recompiles. This leads to the same problem is you change one of the depends-on contribs source code. In this case there is no way around a top-level clean, sorry.

 

Please still open an issue J

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 8:47 AM
To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai again,

 

the whole thing is more complicated, sorry; on the first insight it seemed simple, but: I had this problem, too. But I didn’t care as I simply did “ant clean” and all was fine. Adding “jar-core” to the build-contrib task would principally work, but only for build-contrib. During my failures, I had the problem, that I was inside a contrib module and changed something in core, and tried ant compile or ant test. Both of then were probably fail. The problem here is that contrib. does not depend on the compilation/jarify of the top-level build, it just checks if the folders/jars are there. This explains, why the updates in core are not cause a contrib to update its core.

 

To fix this, the easiest is to change in contrib/common-build.xml both “unless”-attributes in “build-lucene” and “build-lucene-test”. We did not do this for speed reasons (as far as I know), because for each contrib (also during top-level build contrib.), the jar compilation would be triggered (and that’s very often, even if javac only recompiled changed files, but jar building is heavy, too)

 

An idea how to  fix this would be to change the “unless” to some check like that:

-          If the task is solely started from a contrib folder, the build-core tasks are run (as no special property is set, e.g. “build.from.core”. The “unless” would contain this undefined property, so it would always run)

-          If the task is started from main build.xml (build/test-contrib), the main build sets the above property on calling subant, that would be checked by the unless part. The core build.xml would compile the core one time, sets the property. “build.from.core” and the contrib’s check for unless would simply leave out.

 

That sounds like a solution. I am currently hacking that. Can you still open an issue?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Uwe Schindler [mailto:[hidden email]]
Sent: Friday, March 19, 2010 8:27 AM
To: [hidden email]
Subject: RE: Contrib tests fail if core jar is not up to date

 

Hi Shai,

 

Good morning!

 

(1)    if you add the dependency to jar-core to the task, the jar is rebuild (everytime, as ANT has no idea if something changed, no need to delete). Jar-core depends also on compile-core, so the core compilation is always updates.

(2)    In this case we simply need compile-core instead of jar-core as dependency.

 

I will take care and will check all variants of calling when fixing the problem.

 

Can you open an issue, I’ll attach a patch there?

 

Uwe

 

-----

Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen

http://www.thetaphi.de

eMail: [hidden email]

 

From: Shai Erera [mailto:[hidden email]]
Sent: Friday, March 19, 2010 5:25 AM
To: [hidden email]
Subject: Re: Contrib tests fail if core jar is not up to date

 

Uwe,

(1) the problem is not the missing dependency, but rather the use of lucene.jar.present. So you'll need to remove it as well.
(2) Adding build/classes/java is not enough - you'll need to add a target dependency on compile-core or something.

I guess you already know that. Just pointing it out :).

Thanks for taking care of this,

Shai

On Thu, Mar 18, 2010 at 11:51 PM, Robert Muir <[hidden email]> wrote:

On Thu, Mar 18, 2010 at 5:50 PM, Chris Hostetter
<[hidden email]> wrote:

>
> It's a hack, but it's a useful hack for getting nightly builds that can
> report on the tests for all contribs, even if the first one fails (it's
> less useful when one contrib depends on another, but that's a more complex
> issue)
>
> -Hoss
>

Hoss, thanks, that makes sense.




--
Robert Muir
[hidden email]

---------------------------------------------------------------------

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]