Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an Oomph setup and update dependencies to the latest versions #96

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

merks
Copy link
Contributor

@merks merks commented Jul 3, 2024

#95

@merks
Copy link
Contributor Author

merks commented Jul 3, 2024

FYI, this bundle is the replacement for all those bundles that I removed (and are needed by batik):

image

But all too often features are over-specified because the requirements of the bundles will be satisfied even if the bundles are listed in a feature.

@@ -43,7 +43,7 @@
download-size="347"
install-size="720"
version="0.0.0"
unpack="false"/>
unpack="false"/>u
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some character leftover

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I force pushed to remove this.

download-size="28"
install-size="58"
version="0.0.0"
unpack="false"/>

<plugin
id="javax.inject"
id="jakarta.inject.jakarta.inject-api"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do those bundles already exist in the 2020-06 release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need to exist in a specific release? It's available in Orbit.

I think it's actually better if we remove this entirely. See comments below.

<plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
<plugin id="org.apache.aries.spifly.dynamic.bundle" autoStart="true" startLevel="2"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is spifly already available in 2020-06?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's available in Orbit. Also equinox.ds was removed quite some time ago. As long as the product works, I doesn't seem to matter...

@@ -457,34 +443,6 @@
fragment="true"
unpack="false"/>

<plugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the extended xml apis come with some other feature? Because here you only remove the single bundles but I don't see the extended xml apis added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform has moved entirely away from including 3rd party bundles in features. It's not necessary and generally problematic because it locks in a very specific version preventing updates and causing duplicates when someone else does the same but with a different version.

See no includes of batik any any feature:

image

No inject either:

image

So my suggestion would be to prune down the includes as much as possible so that it doesn't lock in specific versions of anything except your own bundles...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I have seen that there is now an option to automatically include dependencies. But from my experience this adds much more bundles than really necessary. And the dependency to com.ibm.icu is transitively because of some org.eclipse bundle IIRC. I did quite some work to ensure the example application is minimal in size, which is now about 36MB. I will check how big it gets now. But if com.ibm.icu sneeks in, it probably gets at least 14MB bigger.
So yes, there are mechanisms to make it easier to create an application and resolve dependencies automatically, the mechanism is not really economic and adds bundles that are not really required and increases the size.
I will take that up myself. So you don't need to bother. I'll keep you updated on what happens in that area.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't mix up what the IDE does and what Tycho does. In any case, it's quick to see what's in the product:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should keep in mind that every time you include a feature a bundle that as not your own, you're feature cannot be easily installed in general when there are other versions of that bundle installed. That's especially true for singleton bundles.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know. :) But as I said, that feature was never meant to be used by anyone else than the NatTable Examples Application. Interestingly your screenshot shows only half of the bundles that are really included. All the Eclipse Platform bundles are not included. If I check the folder directly there are twice as much bundles.

But again, nevermind, I will check and verify it myself. I see that the product archive files are now > 10MB bigger, but com.ibm.icu is not included anymore. So not sure where the additional size is coming from.

Anyhow your changes seem to simplify the example product setup, and maybe I am able to simplify it even more.

@@ -548,11 +506,4 @@
version="0.0.0"
unpack="false"/>

<plugin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added com.ibm.icu.base in the past to reduce the size of the product, because com.ibm.icu is a huge bundle from which only a very limited set is actually needed. Has this changed in the meanwhile? Is com.ibm.icu not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't exist anymore. If some bundle needs something, it will be found. I don't see any direct dependencies on it. Again, like the above. The dependencies are being over-specified and in a way that's very restrictive and makes it impossible to use your feature except in very restricted installations. Hasn't anyone complained about that? Or maybe no one is using the feature because it's not so useful?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nobody ever used it, because it is not published. It is only part of the NatTable Examples Application. And it is used to keep the product size as small as possible. That was necessary in the past, as the size was almost twice as big as needed. But probably this is not the case anymore and I can drop that feature completely. The main intention back then was to get rid of com.ibm.icu and replace it with com.ibm.icu.base. If this is not needed anymore, I probably can switch to the e4.rcp.feature provided by the Platform. Will check this.

@@ -3,8 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: NatTable Eclipse 4 Examples
Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.examples.e4;singleton:=true
Bundle-Version: 2.4.0.qualifier
Require-Bundle: javax.inject;bundle-version="0.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is javax.inject now part of one of the other bundles and the import resolves because of that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package imports will find some appropriate bundle that exports the package without need for a bundle require. There are jakarta bundles that export this package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I somehow had both Require-Bundle and Import-Package. IIRC there was an issue in the past with the one or the other. If the Import-Package statement is sufficient now, I am happy to get rid of another Require-Bundle.

