Minimum JDK version

2016-09-12 Thread Davide Giannella
Hello team,

following the recent mishap about JDK version and releases highlighted
two main issues:

cannot find jenkins for anything that is not 1.6

we should enforce the build to build with the minimum required JDK.

Now for the second point, this is easily achievable. What we have to
decide is whether we want this enforcement done on all the builds, or
only during releases build and checks.

I'm for having it enforced on all the builds.

Thoughts?

Davide




Re: Minimum JDK version

2016-09-12 Thread Julian Reschke

On 2016-09-12 11:42, Davide Giannella wrote:

Hello team,

following the recent mishap about JDK version and releases highlighted
two main issues:

cannot find jenkins for anything that is not 1.6

we should enforce the build to build with the minimum required JDK.

Now for the second point, this is easily achievable. What we have to
decide is whether we want this enforcement done on all the builds, or
only during releases build and checks.

I'm for having it enforced on all the builds.

Thoughts?


+1, the build should fail as early as possible (that is, before we 
actually commit the bad code).


Best regards, Julian


Re: Minimum JDK version

2016-09-12 Thread Tomek Rekawek
Hi,

the interesting thing here is that we actually compile the code with -source 
and -target=1.6 in these branches [1][2]. However, the javac still uses the 
rt.jar coming from the current JDK and it does contain the java.nio package. It 
seems that the only way to check the API usage correctness is to switch to JDK 
1.6.

Or maybe there’s some way to validate whether the used packages matches 
selected JDK version (eg. via some plugin reading the @since javadocs in API 
classes)?

Regards,
Tomek

[1] https://github.com/apache/jackrabbit-oak/blob/1.4/oak-parent/pom.xml#L97
[2] https://github.com/apache/jackrabbit-oak/blob/1.2/oak-parent/pom.xml#L95


-- 
Tomek Rękawek | Adobe Research | www.adobe.com
reka...@adobe.com

> On 12 Sep 2016, at 11:42, Davide Giannella  wrote:
> 
> Hello team,
> 
> following the recent mishap about JDK version and releases highlighted
> two main issues:
> 
> cannot find jenkins for anything that is not 1.6
> 
> we should enforce the build to build with the minimum required JDK.
> 
> Now for the second point, this is easily achievable. What we have to
> decide is whether we want this enforcement done on all the builds, or
> only during releases build and checks.
> 
> I'm for having it enforced on all the builds.
> 
> Thoughts?
> 
> Davide
> 
> 



smime.p7s
Description: S/MIME cryptographic signature


RE: Minimum JDK version

2016-09-12 Thread Stefan Seifert
in sling we use the animal sniffer plugin for exactly this purpose [1].
it checks that the compiled codes only uses signatures available in the 
configured jdk.

stefan

[1] http://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/

>-Original Message-
>From: Tomek Rekawek [mailto:reka...@adobe.com]
>Sent: Monday, September 12, 2016 1:06 PM
>To: oak-dev@jackrabbit.apache.org
>Subject: Re: Minimum JDK version
>
>Hi,
>
>the interesting thing here is that we actually compile the code with -
>source and -target=1.6 in these branches [1][2]. However, the javac still
>uses the rt.jar coming from the current JDK and it does contain the
>java.nio package. It seems that the only way to check the API usage
>correctness is to switch to JDK 1.6.
>
>Or maybe there’s some way to validate whether the used packages matches
>selected JDK version (eg. via some plugin reading the @since javadocs in
>API classes)?
>
>Regards,
>Tomek
>
>[1] https://github.com/apache/jackrabbit-oak/blob/1.4/oak-
>parent/pom.xml#L97
>[2] https://github.com/apache/jackrabbit-oak/blob/1.2/oak-
>parent/pom.xml#L95
>
>
>--
>Tomek Rękawek | Adobe Research | www.adobe.com
>reka...@adobe.com
>
>> On 12 Sep 2016, at 11:42, Davide Giannella  wrote:
>>
>> Hello team,
>>
>> following the recent mishap about JDK version and releases highlighted
>> two main issues:
>>
>> cannot find jenkins for anything that is not 1.6
>>
>> we should enforce the build to build with the minimum required JDK.
>>
>> Now for the second point, this is easily achievable. What we have to
>> decide is whether we want this enforcement done on all the builds, or
>> only during releases build and checks.
>>
>> I'm for having it enforced on all the builds.
>>
>> Thoughts?
>>
>> Davide
>>
>>



Re: Minimum JDK version

2016-09-12 Thread Chetan Mehrotra
I think Marcel created OAK-4791 for the same. So that should take care
of enforcing this constraing
Chetan Mehrotra


