You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/12 16:05:51 UTC

[GitHub] [lucene-solr] dweiss opened a new pull request #2362: LUCENE-9767: infrastructure for icu regeneration in place.

dweiss opened a new pull request #2362:
URL: https://github.com/apache/lucene-solr/pull/2362


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss merged pull request #2362: LUCENE-9767: infrastructure for icu regeneration in place.

Posted by GitBox <gi...@apache.org>.
dweiss merged pull request #2362:
URL: https://github.com/apache/lucene-solr/pull/2362


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] rmuir commented on pull request #2362: LUCENE-9767: infrastructure for icu regeneration in place.

Posted by GitBox <gi...@apache.org>.
rmuir commented on pull request #2362:
URL: https://github.com/apache/lucene-solr/pull/2362#issuecomment-778342807


   @dweiss This is now doing everything the ant build was doing, thanks! I tested everything works: nuked all the generated files locally, regenerated them, and git status is clean.
   
   It still has the hairiness of having to deal with the c package, but that's nothing new. I added comments for now about how to deal with this locally.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] rmuir commented on a change in pull request #2362: LUCENE-9767: infrastructure for icu regeneration in place.

Posted by GitBox <gi...@apache.org>.
rmuir commented on a change in pull request #2362:
URL: https://github.com/apache/lucene-solr/pull/2362#discussion_r575622281



