You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Chetan Mehrotra <ch...@gmail.com> on 2013/11/13 11:17:08 UTC

Update the Slf4j API bundle to 1.7.5

Currently Sling is packaging 1.6.4 for the slf4j-api. Most recent
release is 1.7.5 and has some noteworthy changes [1] including
performance, usage of varargs etc. The core API bundle has no
compatibility breaking change.

Slf4j bundle maps the package exports to bundle version. So with 1.7.5
the packages are exported at 1.7.5

I checked the Import-Package directive of most Sling bundle and all of
them have import range from [1.5,2). So should we move to 1.7.5?

The steps I see is
- Update the slf4j-api, jcl-over-slf4j, log4j-over-slf4j bundle
- Ensure that commons log work with both

WDYT?

Chetan Mehrotra
[1] http://www.slf4j.org/news.html

Re: Update the Slf4j API bundle to 1.7.5

Posted by Felix Meschberger <fm...@adobe.com>.
Sounds like a good compromise to me.

Regards
Felix

—
Felix Meschberger  |  Principal Scientist  |  Adobe



Am 18.11.2013 um 17:05 schrieb Chetan Mehrotra <ch...@gmail.com>:

> Changing the Slf4j API bundle version in parent pom would be tricky.
> 
> So to allow bundle to use new API and still be deployable on Sling
> system which package older version of Slf4j API bundle I have provided
> some steps at [1]. If the steps looks acceptable I would add them to
> Sling site
> 
> Chetan Mehrotra
> [1] https://issues.apache.org/jira/browse/SLING-3243?focusedCommentId=13825128


Re: Update the Slf4j API bundle to 1.7.5

Posted by Chetan Mehrotra <ch...@gmail.com>.
Changing the Slf4j API bundle version in parent pom would be tricky.

So to allow bundle to use new API and still be deployable on Sling
system which package older version of Slf4j API bundle I have provided
some steps at [1]. If the steps looks acceptable I would add them to
Sling site

Chetan Mehrotra
[1] https://issues.apache.org/jira/browse/SLING-3243?focusedCommentId=13825128

Re: Update the Slf4j API bundle to 1.7.5

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

That worries me.

We have long refused to update the JCR API reference in the parent POM on the grounds to not have a global requirement for JCR 2 API enforced upon all bundles.

So, if we can configure the parent POM such, that it also presets the org.slf4j package imports appropriately, I am fine. If we cannot do that, I would not update the parent POM. Otherwise I am even inclined to say that we should remove the slf4j-api from the parent pom’s dependency management.

Regards
Felix

—
Felix Meschberger  |  Principal Scientist  |  Adobe



Am 14.11.2013 um 02:58 schrieb Chetan Mehrotra <ch...@gmail.com>:

> I have done the required changes as part of SLING-3243. However one
> area is pending
> 
> The Sling Parent pom.xml pins the slf4j-api bundle at 1.5.2. To make
> use of new varargs support as part of slf4j api 1.7.5 (it now uses JDK
> 1.5) we would need to update this version. Note that at binary level
> usage of new vararg support does not cause any change. Quoting from
> Slf4j site
> 
> ---
> Printing methods in the Logger interface now offers variants accepting
> varargs instead of Object[]. Given that under the hood, the Java
> compiler transforms varargs into an array, this change is totally 100%
> no-ifs-or-buts backward compatible with all existing client code.
> ---
> 
> However if I change the version in parent then bnd would change the
> version range for slf4j api to [1.7,2) from [1.6,2).
> 
> So if any bundle wants to make use of new API and still wants to be
> deployed on Sling based system where slf4j API is 1.6.4 then best way
> would be to use version macro
> 
> <Import-Package>org.osgi.framework;version="[${version;=-;${@}},${version;+;${@}})"</Import-Package>
> 
> OR
> 
> <Import-Package>org.osgi.framework;version="$<range;[=-,+)>"</Import-Package>
> 
> Note usage of "=-" instead of "==" to decrement the minor version
> 
> Would this be the right way to tackle that or one should use a different way?
> 
> Chetan Mehrotra
> 
> 
> On Wed, Nov 13, 2013 at 6:42 PM, Felix Meschberger <fm...@adobe.com> wrote:
>> Sounds reasonable to me.
>> 
>> Regards
>> Felix
>> 
>> —
>> Felix Meschberger  |  Principal Scientist  |  Adobe
>> 
>> 
>> 
>> Am 13.11.2013 um 21:17 schrieb Chetan Mehrotra <ch...@gmail.com>:
>> 
>>> Currently Sling is packaging 1.6.4 for the slf4j-api. Most recent
>>> release is 1.7.5 and has some noteworthy changes [1] including
>>> performance, usage of varargs etc. The core API bundle has no
>>> compatibility breaking change.
>>> 
>>> Slf4j bundle maps the package exports to bundle version. So with 1.7.5
>>> the packages are exported at 1.7.5
>>> 
>>> I checked the Import-Package directive of most Sling bundle and all of
>>> them have import range from [1.5,2). So should we move to 1.7.5?
>>> 
>>> The steps I see is
>>> - Update the slf4j-api, jcl-over-slf4j, log4j-over-slf4j bundle
>>> - Ensure that commons log work with both
>>> 
>>> WDYT?
>>> 
>>> Chetan Mehrotra
>>> [1] http://www.slf4j.org/news.html
>> 


