Hi,

there's one thing which was done without a public announcement (at least not 
public like "here on mailing list". In one of the commits regarding to Luke, 
there was made the decision to assign a Java 9 Jigsaw module name to all JAR 
files. I did not notice this because it was somehow hidden.

There were already lengthy discussions on Maven and OpenJDK mailing list on 
"how to name a module". If you define a module name though 
"automatic-module-name" in the JAR manifest or by an explicit module-info.java 
(see https://issues.apache.org/jira/browse/LUCENE-10255, which is draft) the 
module name must be well thought. Christian Stein (Member of the OpenJDK group 
and also Junit committer, also well involved in development of Apache Maven) 
wrote some blog post about how a module name should look like, so any code 
downstream can import it into their own modules. The names must be valid Java 
identifiers: 
https://sormuras.github.io/blog/2019-08-04-maven-coordinates-and-java-module-names.html

It concludes this very well:
- The Java module name should have the Maven Group ID as prefix, followed by 
"." and then a local module descriptor. E.g., "org.apache.lucene.core"
- The prefix of exported package names inside each module *should* be prefixed 
by the module name (we can't do this foe Lucene, but we should at least share 
the same prefix: "org.apache.lucene").
- The version name inside the module should follow module system syntax (so at 
least "9.0.0", no prefix/suffix => parseable by ModuleDescriptor.Version)

Unfortunately I only noticed this too late (because of Luke Dawid and Tomoko 
added automatic module names), so I would like to revoke my +1 vote for the 
release. I'd really like to make a decision with the whole committers about the 
official module names as written to JAR files, because they affect how Java 11 
users will have to import the Lucene modules in their builds (if they use the 
Java Module System). The Module names should either be a metadata property for 
each Gradle module (like the Maven coordinate in each build.gradle) or we 
should add module-info.java now (which is impossible, will come later). At 
least it should NOT be some regex replace on the Gradle project path.

Current module name of lucene-core.jar is "lucene.core", which does not conform 
to any standard like we do for package names. Don't come with "In the JDK you 
java modules named "java.base": This is a different story. You also have a 
package name "java.lang". Same for modules named "jdk." (with package names 
"jdk.") This is because that's the root of Java and the "java" and "jdk" names 
are reserved in the spec. But any third party module should be following the 
above rules and use reverse domain names (like suggested in older versions of 
the Java Language Spec, nowadays it just says "globally unique"). "lucene" is 
not globally unique. And our packages in the source code are also named 
"org.apache.lucene".

Here is a statistic of module names used on Maven by different artifacts: 
https://github.com/sormuras/modules/blob/main/doc/Top1000-2020.txt.md

For my arguments see the discussion here (comments following this one): 
<https://issues.apache.org/jira/browse/LUCENE-10255?focusedCommentId=17450327&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17450327>

In short:
-1 to release before we have valid and explicitely declared module names (or 
remove the Automatic Module Manifest at all until we have a decission)

My proposal is to do the following before release:

In every build.gradle file define the module name explicit using an ext 
property for the "Automatic Module Name" JAR manifest, don't use regex replace 
on the filesystem path of the gradle build. Use fully qualified names according 
the Apache wide rule for Maven artifacts and Java packages. The current gradle 
code would cause a backwards break for Java module system users (e.g., 
Elasticsearch as far as I have figured out from following their discussions 
about converting to module system): If you remove the "lucene/" directory from 
the gradle build, the module name changes. This is not acceptable!

Later for 9.x replace the automatic module name by a real module-info.java (see 
above PR).

Sorry,
Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
https://www.thetaphi.de
eMail: u...@thetaphi.de

> -----Original Message-----
> From: Adrien Grand <jpou...@gmail.com>
> Sent: Friday, November 26, 2021 3:31 PM
> To: Lucene Dev <dev@lucene.apache.org>
> Subject: [VOTE] Release Lucene 9.0.0 RC3
> 
> Please vote for release candidate 3 for Lucene 9.0.0.
> 
> The artifacts can be downloaded from:
> https://dist.apache.org/repos/dist/dev/lucene/lucene-9.0.0-RC3-rev-
> 1ddce848cf3d5067efcafc6569d5f8203e56af0b
> 
> You can run the smoke tester directly with this command:
> 
> python3 -u dev-tools/scripts/smokeTestRelease.py \
> https://dist.apache.org/repos/dist/dev/lucene/lucene-9.0.0-RC3-rev-
> 1ddce848cf3d5067efcafc6569d5f8203e56af0b
> 
> The vote will be open until 2021-11-30 9:00 UTC.
> 
> [ ] +1  approve
> [ ] +0  no opinion
> [ ] -1  disapprove (and reason why)
> 
> Here is my +1.
> 
> --
> Adrien
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
> For additional commands, e-mail: dev-h...@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to