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

Product fails build or the product is not found at startup (regression 4.0?) #3433

Closed
jantje opened this issue Jan 30, 2024 · 10 comments
Closed

Comments

@jantje
Copy link

jantje commented Jan 30, 2024

I'm maintaining the Sloeber repository which contains 2 products which are build using github actions using maven and tycho.
Both products have a splashScreen and I currently fail to build both of them with maven in such a way that the splash screen appears at startup.
It worked fine until I started using target files somewhere in September and therefore had to upgrade to tycho V4 at which time I upgraded to V4.0.4 (and tried downgrading without success).
After the first release (December 2023) people complained the splash screen was no longer there.
Now I'm preparing a new release and tested the splash screen and found it indeed no longer worked.
I tried to change things so the maven build shows the splash screen but haven't succeeded after days.

When the build fails I looks like this
image
note that "default-publish-products" is the next maven step so it looks as if the build didn't happen and no error was generated (I know very little of maven/tycho so it is just my 2cent)

When the build succeeds I get this
image
But following error in the error log

eclipse.buildId=unknown
java.version=17.0.10
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Command-line arguments:  -os win32 -ws win32 -arch x86_64

org.eclipse.equinox.app
OK
Tue Jan 30 01:38:05 CET 2024
Product io.sloeber.product.sdk.product2 could not be found.

The only difference between the 2 builds is the product UID in the .product file.
With the warning like below tycho builds but the result does not find the product
image

Anything else as UID and the build fails
image

As V4 has been out for a while and I didn't find any issues on this so I assume there are other things at play.
If you look at this pull request and look at the commit named "reintroducing the warning fixes the build"
Sloeber/arduino-eclipse-plugin#1618
you can see that the actions failed before and succeeds after the commit.
And the only change in the commit is the uid
Sloeber/arduino-eclipse-plugin@719ded0

Anny help is appreciated.

@jantje
Copy link
Author

jantje commented Jan 30, 2024

Addendum:
The only way I can get the IDE to find the product is by using the following
image
This off course also means updating the plugin.xml from product2 to product (It does not work with product2 on my system)

I'm not saying this is a tycho issue. If it is not can you tell me which component I should make a issue on?

@laeubi
Copy link
Member

laeubi commented Jan 30, 2024

@jantje one common pitfall is that resources are not included in the binary build (build.properties) so you should check the jars that they include everything you expect.

Second don't confuse a product definition file (*.product) and the product id (plugin.xml) even though they are labeled confusingly similar in the UI.

You should have a plugin with a plugin.xml that defines a product and that what is selected in the dropdown. The you have a eclipse-repository with a product file that has an ID and the warning says that these two should not match with the ID name! So in your example you might just call it like the filename sdk.product while your product definition has an id of io.slober.product.sdk.product

@jantje
Copy link
Author

jantje commented Jan 30, 2024

@laeubi
Thanks for your input

so you should check the jars that they include everything you expect.

For testing I simply added everything to the build. Unfortunately the successful builds do not show the splash
image

You should have a plugin with a plugin.xml that defines a product and that what is selected in the dropdown. The you have a eclipse-repository with a product file that has an ID and the warning says that these two should not match with the ID name! So in your example you might just call it like the filename sdk.product while your product definition has an id of io.sloeber.product.sdk.product

I hadn't thought about giving the product file an ID that is the filename (sdk.product). unfortunately the build fails on that one to.

Sloeber/arduino-eclipse-plugin#1618
I checked in a version with nearly everything added to the binary build, the product ID in the plugin.xml is io.sloeber.product.sdk.product the product ID in the product file is sdk.product and the build failed.
Then I committed a change that changes the product ID in the product file from sdk.product to io.sloeber.product.sdk (introducing the warning) fixing the build but no splash at startup.
Then I committed a change that changes the product ID in plugin.xml from io.sloeber.product.sdk.product to product; the build still works and still no splash at startup.

Basically if the only value for product file ID I have found to have a successful build is the plugin name itself and that gives a warning in the eclipse ide.
I still have not found a way to build with tycho version 4 or later that results in a splash at startup.

@laeubi
Copy link
Member

laeubi commented Jan 31, 2024

I still have not found a way to build with tycho version 4 or later that results in a splash at startup.

The splash screen is not a feature of Tycho, it is provided by your product / configuration. Eclipse itself is build with Tycho 4 and has a splash screen, so something likely is wrong in your product configuration.

@jantje
Copy link
Author

jantje commented Jan 31, 2024

The splash screen is not a feature of Tycho, it is provided by your product / configuration.

I think you are trying to tell me something here that I fail to grasp.
FYI. I'm talking about the splash screen because that is how I identify a "successful product"; but none of the product features are available (icons/intro/splash) and -in the cases I checked- the logging talks about not finding the product (as stated in the first post)

Eclipse itself is build with Tycho 4 and has a splash screen, so something likely is wrong in your product configuration.

I didn't know about the eclipse build being done in Tycho 4. Thanks for that info.

so something likely is wrong in your product configuration.

Or something weird is going on. That is why I wrote:

