You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/08/09 13:44:54 UTC

[GitHub] [netbeans] sdedic opened a new pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

sdedic opened a new pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099


   An alternative to #3077 - an attempt to fix flaky`StartupExtender` specification. The main issue is that while `StartupExtender` API provides `List` of arguments, the API did not make it explicit that no quoting should be used - that the returned list items contain the verbatim conents that should be passed to the VM.  In general quoting should be done **always by the launcher**: it can put individual arguments right into the `ProcessBuilder` or somehow quote/concatenate into a commandline string.
   
   I've added a flag that allows a `StartupExtender` to declare it does/does not quoting. `getRawArguments` (aded API method) will then contain literal parameter value regardless of the extender policy. For compatibity, the `getArguments` method is unchanged.
   
   I have adapted maven and gradle. Maven has more tweaks as I found multiple issues with space or quote handling in Maven / Windows.
   
   This should fix [NETBEANS-2443](https://issues.apache.org/jira/browse/NETBEANS-2443) and [NETBEANS-5732](https://issues.apache.org/jira/browse/NETBEANS-5732)
   
   Unit tests added.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-895959575


   @moacirrf Thanks for testing! I've improved compatibility (added tests to startup extender API module); I've also reviewed StartupExtender impls in the current repository:
   
   Fixed: `webcommon/javascript.nodejs/src/org/netbeans/modules/javascript/nodejs/exec/NodeExecutable.java`
   Mixed quoted arguments (getArguments) and unquoted, then uses list of such mixed args for ProcessBuilder
   
   Concatenate arguments into a single property - can continue to use getArguments, no change needed:
   * `contrib/j2ee.jboss4/src/org/netbeans/modules/j2ee/jboss4/ide/JBStartRunnable.java`
   * `java/java.source.ant/src/org/netbeans/modules/java/source/ant/ProjectRunnerImpl.java`
   * `apisupport/maven.apisupport/src/org/netbeans/modules/maven/apisupport/NetBeansStartupArgs.java`
   * `apisupport/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ModuleActions.java`
   * `javafx/javafx2.project/src/org/netbeans/modules/javafx2/project/JFXActionProvider.java`
   * `enterprise/j2ee.earproject/src/org/netbeans/modules/j2ee/earproject/EarActionProvider.java`
   * `enterprise/tomcat5/src/org/netbeans/modules/tomcat5/optional/StartTomcat.java`
   
   Just adds a fixed parameter without spaces - no change needed.
   `java/debugger.jpda.trufflenode/src/org/netbeans/modules/debugger/jpda/truffle/node/GraalVmStartupExtender.java`
   
   Potential bug:
   * `enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/StartTask.java`
   * `enterprise/payara.common/src/org/netbeans/modules/payara/common/StartTask.java`
   filed https://issues.apache.org/jira/browse/NETBEANS-5908
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] moacirrf edited a comment on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
moacirrf edited a comment on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-895672409


   Tested on windows:
   Maven: Working
   Gradle: Working
   Netbeans Project(Ant): Not working for me when netbeans is on a path with spaces.
   
   **Correct directory**
   Z:/java/Netbeans/Program Files/...
   
   **Error:**
   Error occurred during initialization of VM
   Could not find agent library Z:/Repositorios_Git/java/Netbeans/Program in absolute path, with error: Can't find dependent libraries
   C:\Users\admin\AppData\Local\NetBeans\Cache\dev\executor-snippets\profile.xml:126: The following error occurred while executing this line:
   C:\Users\admin\AppData\Local\NetBeans\Cache\dev\executor-snippets\profile.xml:80: Java returned: 1
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-897401933


   @moacirrf awesome - thanks for the verification and support !
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] moacirrf edited a comment on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
moacirrf edited a comment on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-895260081


   Thanks man, great job, I was taking days trying to solve it, I will remove my name on the task 2443 jira.
   Thanks.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] ebarboni merged pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
ebarboni merged pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a change in pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#discussion_r686799590



##########
File path: ide/extexecution/build.xml
##########
@@ -22,4 +22,14 @@
 <project basedir="." default="build" name="ide/extexecution">
     <description>Builds, tests, and runs the project org.netbeans.modules.extexecution</description>
     <import file="../../nbbuild/templates/projectized.xml"/>