Remember that I was building against a pretty old Eclipse version and needed to solve issues with ugly workarounds. If they are not needed anymore, I am more than happy.

@merks
Copy link
Contributor Author

merks commented Jul 4, 2024

I notice that none of those feature includes affect the update site content which is like this for the 2.4.0 release:

image

And it looks like this for the locally-built repo:

image

So indeed I do think you have gone overboard on the includes in the features used by the product...

@fipro78
Copy link
Contributor

fipro78 commented Jul 4, 2024

So indeed I do think you have gone overboard on the includes in the features used by the product...

Not sure what you mean by that. The dependencies of NatTable as a widget are what they are. I actually do not see a big difference in the screenshots you provided. Have I missed something?

The features used in the product are intended to build the examples app product only. They are not published in other ways. And those E4 product features are only intended to keep the product as small as possible.

@merks
Copy link
Contributor Author

merks commented Jul 4, 2024

So indeed I do think you have gone overboard on the includes in the features used by the product...

Not sure what you mean by that. The dependencies of NatTable as a widget are what they are. I actually do not see a big difference in the screenshots you provided. Have I missed something?

Yes, the screen shots are about the contents of the update site which are not affected by these plug-in includes.

The features used in the product are intended to build the examples app product only. They are not published in other ways. And those E4 product features are only intended to keep the product as small as possible.

Yes, that's the point. And there such things are not required at all because a product will always include all dependencies without the features doing the includes. As I showed for the Platform: no feature include batik but batik is installed in the SDK product. So you would be more flexible and better off prune down the includes so it doesn't matter which bundle is providing the java.inject package, or com.ibm.icu, if that's even needed which appears not to be the case.

@fipro78
Copy link
Contributor

fipro78 commented Jul 4, 2024

And there such things are not required at all because a product will always include all dependencies without the features doing the includes.

That was not the case in the past. And it would also not happen if you uncheck the option the product definition. ;)
Anyhow, I got your point and will try to improve the product build further.

@merks
Copy link
Contributor Author

merks commented Jul 4, 2024

FYI, I experimented with removing a whole whack of 3rd party bundle includes from features and removing some produce start configuration stuff that I think matters not for your simple product:

image

The product still launches in this case.

We can try to make further simplifications. It's kind of bad news to have to list so many bundles in product feature because if something changes in the Platform it could be a problem. Probably there was a good reason not to just reuse existing platform features like the rcp feature...

@fipro78
Copy link
Contributor

fipro78 commented Jul 4, 2024

Probably there was a good reason not to just reuse existing platform features like the rcp feature...

Yes, size concerns with com.ibm.icu. Actually the nattable.examples.e4.rcp.feature is a copy of the platform rcp feature with minimal modifications. Maybe it is possible to drop it now and use the platform rcp feature. 10MB are today much less than it was 10 years ago.

@merks
Copy link
Contributor Author

merks commented Jul 4, 2024

I can help experiment with further produce simplification and to make sure it works with both older and new target platforms.. The simpler everything is, the easier it is to maintain. 😀

@fipro78
Copy link
Contributor

fipro78 commented Jul 4, 2024

One thing I noticed, the pom.xml file dependencies are not updated. These exist because we publish NatTable on Maven Central and want to ensure that the dependencies are resolved the Maven way too. That was at least necessary in the past. Is there now a more comfortable way to have the correct dependencies in the pom.xml for the Maven Central deployment, or do we still need to maintain this manually?

@merks
Copy link
Contributor Author

merks commented Jul 4, 2024

That's a good question. The Platform and EMF use the CBI aggregator. I'm not sure that's more comfortable, though maintaining Maven dependencies is also not exactly comfortable either. Tricky problems like mapping package imports to maven coordinates is handled by the CBI aggregator. But there's a bunch of scripting involved.

In any case, I don't there is much of anything to change. I think only this one affects a bundle for which you've specified dependencies:

		    <groupId>org.apache.poi</groupId>
		    <artifactId>poi</artifactId>
		    <version>4.1.1</version>

@fipro78 fipro78 merged commit fc5c4a8 into eclipse-nattable:master Jul 9, 2024
2 checks passed
@merks merks deleted the issue-95 branch July 9, 2024 14:17
@fipro78 fipro78 added this to the 2.5.0 milestone Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants