Bug 491566 - SWT fragments specify <executionEnvironment>
Summary: SWT fragments specify <executionEnvironment>
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Alexander Kurtakov CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on: 509410
Blocks: 411419
  Show dependency tree
 
Reported: 2016-04-13 03:28 EDT by David Williams CLA
Modified: 2020-06-12 05:50 EDT (History)
13 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2016-04-13 03:28:02 EDT
+++ This bug was initially created as a clone of Bug #411419 +++

See bug 411419 around comment 12 for more information. 

SWT is one of the few components that still specifies executionEnvironment in a POM. In your case, it is in a repository POM for your fragments: 
pom.xml - eclipse.platform.swt.binaries

It seems to me these days that is just a labor-saving device for "building", but does not perform the usual "runtime checks". 

I realize that there is long history here, and years ago, I know you had to remove the BREEs from the fragment MANIFESTs, but I believe that is no longer the case. 

I realize you are busy, but ... would be nice to get completely "clean" of overrides, and get rid of this 3-year-old bug.
Comment 1 David Williams CLA 2016-04-17 14:35:43 EDT
The more I think about it, the more I wonder if fragments are *supposed* to have their BREE listed? I seem to recall someone saying that at runtime, the "check" is to simply check the BREE of the host it gets associated to. 

Anyone know for sure? 