On Mon, Sep 12, 2016 at 4:40 PM, Stefan Seifert  wrote:
> in sling we use the animal sniffer plugin for exactly this purpose [1].
> it checks that the compiled codes only uses signatures available in the 
> configured jdk.
>
> stefan
>
> [1] http://www.mojohaus.org/animal-sniffer/animal-sniffer-maven-plugin/
>
>>-Original Message-
>>From: Tomek Rekawek [mailto:reka...@adobe.com]
>>Sent: Monday, September 12, 2016 1:06 PM
>>To: oak-dev@jackrabbit.apache.org
>>Subject: Re: Minimum JDK version
>>
>>Hi,
>>
>>the interesting thing here is that we actually compile the code with -
>>source and -target=1.6 in these branches [1][2]. However, the javac still
>>uses the rt.jar coming from the current JDK and it does contain the
>>java.nio package. It seems that the only way to check the API usage
>>correctness is to switch to JDK 1.6.
>>
>>Or maybe there’s some way to validate whether the used packages matches
>>selected JDK version (eg. via some plugin reading the @since javadocs in
>>API classes)?
>>
>>Regards,
>>Tomek
>>
>>[1] https://github.com/apache/jackrabbit-oak/blob/1.4/oak-
>>parent/pom.xml#L97
>>[2] https://github.com/apache/jackrabbit-oak/blob/1.2/oak-
>>parent/pom.xml#L95
>>
>>
>>--
>>Tomek Rękawek | Adobe Research | www.adobe.com
>>reka...@adobe.com
>>
>>> On 12 Sep 2016, at 11:42, Davide Giannella  wrote:
>>>
>>> Hello team,
>>>
>>> following the recent mishap about JDK version and releases highlighted
>>> two main issues:
>>>
>>> cannot find jenkins for anything that is not 1.6
>>>
>>> we should enforce the build to build with the minimum required JDK.
>>>
>>> Now for the second point, this is easily achievable. What we have to
>>> decide is whether we want this enforcement done on all the builds, or
>>> only during releases build and checks.
>>>
>>> I'm for having it enforced on all the builds.
>>>
>>> Thoughts?
>>>
>>> Davide
>>>
>>>
>


Re: Minimum JDK version

2016-09-12 Thread Marcel Reutegger

Hi,

On 12/09/16 13:14, Chetan Mehrotra wrote:

I think Marcel created OAK-4791 for the same. So that should take care
of enforcing this constraing


Indeed. For trunk I just enabled the check against the 1.7 signature.

I will backport the plugin configuration to the branches and change
the version to 1.6 if possible. Otherwise we do it once 1.7 usages
are removed on the branches.

Regards
 Marcel




Re: Minimum JDK version

2016-09-12 Thread Julian Reschke

On 2016-09-12 14:09, Marcel Reutegger wrote:

Hi,

On 12/09/16 13:14, Chetan Mehrotra wrote:

I think Marcel created OAK-4791 for the same. So that should take care
of enforcing this constraing


Indeed. For trunk I just enabled the check against the 1.7 signature.

I will backport the plugin configuration to the branches and change
the version to 1.6 if possible. Otherwise we do it once 1.7 usages
are removed on the branches.

Regards
 Marcel


Thanks for taking care of this!



Re: Minimum JDK version

2016-09-13 Thread Davide Giannella
On 12/09/2016 13:09, Marcel Reutegger wrote:
> Hi,
>
> On 12/09/16 13:14, Chetan Mehrotra wrote:
>> I think Marcel created OAK-4791 for the same. So that should take care
>> of enforcing this constraing
>
> Indeed. For trunk I just enabled the check against the 1.7 signature.
>
> I will backport the plugin configuration to the branches and change
> the version to 1.6 if possible. Otherwise we do it once 1.7 usages
> are removed on the branches.
Sorry if it's redundant but I didn't have the time yet to check the commits.

Here's, from another project I worked on, how to enforce a specific java
version at compile time.

The build will fail if it's not compiled with the appropriate java version


   org.apache.maven.plugins
   maven-enforcer-plugin
   1.4.1
   
  
 enforce-java
 
enforce
 
 

   
  ${java.version}
   

 
  
   
 Davide

 


Re: Minimum JDK version

2016-09-13 Thread Tomek Rekawek
Hi Davide,

> On 13 Sep 2016, at 14:57, Davide Giannella  wrote:
> 
> Sorry if it's redundant but I didn't have the time yet to check the commits.
> 
> Here's, from another project I worked on, how to enforce a specific java
> version at compile time.
> 
> The build will fail if it's not compiled with the appropriate java version