Re: Update the Slf4j API bundle to 1.7.5

Posted by Chetan Mehrotra <ch...@gmail.com>.
I have done the required changes as part of SLING-3243. However one
area is pending

The Sling Parent pom.xml pins the slf4j-api bundle at 1.5.2. To make
use of new varargs support as part of slf4j api 1.7.5 (it now uses JDK
1.5) we would need to update this version. Note that at binary level
usage of new vararg support does not cause any change. Quoting from
Slf4j site

---
Printing methods in the Logger interface now offers variants accepting
varargs instead of Object[]. Given that under the hood, the Java
compiler transforms varargs into an array, this change is totally 100%
no-ifs-or-buts backward compatible with all existing client code.
---

However if I change the version in parent then bnd would change the
version range for slf4j api to [1.7,2) from [1.6,2).

So if any bundle wants to make use of new API and still wants to be
deployed on Sling based system where slf4j API is 1.6.4 then best way
would be to use version macro

<Import-Package>org.osgi.framework;version="[${version;=-;${@}},${version;+;${@}})"</Import-Package>

OR

<Import-Package>org.osgi.framework;version="$<range;[=-,+)>"</Import-Package>

Note usage of "=-" instead of "==" to decrement the minor version

Would this be the right way to tackle that or one should use a different way?

Chetan Mehrotra


On Wed, Nov 13, 2013 at 6:42 PM, Felix Meschberger <fm...@adobe.com> wrote:
> Sounds reasonable to me.
>
> Regards
> Felix
>
> —
> Felix Meschberger  |  Principal Scientist  |  Adobe
>
>
>
> Am 13.11.2013 um 21:17 schrieb Chetan Mehrotra <ch...@gmail.com>:
>
>> Currently Sling is packaging 1.6.4 for the slf4j-api. Most recent
>> release is 1.7.5 and has some noteworthy changes [1] including
>> performance, usage of varargs etc. The core API bundle has no
>> compatibility breaking change.
>>
>> Slf4j bundle maps the package exports to bundle version. So with 1.7.5
>> the packages are exported at 1.7.5
>>
>> I checked the Import-Package directive of most Sling bundle and all of
>> them have import range from [1.5,2). So should we move to 1.7.5?
>>
>> The steps I see is
>> - Update the slf4j-api, jcl-over-slf4j, log4j-over-slf4j bundle
>> - Ensure that commons log work with both
>>
>> WDYT?
>>
>> Chetan Mehrotra
>> [1] http://www.slf4j.org/news.html
>

Re: Update the Slf4j API bundle to 1.7.5

Posted by Felix Meschberger <fm...@adobe.com>.
Sounds reasonable to me.

Regards
Felix

—
Felix Meschberger  |  Principal Scientist  |  Adobe



Am 13.11.2013 um 21:17 schrieb Chetan Mehrotra <ch...@gmail.com>:

> Currently Sling is packaging 1.6.4 for the slf4j-api. Most recent
> release is 1.7.5 and has some noteworthy changes [1] including
> performance, usage of varargs etc. The core API bundle has no
> compatibility breaking change.
> 
> Slf4j bundle maps the package exports to bundle version. So with 1.7.5
> the packages are exported at 1.7.5
> 
> I checked the Import-Package directive of most Sling bundle and all of
> them have import range from [1.5,2). So should we move to 1.7.5?
> 
> The steps I see is
> - Update the slf4j-api, jcl-over-slf4j, log4j-over-slf4j bundle
> - Ensure that commons log work with both
> 
> WDYT?
> 
> Chetan Mehrotra
> [1] http://www.slf4j.org/news.html


Re: Update the Slf4j API bundle to 1.7.5

Posted by Chetan Mehrotra <ch...@gmail.com>.
Yup would run the integration tests.

I have created SLING-3243 to track this.

Chetan Mehrotra
[1] https://issues.apache.org/jira/browse/SLING-3243

Re: Update the Slf4j API bundle to 1.7.5

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Wed, Nov 13, 2013 at 11:17 AM, Chetan Mehrotra
<ch...@gmail.com> wrote:
> ...The core API bundle has no
> compatibility breaking change...

>... I checked the Import-Package directive of most Sling bundle and all of
> them have import range from [1.5,2). So should we move to 1.7.5?...

I'd say yes, given the above there shouldn't be any problems. Please
check that our integration tests still run fine after your changes
(there's still some semi-random failures in them but it's getting much
better).

-Bertrand