You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/07/22 09:01:01 UTC

[plc4x] branch develop updated (3f286e3ff -> bb923aff2)

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


    from 3f286e3ff test(cbus): added tests from quick start reference
     new 7ffef5006 chore(docker): Worked on getting the Docker build working again (Needed work on plc4py)
     new bb923aff2 fix(plc4j): Made the ParserSerializerTestsuiteGeneratorSpec.groovy check if it uses the Apple pre 1.10.0 libpcap version and skip the test, if it does

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Dockerfile                                         | 25 ++++++----------------
 .../ParserSerializerTestsuiteGeneratorSpec.groovy  | 20 +++++++++++++++++
 pom.xml                                            | 10 ++++-----
 sandbox/plc4py/pom.xml                             |  2 +-
 sandbox/plc4py/setup.py                            |  3 +++
 src/main/script/prerequisiteCheck.groovy           |  5 +----
 6 files changed, 36 insertions(+), 29 deletions(-)


[plc4x] 01/02: chore(docker): Worked on getting the Docker build working again (Needed work on plc4py)

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 7ffef50064a54a8de99c4c19189a4051592267a4
Author: christoferdutz <ch...@c-ware.de>
AuthorDate: Fri Jul 22 10:59:55 2022 +0200

    chore(docker): Worked on getting the Docker build working again (Needed work on plc4py)
---
 Dockerfile                               | 25 ++++++-------------------
 pom.xml                                  | 10 +++++-----
 sandbox/plc4py/pom.xml                   |  2 +-
 sandbox/plc4py/setup.py                  |  3 +++
 src/main/script/prerequisiteCheck.groovy |  5 +----
 5 files changed, 16 insertions(+), 29 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index a72c2fe50..2763bc0c6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,17 +28,8 @@ RUN apt update -y
 # Install general purpose tools
 RUN apt install -y make libpcap-dev libc-dev git
 
-# Required for "with-boost" profile
-#RUN apt install -y bison flex gcc g++
-
-# Required for "with-cpp" profile
-#RUN apt install -y gcc g++
-
-# Required for "with-proxies" and "with-cpp"
-#RUN apt install -y clang
-
-# Required for "with-proxies" and "with-cpp"
-#RUN apt install -y cmake
+# Required for "with-c" profile
+RUN apt install -y build-essential
 
 # Required for "with-dotnet" profile
 RUN apt install -y wget
@@ -50,11 +41,9 @@ RUN apt install -y apt-transport-https
 RUN apt update -y
 RUN apt install -y dotnet-sdk-6.0
 
-# Required for "with-go" profile
-RUN apt install -y golang
-
 # Required for "with-python" profile
-RUN apt install -y python-setuptools python3 python-is-python3
+RUN apt install -y python3 python3-venv python3-pip
+RUN pip3 install wheel
 
 # Required for running on Windows systems
 RUN apt install -y dos2unix
@@ -74,12 +63,10 @@ RUN dos2unix .mvn/wrapper/maven-wrapper.properties
 # Tell Maven to fetch all needed dependencies first, so they can get cached
 # (Tried a patched version of the plugin to allow exclusion of inner artifacts.
 # See https://issues.apache.org/jira/browse/MDEP-568 for details)
-#RUN ./mvnw -P with-boost,with-c,with-cpp,with-dotnet,with-go,with-logstash,with-python,with-sandbox com.offbytwo.maven.plugins:maven-dependency-plugin:3.1.1.MDEP568:go-offline -DexcludeGroupIds=org.apache.plc4x,org.apache.plc4x.examples,org.apache.plc4x.sandbox
-RUN ./mvnw -P with-c,with-dotnet,with-go,with-python,with-sandbox com.offbytwo.maven.plugins:maven-dependency-plugin:3.1.1.MDEP568:go-offline -DexcludeGroupIds=org.apache.plc4x,org.apache.plc4x.examples,org.apache.plc4x.sandbox
+RUN ./mvnw -Dpython.venv.dir=./docker-venv -Dpython.venv.bin=docker-venv/bin/ -P with-c,with-dotnet,with-go,with-python,with-sandbox com.offbytwo.maven.plugins:maven-dependency-plugin:3.1.1.MDEP568:go-offline -DexcludeGroupIds=org.apache.plc4x,org.apache.plc4x.examples,org.apache.plc4x.sandbox
 
 # Build everything with all tests