If true, then the way things are, is probably best.
Comment 2 Thomas Watson CLA 2016-04-18 08:18:14 EDT
(In reply to David Williams from comment #1)
> The more I think about it, the more I wonder if fragments are *supposed* to
> have their BREE listed? I seem to recall someone saying that at runtime, the
> "check" is to simply check the BREE of the host it gets associated to. 
> 
> Anyone know for sure? 
> 
> If true, then the way things are, is probably best.

At runtime BREEs are used at runtime by fragments.  Fragments CAN have BREEs that are different from their host bundle.  But I seem to recall that tycho had issues at one time if we had fragments that had different BREEs than their hosts.
Comment 3 David Williams CLA 2016-04-18 09:28:36 EDT
(In reply to Thomas Watson from comment #2)
> (In reply to David Williams from comment #1)
> > The more I think about it, the more I wonder if fragments are *supposed* to
> > have their BREE listed? I seem to recall someone saying that at runtime, the
> > "check" is to simply check the BREE of the host it gets associated to. 
> > 
> > Anyone know for sure? 
> > 
> > If true, then the way things are, is probably best.
> 
> At runtime BREEs are used at runtime by fragments.  Fragments CAN have BREEs
> that are different from their host bundle.  But I seem to recall that tycho
> had issues at one time if we had fragments that had different BREEs than
> their hosts.

Ok, thanks, Tom. I think Tycho has fixed their problem in Tycho 0.22.0. 
But, the "fix" might require 
that SWT set <resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints>
See bug 435068. 

At least, if the BREEs really are different. But, I get the impression that now the BREEs could be the same at 1.7. Or, SWT team, is that not true?
Comment 4 Alexander Kurtakov CLA 2016-06-15 07:11:17 EDT
BREEs for SWT fragments must have same BREE as as SWT host due to the way things are done - all sources in the host when developing but resulting classes being in fragments.
Comment 5 Alexander Kurtakov CLA 2016-07-28 10:48:29 EDT
Lakshmi/Arun, should we put BREE in all manifests and drop executionEnvironment from pom or keep the status quo? I'm for the former (more obvious solution) but would like to hear others opinion before pushing for it.
Comment 6 Alexander Kurtakov CLA 2016-09-21 13:25:31 EDT
I'll proceed with adding BREE to all fragments manifests and drop executionEnvironment next week if no objection by then.
Comment 7 Eclipse Genie CLA 2016-12-16 04:19:00 EST
New Gerrit change created: https://git.eclipse.org/r/87290
Comment 9 Alexander Kurtakov CLA 2016-12-16 05:07:27 EST
A bit later than expected but still - pushed.
Comment 10 Eclipse Genie CLA 2016-12-19 00:40:14 EST
New Gerrit change created: https://git.eclipse.org/r/87381
Comment 12 Alexander Kurtakov CLA 2016-12-19 01:43:31 EST
This uncovered build failure in some plugins dependent on swt but having BREE lower than 1.8 to fail compiling although resolution worked fine with exception like:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.27.0-SNAPSHOT:compile (default-compile) on project org.eclipse.ant.ui: Compilation failure: Compilation failure:
[ERROR] /opt/public/eclipse/builds/4I/gitCache/eclipse.platform.releng.aggregator/eclipse.platform/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/preferences/FileSelectionDialog.java:
[ERROR] /*******************************************************************************
[ERROR] ^
[ERROR] The type org.eclipse.swt.widgets.Composite cannot be resolved. It is indirectly referenced from required .class files
[ERROR] 1 problem (1 error)
[ERROR] -> [Help 1]

Reverted the commit to unbreak the build as it has to be investigated further.
Comment 13 Andrey Loskutov CLA 2016-12-19 02:45:01 EST
(In reply to Alexander Kurtakov from comment #12)
> This uncovered build failure in some plugins dependent on swt but having
> BREE lower than 1.8 to fail compiling

I've opened bug 509410, patch pending, to move ant to 1.8.
Comment 14 Alexander Kurtakov CLA 2016-12-19 02:53:08 EST
(In reply to Andrey Loskutov from comment #13)
> (In reply to Alexander Kurtakov from comment #12)
> > This uncovered build failure in some plugins dependent on swt but having
> > BREE lower than 1.8 to fail compiling
> 
> I've opened bug 509410, patch pending, to move ant to 1.8.

FWIW, this would not fix the issue as in my local tests with ant.ui moved to 1.8 I experienced same issue with equinox bundles depending on swt ant there would probably be others when equinox moved.
Comment 15 Dani Megert CLA 2016-12-19 03:13:09 EST
(In reply to Andrey Loskutov from comment #13)
> (In reply to Alexander Kurtakov from comment #12)
> > This uncovered build failure in some plugins dependent on swt but having
> > BREE lower than 1.8 to fail compiling
> 
> I've opened bug 509410, patch pending, to move ant to 1.8.

I've set the change to -2 so that it does not get merged until the reason for this bug has been found and fixed. We have other bundles with source level below 1.8 and also clients and they can all still use SWT.
Comment 16 Sarika Sinha CLA 2016-12-19 03:49:10 EST
In my local ant.ui compiles with Swt and swt.binaries with EE as 1.8
Comment 17 Alexander Kurtakov CLA 2016-12-19 03:54:17 EST
(In reply to Sarika Sinha from comment #16)
> In my local ant.ui compiles with Swt and swt.binaries with EE as 1.8

Do you do eclipse.platform build with -Pbuild-individual-bundles or whole releng.aggregator build? I'm able to reproduce it only in the later case.
Comment 18 Sarika Sinha CLA 2016-12-19 04:59:25 EST
(In reply to Alexander Kurtakov from comment #17)
> (In reply to Sarika Sinha from comment #16)
> > In my local ant.ui compiles with Swt and swt.binaries with EE as 1.8
> 
> Do you do eclipse.platform build with -Pbuild-individual-bundles or whole
> releng.aggregator build? I'm able to reproduce it only in the later case.

Right now I have done with Eclipse IDE, Sravan tried using -Pbuild-individual-bundles but it crashed in between.
Comment 19 David Williams CLA 2016-12-19 20:38:28 EST
You may know this already, but Tycho 0.22 added an item to target-platform-configuration that (I think) was supposed to help with this sort of issue. See Tycho bug 435068. It was specifically meant to address bug 413116 (host/fragment BREE mismatch) which sort of sounds like the opposite of the problem you are running into now.

The setting is 

<resolveWithExecutionEnvironmentConstraints>false</resolveWithExecutionEnvironmentConstraints>

I once tried setting this for "the whole build" but there was some error then with an Equinox bundle. I do not recall what it was. See bug 453757. 

I just mention all this here in case anyone is motivated to experiment, or if anyone understands it better than I do.
Comment 20 Markus Keller CLA 2017-01-11 14:12:23 EST
(In reply to Dani Megert from comment #15)
> I've set the change to -2 so that it does not get merged until the reason
> for this bug has been found and fixed. We have other bundles with source
> level below 1.8 and also clients and they can all still use SWT.

Sorry, I had to push Ant's move to 1.8 due to bug 509234. Please use R4_6_maintenance for further investigations of the problem in this bug.
Comment 21 Eric Williams CLA 2019-01-18 11:49:45 EST
Is there anything left to do here?
Comment 22 Alexander Kurtakov CLA 2019-01-18 12:00:44 EST
Yeah https://git.eclipse.org/c/platform/eclipse.platform.swt.binaries.git/tree/pom.xml#n89 and https://git.eclipse.org/c/platform/eclipse.platform.swt.binaries.git/tree/pom.xml#n82 should not be there for this one to be done. Aka no additional hints to the build system should be needed to produce the right output.
Comment 23 Eclipse Genie CLA 2020-06-12 05:50:23 EDT
New Gerrit change created: https://git.eclipse.org/r/164785