Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321303 - Buckminster seems to ignore custom config.ini
Summary: Buckminster seems to ignore custom config.ini
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Buckminster (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: buckminster.core-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-30 04:46 EDT by Christian Kesselheim CLA
Modified: 2019-02-25 14:40 EST (History)
8 users (show)

See Also:


Attachments
Some minimal sample project demonstrating the problem (119.63 KB, application/zip)
2010-08-13 04:13 EDT, Christian Kesselheim CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Kesselheim CLA 2010-07-30 04:46:51 EDT
Build Identifier: Eclipse 20100617-1415 (Helios), Buckminster 3.6

It seems that Buckminster fails to respect the custom config.ini of a product when generating P2 meta-data as part of its build:

I've got a small problem with a custom config.ini that I wanna use for one of my products. In Eclipse, the corresponding product descriptor has "Use an existing config.ini file" set to the following file:

osgi.console=true
osgi.noShutdown=true
eclipse.ignoreApp=true
org.osgi.service.http.port=8080
org.eclipse.equinox.http.jetty.http.port=8080

When I export this product via the Eclipse product export wizard, the resulting config.ini will look like this:

osgi.console=true
eclipse.p2.profile=profile
osgi.framework=file\:plugins/org.eclipse.osgi_3.6.0.v20100517.jar
org.osgi.service.http.port=8080
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
osgi.noShutdown=true
eclipse.product=lu.kreios.mtg.server.product
osgi.framework.extensions=reference\:file\:org.eclipse.persistence.jpa.equinox.weaving_2.1.0.v20100614-r7608.jar
osgi.bundles.defaultStartLevel=4
eclipse.p2.data.area=@config.dir/../p2
eclipse.application=lu.kreios.mtg.server.application
org.eclipse.equinox.http.jetty.http.port=8080
eclipse.ignoreApp=true

On the other hand, using Buckminster and a custom ANT action to trigger the product materialization will create a config.ini like this:

eclipse.p2.profile=MyTravelGuideServerProfile
osgi.framework=file\:plugins/org.eclipse.osgi_3.6.0.v20100517.jar
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.200.v20100503.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
eclipse.product=lu.kreios.mtg.server.product
osgi.framework.extensions=reference\:file\:org.eclipse.persistence.jpa.equinox.weaving_2.1.0.v20100614-r7608.jar
eclipse.p2.data.area=@config.dir/../p2
osgi.bundles.defaultStartLevel=4
eclipse.application=lu.kreios.mtg.server.application

As it turns out, Buckminster seems to have simply ignore my custom config.ini entries when generating the underlying P2 meta-data.

The corresponding snippet from content.xml WITHOUT Buckminster:

    <unit id="toolinglu.kreios.mtg.server.product.config.cocoa.macosx.x86_64" version="1.0.0" singleton="false">
      <provides size="2">
        <provided namespace="org.eclipse.equinox.p2.iu" name="toolinglu.kreios.mtg.server.product.config.cocoa.macosx.x86_64" version="1.0.0"/>
        <provided namespace="toolinglu.kreios.mtg.server.product" name="lu.kreios.mtg.server.product.config" version="1.0.0"/>
      </provides>
      <filter> (&amp;(osgi.arch=x86_64)(osgi.os=macosx)(osgi.ws=cocoa)) </filter>
      <touchpoint id="org.eclipse.equinox.p2.osgi" version="1.0.0"/>
      <touchpointData size="1">
        <instructions size="2">
          <instruction key="unconfigure"> setProgramProperty(propName:eclipse.ignoreApp,propValue:);setProgramProperty(propName:org.eclipse.equinox.http.jetty.http.port,propValue:);setProgramProperty(propName:osgi.noShutdown,propValue:);setProgramProperty(propName:eclipse.application,propValue:);setProgramProperty(propName:osgi.console,propValue:);setProgramProperty(propName:eclipse.product,propValue:);setProgramProperty(propName:org.osgi.service.http.port,propValue:); </instruction>
          <instruction key="configure"> setProgramProperty(propName:eclipse.ignoreApp,propValue:true);setProgramProperty(propName:org.eclipse.equinox.http.jetty.http.port,propValue:8080);setProgramProperty(propName:osgi.noShutdown,propValue:true);setProgramProperty(propName:eclipse.application,propValue:lu.kreios.mtg.server.application);setProgramProperty(propName:osgi.console,propValue:true);setProgramProperty(propName:eclipse.product,propValue:lu.kreios.mtg.server.product);setProgramProperty(propName:org.osgi.service.http.port,propValue:8080); </instruction>
        </instructions>
      </touchpointData>
    </unit>

The corresponding snippet from content.xml WITH Buckminster (note the lack of the additional setProgramProperty(..) declarations):

    <unit id="toolinglu.kreios.mtg.server.product.config.cocoa.macosx.x86_64" version="1.0.0" singleton="false">
      <provides size="2">
        <provided namespace="org.eclipse.equinox.p2.iu" name="toolinglu.kreios.mtg.server.product.config.cocoa.macosx.x86_64" version="1.0.0"/>
        <provided namespace="toolinglu.kreios.mtg.server.product" name="lu.kreios.mtg.server.product.config" version="1.0.0"/>
      </provides>
      <filter> (&amp;(osgi.arch=x86_64)(osgi.os=macosx)(osgi.ws=cocoa)) </filter>
      <touchpoint id="org.eclipse.equinox.p2.osgi" version="1.0.0"/>
      <touchpointData size="1">
        <instructions size="2">
          <instruction key="unconfigure"> setProgramProperty(propName:eclipse.application,propValue:);setProgramProperty(propName:eclipse.product,propValue:); </instruction>
          <instruction key="configure"> setProgramProperty(propName:eclipse.application,propValue:lu.kreios.mtg.server.application);setProgramProperty(propName:eclipse.product,propValue:lu.kreios.mtg.server.product); </instruction>
        </instructions>
      </touchpointData>
    </unit>

Workaround: Drop the custom config.ini and use the following META-INF/p2.inf file instead:

instructions.configure = \
	setProgramProperty(propName:osgi.console,propValue:true);\
	setProgramProperty(propName:osgi.noShutdown,propValue:true);\
	setProgramProperty(propName:eclipse.ignoreApp,propValue:true);\
	setProgramProperty(propName:org.osgi.service.http.port,propValue:8080);\
	setProgramProperty(propName:org.eclipse.equinox.http.jetty.http.port,propValue:8080);
instructions.unconfigure = \
	setProgramProperty(propName:osgi.console,propValue:);\
	setProgramProperty(propName:osgi.noShutdown,propValue:);\
	setProgramProperty(propName:eclipse.ignoreApp,propValue:);\
	setProgramProperty(propName:org.osgi.service.http.port,propValue:);\
	setProgramProperty(propName:org.eclipse.equinox.http.jetty.http.port,propValue:);
instructions.configure.import = \
    org.eclipse.equinox.p2.touchpoint.eclipse.setProgramProperty
instructions.unconfigure.import = \
    org.eclipse.equinox.p2.touchpoint.eclipse.setProgramProperty
    

Reproducible: Always
Comment 1 Thomas Hallgren CLA 2010-08-02 03:02:21 EDT
Using a custom config.ini works for me and touchpoint instructions are generated as expected. How is your custom config.ini referenced? Are you using an absolute path?
Comment 2 Thomas Hallgren CLA 2010-08-13 03:02:13 EDT
Christian, any info on this one? I'm not able to reproduce the problem. Can you provide a sample project that fails?
Comment 3 Christian Kesselheim CLA 2010-08-13 04:13:26 EDT
Created attachment 176524 [details]
Some minimal sample project demonstrating the problem

I've attached some minimal sample project that I can use to reproduce the problem on my machine (MacOSX, Cocoa, x86_64, Helios).

When using the PDE Product Export wizard, the relevant snippet from P2 content.xml will look like this:

    <unit id="toolingkreios.mail.product.product.config.cocoa.macosx.x86_64" version="1.0.0.201008131006" singleton="false">
      <provides size="2">
        <provided namespace="org.eclipse.equinox.p2.iu" name="toolingkreios.mail.product.product.config.cocoa.macosx.x86_64" version="1.0.0.201008131006"/>
        <provided namespace="toolingkreios.mail.product.product" name="kreios.mail.product.product.config" version="1.0.0.201008131006"/>
      </provides>
      <filter> (&amp;(osgi.arch=x86_64)(osgi.os=macosx)(osgi.ws=cocoa)) </filter>
      <touchpoint id="org.eclipse.equinox.p2.osgi" version="1.0.0"/>
      <touchpointData size="1">
        <instructions size="2">
          <instruction key="unconfigure"> setProgramProperty(propName:eclipse.application,propValue:);setProgramProperty(propName:osgi.console,propValue:);setProgramProperty(propName:eclipse.product,propValue:);setProgramProperty(propName:eclipse.consoleLog,propValue:); </instruction>
          <instruction key="configure"> setProgramProperty(propName:eclipse.application,propValue:kreios.mail.product.application);setProgramProperty(propName:osgi.console,propValue:2222);setProgramProperty(propName:eclipse.product,propValue:kreios.mail.product.product);setProgramProperty(propName:eclipse.consoleLog,propValue:true); </instruction>
        </instructions>
      </touchpointData>
    </unit>

Using the Buckminster "site.p2" action, it looks like this:

    <unit id="toolingkreios.mail.product.product.config.cocoa.macosx.x86_64" version="1.0.0.qualifier" singleton="false">
      <provides size="2">
        <provided namespace="org.eclipse.equinox.p2.iu" name="toolingkreios.mail.product.product.config.cocoa.macosx.x86_64" version="1.0.0.qualifier"/>
        <provided namespace="toolingkreios.mail.product.product" name="kreios.mail.product.product.config" version="1.0.0.qualifier"/>
      </provides>
      <filter> (&amp;(osgi.arch=x86_64)(osgi.os=macosx)(osgi.ws=cocoa)) </filter>
      <touchpoint id="org.eclipse.equinox.p2.osgi" version="1.0.0"/>
      <touchpointData size="1">
        <instructions size="2">
          <instruction key="unconfigure"> setProgramProperty(propName:eclipse.application,propValue:);setProgramProperty(propName:eclipse.product,propValue:); </instruction>
          <instruction key="configure"> setProgramProperty(propName:eclipse.application,propValue:kreios.mail.product.application);setProgramProperty(propName:eclipse.product,propValue:kreios.mail.product.product); </instruction>
        </instructions>
      </touchpointData>
    </unit>

Perhaps the problem is OS specific or due to the fact that the custom config.ini in question is sort of "incomplete" (still, why does it work with the product export wizard, then?)? Perhaps I'm just too damn stupid, dunno :-).
Comment 4 Adam Wehner CLA 2010-11-12 02:05:03 EST
Hello,
I can confirm that Buckminster 3.6 is ignoring the set config.ini file in the product definition. Is any solution in sight?
Comment 5 Miles Parker CLA 2011-03-09 23:05:39 EST
I think I may be having the same or a similar issue. I've got the same build targets and am on osgi.arch=x86_64 osgi.os=macosx osgi.ws=cocoa
Comment 6 Srdjan Grubor CLA 2011-03-23 14:59:12 EDT
The bug is still an issue as of Buckminster 3.6 as previous commenter mentioned.

Attempted to change the path to:
config.ini
<plugin name>/config.ini
/<plugin name>/config.ini
<full path>/config.ini

None of those options worked. Buckminster kept regenerating new files, ignoring the custom config.ini settings.
Comment 7 Thomas Kratz CLA 2011-06-06 03:59:34 EDT
I experience the same problem. Has anyone got a solution for this ?
Comment 8 Miles Parker CLA 2011-06-06 18:06:01 EDT
Could one common denominator be that we're all using OS X or are is anyone having this issue on other platforms?
Comment 9 Srdjan Grubor CLA 2011-06-06 21:10:09 EDT
(In reply to comment #8)
> Could one common denominator be that we're all using OS X or are is anyone
> having this issue on other platforms?

I do not think so. For my case, the problem was present in all the following product builds:
-win32 both 32 and 64 bit
-macos  64 bit
-linux both 32 and 64 bit
Comment 10 Anthony Wallace CLA 2011-06-07 03:41:13 EDT
(In reply to comment #8)
> Could one common denominator be that we're all using OS X or are is anyone
> having this issue on other platforms?

Building for win32 manifests the issue for me, not currently building to any other platforms.
Comment 11 Anthony Wallace CLA 2011-06-07 03:47:09 EDT
For some further information on what I've tried to work round this issue, I've defined a feature that contains rootfile information. This feature supplies a path to a JRE to include which works as expected but I also include the following line in order to try get my custom config.ini picked up and used:

root.folder.configuration=file:config.ini

The custom config.ini is included at the root of the enclosing feature. Unfortunately, it is still not used in the product build which suggests that perhaps Buckminster is overwriting it at build time.
Comment 12 Sakis Kotisis CLA 2013-06-05 11:50:35 EDT
I encounter the same issue with Buckminster 4.2.
Has anyone found a solution or workaround?
Comment 13 Sakis Kotisis CLA 2013-06-06 07:40:32 EDT
Ignore my comment, my case seems to be more like Bug 284732.
Comment 14 Sakis Kotisis CLA 2013-07-01 07:15:49 EDT
And yet, it does happen.

Exactly as reported by Christian, although I'm using Buckminster 4.2.
This bug is not platform specific, it can be reproduced both for win32 and macosx.
Comment 15 Sakis Kotisis CLA 2013-07-02 04:04:19 EDT
As a workaround, one can copy the custom config.ini, after calling the director.
Buckminster itself makes use of this:
https://github.com/eclipse/buckminster/blob/master/org.eclipse.buckminster.jnlp.p2.director.product/product.ant