-#RUN ./mvnw -P skip-prerequisite-check,with-boost,with-c,with-cpp,with-dotnet,with-go,with-logstash,with-python,with-sandbox install
-RUN ./mvnw -P with-c,with-dotnet,with-go,with-python,with-sandbox install
+RUN ./mvnw -Dpython.venv.dir=./docker-venv -Dpython.venv.bin=docker-venv/bin/ -P with-c,with-dotnet,with-go,with-python,with-sandbox install
 
 # Get the version of the project and save it in a local file on the container
 RUN ./mvnw org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version -DforceStdout -q -pl . > project_version
diff --git a/pom.xml b/pom.xml
index ac410c0b6..13ed4064d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -729,14 +729,11 @@
             <!-- License Files for other licenses -->
             <exclude>**/UNLICENSE</exclude>
             <exclude>**/EPL-2.0</exclude>
+
             <!--
-              Explicitly exclude thfese files as I was unable
-              to add a new licenses to the configuration.
+              Files licensed under other compatible licenses.
             -->
             <exclude>**/Expression.g4</exclude>
-            <exclude>**/KeyStoreLoader.java</exclude>
-            <exclude>**/OPCUAServer.java</exclude>
-            <exclude>**/Plc4xNamespace.java</exclude>
 
             <!-- Maven related files -->
             <exclude>**/target/**</exclude>
@@ -1577,6 +1574,7 @@
         <cmake.root>${project.build.directory}/cmake-${cmake-version}-linux-${os.arch}/bin/</cmake.root>
         <cmake.generator>Unix Makefiles</cmake.generator>
         <python.venv.bin>venv/bin/</python.venv.bin>
+        <python.venv.dir>./venv</python.venv.dir>
       </properties>
     </profile>
     <!-- Profile for mac (Self-Enabling) -->
@@ -1594,6 +1592,7 @@
         <cmake.root>${project.build.directory}/cmake-${cmake-version}-macos-universal/CMake.app/Contents/bin</cmake.root>
         <cmake.generator>Unix Makefiles</cmake.generator>
         <python.venv.bin>venv/bin/</python.venv.bin>
+        <python.venv.dir>./venv</python.venv.dir>
       </properties>
     </profile>
     <!-- profile for windows (Self-Enabling) -->
@@ -1611,6 +1610,7 @@
         <cmake.root>${project.build.directory}/cmake-${cmake-version}-windows-x86_64/bin</cmake.root>
         <cmake.generator>MinGW Makefiles</cmake.generator>
         <python.venv.bin>venv/Scripts/</python.venv.bin>
+        <python.venv.dir>./venv</python.venv.dir>
       </properties>
     </profile>
 
diff --git a/sandbox/plc4py/pom.xml b/sandbox/plc4py/pom.xml
index 1833db24c..796fb2b49 100644
--- a/sandbox/plc4py/pom.xml
+++ b/sandbox/plc4py/pom.xml
@@ -88,7 +88,7 @@
               <arguments>
                 <argument>-m</argument>
                 <argument>venv</argument>
-                <argument> ./venv</argument>
+                <argument>${python.venv.dir}</argument>
               </arguments>
             </configuration>
           </execution>
diff --git a/sandbox/plc4py/setup.py b/sandbox/plc4py/setup.py
index 0ee991aec..192aeae0e 100644
--- a/sandbox/plc4py/setup.py
+++ b/sandbox/plc4py/setup.py
@@ -35,6 +35,9 @@ setup(
     author_email="dev@plc4x.apache.org",
     license="Apache 2.0",
     packages=find_packages(include=["plc4py", "plc4py.*"]),
+    setup_requires=[
+        "wheel",
+    ],
     install_requires=[
         "pytest-asyncio>=0.18.3",
         "pip-tools",
diff --git a/src/main/script/prerequisiteCheck.groovy b/src/main/script/prerequisiteCheck.groovy
index 63e728e74..1666c5c7d 100644
--- a/src/main/script/prerequisiteCheck.groovy
+++ b/src/main/script/prerequisiteCheck.groovy
@@ -359,8 +359,7 @@ if (os == "windows") {
 // profiles.
 /////////////////////////////////////////////////////
 
-// Codegen requires at least java 9
-checkJavaVersion("9", null)
+checkJavaVersion("11", null)
 
 if (dotnetEnabled) {
     checkDotnet()
@@ -371,8 +370,6 @@ if (javaEnabled) {
 }
 
 if (cEnabled) {
-    // The cmake-maven-plugin requires at least java 11
-    checkJavaVersion("11", null)
     checkGcc()
 }
 


[plc4x] 02/02: fix(plc4j): Made the ParserSerializerTestsuiteGeneratorSpec.groovy check if it uses the Apple pre 1.10.0 libpcap version and skip the test, if it does

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit bb923aff2b1f5d95315a6f19c268b395c975cbe6
Author: christoferdutz <ch...@c-ware.de>
AuthorDate: Fri Jul 22 11:00:53 2022 +0200

    fix(plc4j): Made the ParserSerializerTestsuiteGeneratorSpec.groovy check if it uses the Apple pre 1.10.0 libpcap version and skip the test, if it does
---
 .../ParserSerializerTestsuiteGeneratorSpec.groovy    | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/plc4j/utils/test-generator/src/test/groovy/org/apache/plc4x/test/generator/ParserSerializerTestsuiteGeneratorSpec.groovy b/plc4j/utils/test-generator/src/test/groovy/org/apache/plc4x/test/generator/ParserSerializerTestsuiteGeneratorSpec.groovy
index 9a0a8e206..fb6295a08 100644
--- a/plc4j/utils/test-generator/src/test/groovy/org/apache/plc4x/test/generator/ParserSerializerTestsuiteGeneratorSpec.groovy
+++ b/plc4j/utils/test-generator/src/test/groovy/org/apache/plc4x/test/generator/ParserSerializerTestsuiteGeneratorSpec.groovy
@@ -40,6 +40,26 @@ class ParserSerializerTestsuiteGeneratorSpec extends Specification {
         } catch (e) {
             throw new TestAbortedException("no tshark", e)
         }
+        // On macs the libpcap version installed is usually 1.9.x
+        // This causes errors. We therefore need to skip this test on such devices.
+        try {
+            def sout = new StringBuilder(), serr = new StringBuilder()
+            def proc = "tcpdump --version".execute()
+            proc.consumeProcessOutput(sout, serr)
+            proc.waitForOrKill(1000)
+            def output = serr + sout
+            if(!output.contains("libpcap")) {
+                throw new TestAbortedException("no libpcap")
+            }
+            def libpcapVersion = output.substring(output.indexOf("libpcap version ") + 16)
+            libpcapVersion = libpcapVersion.substring(0, libpcapVersion.indexOf("\n"))
+            // Check the libpcapVersion is at least 1.10.0
+            if(!libpcapVersion.startsWith("1.10")) {
+                throw new TestAbortedException("minimum libpcap version 1.10.0 expected")
+            }
+        } catch (e) {
+            throw new TestAbortedException("no tcpdump", e)
+        }
         if (!new File('/bin/sh').canExecute()) throw new TestAbortedException("No bin sh")
         def testSuitePath = Files.createTempFile("parser-serializer-testsuite", ".xml")
         URL pcap = ParserSerializerTestsuiteGeneratorSpec.getResource("/bacnet-stack-services.cap");