As V4 has been out for a while and I didn't find any issues on this; so I assume there are other things at play.

Facts are:

  • It started failing after a commit that included a tycho upgrade.
  • I can get it to work in the eclipse IDE
  • The error messages are not helpfull enough to me to understand what is wrong/wierd in my product configuration.

=> I'm kind of stuck due to "out of ideas"*

One idea I had last night is to create a branch starting from a successfully build of Sloeber and then only upgrade tycho ( maven upgrade; build; tycho upgrade; build) and check the build results. At least that should confirm it is related to the maven/tycho upgrade or not.

@laeubi
Copy link
Member

laeubi commented Jan 31, 2024

@jantje yes thats sometimes the best start from something working and change only a little thing... I just can tell that numerous products are build successfully with Tycho4 so there is no general problem.

@jantje
Copy link
Author

jantje commented Jan 31, 2024

I'm dumping this here to support my memory as it has proofed in the past not to be reliable

Trial build Sloeber 4.0.0 and simply upgrade tycho

V4.0.0 didn't want to build stating java errors (I am on Java version 21 on my machine)
So I installed java 17 and started again.
Build failed with wierd errors which I understood as :"you need a newer tycho version" :-(. I was on version 2.7.5 upgraded to 3.0.3 as I'm on maven 3.9.6
Build failed with Missing requirement: io.sloeber.core 4.4.1.qualifier requires 'osgi.bundle; org.apache.commons.compress 0.0.0' which is a problem I fixed in the main thread by using target files and a maven connector which forced me to do a tycho upgrade :-(
As doing that would invalidate the test; I opted to simply remove the dependencies and code as a working Sloeber is not required.
Now I have a successful build it starts up with the splash but I'm all confused about the 4.4.1 version number I see. I expected V4.0.0
Seems I started from the 4.4.1 tag and not 4.0.0 so all is good.
Checked in the changes needed to get the build done
Upgrade the action yml to use java 17 and maven 3.9.6
Creating a pull request to master forced a merge request which I resolved on the web site
The there was git hell. I finally decided to remove my local repository and reclone which fixed the situation.
Removed testing from the build as testing will fail due to Sloeber no longer working.
The build failed but on the product sdk (which should not have to be build) but the artifacts are there and no splash and error in log

!ENTRY org.eclipse.equinox.app 0 0 2024-01-31 19:42:04.933
!MESSAGE Product io.sloeber.product.product could not be found.

My brains ache and I reread my writings. I did write I tested this and it worked...; what changed?
On my system -using the same branch-I downgraded to maven 3.8.8 and tycho 2.7.5
And I do not get the splash to work with anything anymore.
I think it is best I need a break from this.

@jantje jantje closed this as completed Jan 31, 2024
@jantje
Copy link
Author

jantje commented Feb 1, 2024

I have figured out what was wrong with my project and I'll dump it here just in case someone comes here (via a search engine or so) with the same/similar issue

when @laeubi wrote

one common pitfall is that resources are not included in the binary build (build.properties) so you should check the jars that they include everything you expect.

He was absolutely right. If I had checked the jars I would have found this out earlier.
Here is a caveat I was not aware of : in my config the product plugin jar is not part of the delivery.
In other words "In my case I could add anything I want to the build.properties of the product plugin; it would never end up in the deliverable because the product plugin jar is not part of the deliverable"
For instance: I defined the product in the plugin.xml of the product (makes sense to me) but as the product jar (and as such the plugin.xml from the product plugin) is not part of the deliverable the product could not be found.
So when someone posts their build.properties like I did above
image
You can now tell them: no no won't work 🤌

I do not think the fact that products are not part of the deliverable is common knowledge (it may even be a bug). I do not see this mentioned here https://www.vogella.com/tutorials/EclipseProductDeployment/article.html
Though -now I know this- I see a couple of "indicators".
Like why do I need to specify a plugin that contains the splash. But on the other hand; why don't I get an error/warning when I specify a location in the product plugin for the splash or the icons?

Just for the record:
Now I understand this I fully understand why it works in the eclipse IDE.
I do not know whether my project is special to cause this behavior but I currently think it is not.
This is not something new in tycho (I found this with tycho V3.0.5)
According to the linked document above: Tycho is currently the only way to build products
When I export the product using the UI there are io.sloeber.product files in the binary folder but I did not find io.sloeber.product jars. That seems pretty consistent with my findings.

Thanks for the help and Tycho 👍 .

@laeubi
Copy link
Member

laeubi commented Feb 2, 2024

@jantje basically in your IDE every imported project will be considered, if you build a distribution only these parts you include in your product file will be packaged.

@jantje
Copy link
Author

jantje commented Feb 2, 2024

only these parts you include in your product file will be packaged.

That is how I understand it now. But I assumed
only these parts you include in your product file and the product itself will be packaged.

I think eclipse would do it's users a great service by introducing a warning/error when content of the product is referenced that needs to be part of the distribution.
For instance
image
Here an error could be shown stating something like "The specified path points to a file that will not be part of the distribution."

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

No branches or pull requests

2 participants