I think the enforcer plugin allows to enforce given version of javac - eg. in 
order to compile Oak 1.0, 1.2 or 1.4 code you have to have JDK 1.6 installed on 
your machine. If you try to compile the code with a newer javac version (eg. 
you have only 1.8 installed locally), it’ll break.

On the other hand, the animal-sniffer plugin analyses the source code and makes 
sure it doesn’t use any API introduced in newer JDKs than configured in 
pom.xml. You can use it with any JDK you have. You don’t need to have JDK 1.6 
installed locally to compile to the historic Oak branch.

Both plugins will break the build if someone uses new, unsupported API. 
However, the enforcer requires the developer to install the old JDK, while 
animal-sniffer doesn’t, so I think the latter is a better option.

Marcel has already enabled the animal-sniffer on all the branches, so I think 
we shouldn’t run into similar issues in the future.

Regards,
Tomek

-- 
Tomek Rękawek | Adobe Research | www.adobe.com
reka...@adobe.com



smime.p7s
Description: S/MIME cryptographic signature


Minimum JDK version for 1.4

2016-09-14 Thread Julian Reschke

On 2016-09-12 14:09, Marcel Reutegger wrote:

Hi,

On 12/09/16 13:14, Chetan Mehrotra wrote:

I think Marcel created OAK-4791 for the same. So that should take care
of enforcing this constraing


Indeed. For trunk I just enabled the check against the 1.7 signature.

I will backport the plugin configuration to the branches and change
the version to 1.6 if possible. Otherwise we do it once 1.7 usages
are removed on the branches.

Regards
 Marcel


Thanks, Marcel.

So we now enforce JDK7 compliance on trunk, and JDK6 compliance on the 
release branches (1.0, 1.2, 1.4).


Given the fact that we already shipped two releases of 1.4 which did 
require JDK7 features (and apparently nobody noticed), should we 
consider allowing JDK7 features in 1.4 as well?


Advantages:

- makes it easier to backport code from trunk to 1.4

Disadvantage:

- is a somewhat big change within a release branch (but maybe nobody 
cares?, see above)


Best regards, Julian

PS: and once we have decided on this, we should have the same discussion 
about Jackrabbit...















Re: Minimum JDK version for 1.4

2016-09-14 Thread Marcel Reutegger

Hi,

On 14/09/16 13:27, Julian Reschke wrote:

So we now enforce JDK7 compliance on trunk, and JDK6 compliance on the
release branches (1.0, 1.2, 1.4).

Given the fact that we already shipped two releases of 1.4 which did
require JDK7 features (and apparently nobody noticed), should we
consider allowing JDK7 features in 1.4 as well?


There are still JVMs on Java 6 that are supported by vendors, even
though some require you to pay for extended support. But then, Java
7 and 8 are out for a while now and should be available on almost
all platforms.

I'm not particularly excited to change the supported JDK version
between 1.4 releases, but I think it is fine. As of December last
year we don't test on Java 6 anyway:

http://jackrabbit.markmail.org/thread/t3gzwi25tcz6masg

Regards
 Marcel


Re: Minimum JDK version for 1.4

2016-09-14 Thread Davide Giannella
On 14/09/2016 12:27, Julian Reschke wrote:
> should we consider allowing JDK7 features in 1.4 as well? 
I'm perfectly fine with it.

It looks like no one noticed the error and it's relatively low risk for
1.4. JD7 has been around for a while now.

I would simply add a note on the download page under the 1.4 section and
put out a news on the JR homepage.

In case it really breaks badly someone we can consider going back. So
far we didn't make that much use of JDK7 specific things as we often
have to backport later on older branches.

Davide




Re: Minimum JDK version for 1.4

2016-09-15 Thread Julian Reschke

On 2016-09-14 15:40, Davide Giannella wrote:

On 14/09/2016 12:27, Julian Reschke wrote:

should we consider allowing JDK7 features in 1.4 as well?

I'm perfectly fine with it.

It looks like no one noticed the error and it's relatively low risk for
1.4. JD7 has been around for a while now.

I would simply add a note on the download page under the 1.4 section and
put out a news on the JR homepage.

In case it really breaks badly someone we can consider going back. So
far we didn't make that much use of JDK7 specific things as we often
have to backport later on older branches.

Davide


OK,

it seems some are (mildly) in favor of this change, and so far nobody is 
opposed to it.


Do we need more time/discussion?

Best regards, Julian



Re: Minimum JDK version for 1.4

2016-09-16 Thread Davide Giannella
On 15/09/2016 12:05, Julian Reschke wrote:
>
> Do we need more time/discussion?

I would say we could start an official 72hr voting on it.

In case of failures we can keep discussing.

Cheers
Davide