##########
File path: gradle/generation/icu.gradle
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* NOTE: when regenerating, you need icu4c binaries in PATH.
+ * The icu4c version must match exactly the icu4j version in version.props:
+ * The one on your system is probably different.
+ *
+ * You can download the C sources to a standalone folder with these steps:
+ * (example for icu 62.2)
+ *
+ * # download version matching icu4j version in version.props
+ * curl -fLO https://github.com/unicode-org/icu/releases/download/release-62-2/icu4c-62_2-src.tgz
+ * # extract
+ * tar -zxvf icu4c-62_2-src.tgz
+ * # compile
+ * (cd icu/source && ./configure --prefix=$(pwd) --enable-rpath && make -j4)
+ * # test binaries work
+ * icu/source/bin/derb -V
+ * # put in PATH
+ * export PATH=$(pwd)/icu/source/bin:$PATH
+ */
+configure(project(":lucene:analysis:icu")) {
+  def utr30DataDir = file("src/data/utr30")
+
+  task genUtr30DataFiles() {
+    // May be undefined yet, so use a provider.
+    dependsOn { sourceSets.tools.runtimeClasspath }
+
+    doFirst {
+      // all these steps must be done sequentially: it's a pipeline resulting in utr30.nrm
+      project.javaexec {
+        main = "org.apache.lucene.analysis.icu.GenerateUTR30DataFiles"
+        classpath = sourceSets.tools.runtimeClasspath
+
+        ignoreExitValue false
+        workingDir utr30DataDir
+      }
+
+      def gennorm = 'gennorm2'
+      def icupkg = 'icupkg'
+      project.exec {
+        executable gennorm
+        ignoreExitValue = false
+        args = [
+            "-v",
+            "-s",
+            utr30DataDir,
+            "-o",
+            "${buildDir}/utr30.tmp",
+            "nfc.txt", "nfkc.txt", "nfkc_cf.txt", "BasicFoldings.txt",
+            "DiacriticFolding.txt", "DingbatFolding.txt", "HanRadicalFolding.txt",
+            "NativeDigitFolding.txt"
+        ]
+      }
+      project.exec {
+        executable icupkg
+        ignoreExitValue = false
+        args = [
+            "-tb",
+            "${buildDir}/utr30.tmp",
+            "src/resources/org/apache/lucene/analysis/icu/utr30.nrm"
+        ]
+      }
+    }
+  }
+
+  task genRbbi() {
+    // May be undefined yet, so use a provider.
+    dependsOn { sourceSets.tools.runtimeClasspath }
+
+    doFirst {
+      project.javaexec {
+        main = "org.apache.lucene.analysis.icu.RBBIRuleCompiler"
+        classpath = sourceSets.tools.runtimeClasspath
+
+        ignoreExitValue false
+        enableAssertions true
+        args = [
+            "src/data/uax29",
+            "src/resources/org/apache/lucene/analysis/icu/segmentation"
+        ]
+      }
+    }
+  }
+
+  task regenerate() {
+    dependsOn genUtr30DataFiles

Review comment:
       thats right. the RBBI one is pure java. we can do it in parallel alongside the other one.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #2362: LUCENE-9767: infrastructure for icu regeneration in place.

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #2362:
URL: https://github.com/apache/lucene-solr/pull/2362#discussion_r575530042



##########
File path: gradle/generation/icu.gradle
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* NOTE: when regenerating, you need icu4c binaries in PATH.
+ * The icu4c version must match exactly the icu4j version in version.props:
+ * The one on your system is probably different.
+ *
+ * You can download the C sources to a standalone folder with these steps:
+ * (example for icu 62.2)
+ *
+ * # download version matching icu4j version in version.props
+ * curl -fLO https://github.com/unicode-org/icu/releases/download/release-62-2/icu4c-62_2-src.tgz
+ * # extract
+ * tar -zxvf icu4c-62_2-src.tgz
+ * # compile
+ * (cd icu/source && ./configure --prefix=$(pwd) --enable-rpath && make -j4)
+ * # test binaries work
+ * icu/source/bin/derb -V
+ * # put in PATH
+ * export PATH=$(pwd)/icu/source/bin:$PATH
+ */
+configure(project(":lucene:analysis:icu")) {
+  def utr30DataDir = file("src/data/utr30")
+
+  task genUtr30DataFiles() {
+    // May be undefined yet, so use a provider.
+    dependsOn { sourceSets.tools.runtimeClasspath }
+
+    doFirst {
+      // all these steps must be done sequentially: it's a pipeline resulting in utr30.nrm
+      project.javaexec {
+        main = "org.apache.lucene.analysis.icu.GenerateUTR30DataFiles"
+        classpath = sourceSets.tools.runtimeClasspath
+
+        ignoreExitValue false
+        workingDir utr30DataDir
+      }
+
+      def gennorm = 'gennorm2'
+      def icupkg = 'icupkg'
+      project.exec {
+        executable gennorm
+        ignoreExitValue = false
+        args = [
+            "-v",
+            "-s",
+            utr30DataDir,
+            "-o",
+            "${buildDir}/utr30.tmp",
+            "nfc.txt", "nfkc.txt", "nfkc_cf.txt", "BasicFoldings.txt",
+            "DiacriticFolding.txt", "DingbatFolding.txt", "HanRadicalFolding.txt",
+            "NativeDigitFolding.txt"
+        ]
+      }
+      project.exec {
+        executable icupkg
+        ignoreExitValue = false
+        args = [
+            "-tb",
+            "${buildDir}/utr30.tmp",
+            "src/resources/org/apache/lucene/analysis/icu/utr30.nrm"
+        ]
+      }
+    }
+  }
+
+  task genRbbi() {
+    // May be undefined yet, so use a provider.
+    dependsOn { sourceSets.tools.runtimeClasspath }
+
+    doFirst {
+      project.javaexec {
+        main = "org.apache.lucene.analysis.icu.RBBIRuleCompiler"
+        classpath = sourceSets.tools.runtimeClasspath
+
+        ignoreExitValue false
+        enableAssertions true
+        args = [
+            "src/data/uax29",
+            "src/resources/org/apache/lucene/analysis/icu/segmentation"
+        ]
+      }
+    }
+  }
+
+  task regenerate() {
+    dependsOn genUtr30DataFiles

Review comment:
       these two dependsOn statements don't give ordering guarantees in gradle (genRbbi can run before genUtr). Is this correct? If there are dependencies between them then these should be declared on tasks (for example genRbbi.dependsOn genUtr...).
   
   I'll wait for your decision whether it makes sense to automate binary downloads - if so, I'll try to do this and we can commit it cleaned up and shiny.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on pull request #2362: LUCENE-9767: infrastructure for icu regeneration in place.

Posted by GitBox <gi...@apache.org>.
dweiss commented on pull request #2362:
URL: https://github.com/apache/lucene-solr/pull/2362#issuecomment-778675424


   Hi Robert. Added an experimental task foo with initial steps downloading the matching ICU source package. Have to go again - family. But it should be doable to compile it from within gradle, it looks relatively easy from this point on.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org