+    
+    <!-- 
+        Hacks the build process: we supply a default generated-layer, the layer reg processor reads the existing 
+        file first, and appends to it. So annotation-based registrations will merge into the static content.
+        Must be done before do-test-compile.
+    -->
+    <target name="test-unit-dep-build" depends="test-init,projectized-common.test-unit-dep-build">
+       <mkdir dir="${build.test.unit.classes.dir}/META-INF"/>
+       <copy file="${test.unit.src.dir}/META-INF/layer-static.xml" tofile="${build.test.unit.classes.dir}/META-INF/generated-layer.xml"/>

Review comment:
       Fixed in 48182cf




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on a change in pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#discussion_r686640757



##########
File path: ide/extexecution/build.xml
##########
@@ -22,4 +22,14 @@
 <project basedir="." default="build" name="ide/extexecution">
     <description>Builds, tests, and runs the project org.netbeans.modules.extexecution</description>
     <import file="../../nbbuild/templates/projectized.xml"/>
+    
+    <!-- 
+        Hacks the build process: we supply a default generated-layer, the layer reg processor reads the existing 
+        file first, and appends to it. So annotation-based registrations will merge into the static content.
+        Must be done before do-test-compile.
+    -->
+    <target name="test-unit-dep-build" depends="test-init,projectized-common.test-unit-dep-build">
+       <mkdir dir="${build.test.unit.classes.dir}/META-INF"/>
+       <copy file="${test.unit.src.dir}/META-INF/layer-static.xml" tofile="${build.test.unit.classes.dir}/META-INF/generated-layer.xml"/>

Review comment:
       Ha ! Much simpler; thanks - will do.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] moacirrf commented on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
moacirrf commented on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-897197426


   Tested Ant, its working.
   thanks


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-897461262


   added @tmysik to review the change in `NodeExecutable`.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#discussion_r686637472



##########
File path: ide/extexecution/build.xml
##########
@@ -22,4 +22,14 @@
 <project basedir="." default="build" name="ide/extexecution">
     <description>Builds, tests, and runs the project org.netbeans.modules.extexecution</description>
     <import file="../../nbbuild/templates/projectized.xml"/>
+    
+    <!-- 
+        Hacks the build process: we supply a default generated-layer, the layer reg processor reads the existing 
+        file first, and appends to it. So annotation-based registrations will merge into the static content.
+        Must be done before do-test-compile.
+    -->
+    <target name="test-unit-dep-build" depends="test-init,projectized-common.test-unit-dep-build">
+       <mkdir dir="${build.test.unit.classes.dir}/META-INF"/>
+       <copy file="${test.unit.src.dir}/META-INF/layer-static.xml" tofile="${build.test.unit.classes.dir}/META-INF/generated-layer.xml"/>

Review comment:
       Isn't an alternative to add `META-INF/MANIFEST.MF` to the `test/unit/src` and specify the static layer in there? Used for example in [settings manifest](https://github.com/apache/netbeans/blob/master/platform/settings/test/unit/src/META-INF/MANIFEST.MF).




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-895278746


   @moacirrf If you have some spare time, try to build from the branch & test on Windows. I did some basics, a colleague who runs Windows computer tested as well, but still....


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] moacirrf commented on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
moacirrf commented on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-895260081


   Thanks man, great job, I was taking days trying to solve it, I will put your name on the task 2443 jira, ok?
   Thanks.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] moacirrf commented on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
moacirrf commented on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-895672409


   Tested on windows:
   Maven: Working
   Gradle: Working
   Netbeans Project(Ant): Not working for me when netbeans is on a path with spaces.
   
   **Correct directory**
   Z:/java/Netbeans/Program Files/...
   
   **Error:**
   Error occurred during initialization of VM
   Could not find agent library Z:/java/Netbeans/Program in absolute path, with error: Can't find dependent libraries
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #3099: [NETBEANS-2443] [NETBEANS-5732] Support profiler or other StartupExtenders that use spaces in args

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #3099:
URL: https://github.com/apache/netbeans/pull/3099#issuecomment-896624561


   @moacirrf I believe I've fixed the case for Ant projects (and for some others). It would be great if you could re-test to be sure.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists