Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 295744 - pluginCustomization argument should be removed from nonFrameworkArgs after being processed
Summary: pluginCustomization argument should be removed from nonFrameworkArgs after be...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: equinox.compendium-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-20 11:54 EST by Natalia Bartol CLA
Modified: 2009-12-01 15:47 EST (History)
3 users (show)

See Also:


Attachments
PluginCustomizationConsumedPatch (1.28 KB, patch)
2009-11-23 07:52 EST, Natalia Bartol CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Natalia Bartol CLA 2009-11-20 11:54:19 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: I20090611-1540

During headless startup of org.eclipse.core.AntRunner, if "-pluginCustomization" argument is given, it is incorrectly forwarded to AntRunner application as application argument. This is the cause of bug 294502. Since bug 294502 is already fixed this behavior is not blocking for users, however it produces confusing output information. 

For headless AntRunner call:

"%java%" -cp "%eclipse_startup%" org.eclipse.core.launcher.Main -pluginCustomization plugin_customization.ini -application org.eclipse.ant.core.antRunner -buildfile %script% -verbose -data %workspace% -Dworkspace.dir=%workspace% test

User will see output information:

Unknown argument: -pluginCustomization
Unknown target: plugin_customization.ini

I believe we should remove "-pluginCustomization" and its file name argument from EnvironmentInfo.nonFrameworkArgs after it was processed. Moreover, if in config.ini eclipse.pluginCustomization is set, then "-pluginCustomization" from command line is just ignored so we should also remove it then from EnvironmentInfo.nonFrameworkArgs.

I suggest to make change in Activator class of org.eclipse.equinox.preferences in method processCommandLine() and remove "-pluginCustomization" and its file name argument from  EnvironmentInfo.nonFrameworkArgs. Do we have any possibility to change this String array? Cause interface EnvironmentInfo has only getter methods... We can do it in EclipseEnvironmentInfo which implements EnvironmentInfo, but then it is needed to change package visibility.

Reproducible: Always
Comment 1 Thomas Watson CLA 2009-11-20 12:12:41 EST
I do not agree that we should remove any nonFrameworkArgs.  We have never removed others arguments that have been processed from this list.  I think it is confusing to all of a sudden start removing special case arguments from this list.  It is meant to be a constant list of arguments as passed in to eclipse from the command line.
Comment 2 Natalia Bartol CLA 2009-11-20 12:44:54 EST
Arguments are removed in org.eclipse.equinox.internal.app.CommandLineArgs processCommandLine(EnvironmentInfo envInfo). All arguments such as "-product", "-application", "-plugins" are removed from appArgs. If not removing from nonFrameworkArgs then maybe we should remove "-pluginCustomization" here?
Comment 3 Thomas Watson CLA 2009-11-20 13:54:47 EST
(In reply to comment #2)
> Arguments are removed in org.eclipse.equinox.internal.app.CommandLineArgs
> processCommandLine(EnvironmentInfo envInfo). All arguments such as "-product",
> "-application", "-plugins" are removed from appArgs. If not removing from
> nonFrameworkArgs then maybe we should remove "-pluginCustomization" here?

We could do that, but I think we have been reluctant to remove new arguments from the list passed to an application on start.  Who knows what applications may be dependent on the argument being passed through.
Comment 4 Natalia Bartol CLA 2009-11-23 06:54:48 EST
(In reply to comment #3)
> We could do that, but I think we have been reluctant to remove new arguments
> from the list passed to an application on start.  Who knows what applications
> may be dependent on the argument being passed through.

Is "-pluginCustomization" argument dedicated to be used by particular application? If it is, then we should parse it out in AntRunner. However I tested headless scenario with p2.director application. If user adds "-pluginCustomization" p2.director will not install feature but throw message: 

P2 headless call:

%JAVA% -cp %LAUNCHER% org.eclipse.core.launcher.Main -application org.eclipse.equinox.p2.director -metadataRepository "%METADATA_REPOSITORY%" -
artifactRepository "%ARTIFACT_REPOSITORY%" -destination "%DESTINATION_ECLIPSE%" -installIU %INSTALLATION_UNIT% -profile %PROFILE% -bundlepool "%BUNDLEPOOL%" -profile %PROFILE% -roaming -nl en 


!ENTRY org.eclipse.equinox.p2.core 4 0 2009-11-23 12:43:54.484
!MESSAGE Unknown option -pluginCustomization. Use -help for a list of known options.

As I see not only AntRunner has problems with "-pluginCustomization" being passed as application argument.
Comment 5 Natalia Bartol CLA 2009-11-23 07:03:29 EST
(In reply to comment #4)

> %JAVA% -cp %LAUNCHER% org.eclipse.core.launcher.Main -application
> org.eclipse.equinox.p2.director -metadataRepository "%METADATA_REPOSITORY%" -
> artifactRepository "%ARTIFACT_REPOSITORY%" -destination "%DESTINATION_ECLIPSE%"
> -installIU %INSTALLATION_UNIT% -profile %PROFILE% -bundlepool "%BUNDLEPOOL%"
> -profile %PROFILE% -roaming -nl en 

Sorry, I pasted command without "-pluginCustomization" :) Once more...

%JAVA% -cp %LAUNCHER% org.eclipse.core.launcher.Main -pluginCustomization custom.ini -application org.eclipse.equinox.p2.director -metadataRepository "%METADATA_REPOSITORY%" -artifactRepository "%ARTIFACT_REPOSITORY%" -destination "%DESTINATION_ECLIPSE%" -installIU %INSTALLATION_UNIT% -profile %PROFILE% -bundlepool "%BUNDLEPOOL%" -profile %PROFILE% -roaming -nl en 

!ENTRY org.eclipse.equinox.p2.core 4 0 2009-11-23 12:43:54.484
!MESSAGE Unknown option -pluginCustomization. Use -help for a list of known
options.
Comment 6 Natalia Bartol CLA 2009-11-23 07:52:13 EST
Created attachment 152847 [details]
PluginCustomizationConsumedPatch

A little change that solves problems from above... Patch against HEAD.
Comment 7 Thomas Watson CLA 2009-12-01 15:17:40 EST
I agree with Natalia.  We should parse this out of the arguments passed by the application container to the application start/run method.  I release the patch for M4.
Comment 8 Thomas Watson CLA 2009-12-01 15:47:42 EST
Comment on attachment 152847 [details]
PluginCustomizationConsumedPatch

Thanks for the contribution.  Marked for iplog.