Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 507602

Summary: [Build] Tycho build runs tests against SWT bundles from target platform
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: arunkumar.thondapu, daniel_megert, loskutov, lshanmug, mistria, niraj.modi, sravankumarl, t-oberlies
Version: 4.8Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=528274
https://bugs.eclipse.org/bugs/show_bug.cgi?id=528435
Whiteboard: stalebug
Bug Depends on: 461427    
Bug Blocks:    

Description Markus Keller CLA 2016-11-16 07:53:01 EST
(In reply to Niraj Modi from bug 498876 comment #29)
> > New Gerrit change created: https://git.eclipse.org/r/84642
> 
> Above Gerrit fails(since we have a new method and corresponding JUnit as
> part of single Patch), [..]

Looks like the Tycho build on Hudson runs the SWT Tests against SWT bundles from the target platform. Gerrit build jobs should be self-contained and should only depend on the target platform when bundles from other repositories are required. It's OK to depend on SWT binaries from the target platform, but the SWT Java classes that are used to run the test should be built from the repository, and should not be an outdated version.

Here's the error that occurred in the eclipse.platform.swt-Gerrit job:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.25.0:compile (default-compile) on project org.eclipse.swt.tests: Compilation failure: Compilation failure:
[ERROR] /jobs/genie.platform/eclipse.platform.swt-Gerrit/workspace/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_Printer.java:[184]
[ERROR] boolean isAutoScalable = printer.isAutoScalable();
[ERROR] ^^^^^^^^^^^^^^
[ERROR] The method isAutoScalable() is undefined for the type Printer
[ERROR] 1 problem (1 error)
Comment 1 Alexander Kurtakov CLA 2016-11-16 08:03:35 EST
The reason for that is that org.eclipse.swt bundle is hollow one. Compilation really happens against the fragments which are not in this repository at all. Adding to that potential need of natives recompile it would be a huge restructuring for this to happen although highly desired.
Comment 2 Markus Keller CLA 2016-11-17 13:14:47 EST
Hmm, so the eclipse.platform.swt-Gerrit job doesn't actually build the org.eclipse.swt bundle at all, and the other bundles are only compiling against SWT from the baseline? That would only be useful in rare scenarios.

I agree that including the natives build would be a huge undertaking, but binary changes are rare compared to Java-only changes.

The https://hudson.eclipse.org/platform/job/eclipse.platform.swt.binaries-Gerrit job already looks like it successfully compiles the org.eclipse.swt project from source. I think that job would already be more useful than the current eclipse.platform.swt-Gerrit job. And the two builds combined would cover all cases except for changes to the natives.
Comment 3 Alexander Kurtakov CLA 2016-11-18 04:42:32 EST
(In reply to comment #2)
> Hmm, so the eclipse.platform.swt-Gerrit job doesn't actually build the
> org.eclipse.swt bundle at all, and the other bundles are only compiling against
> SWT from the baseline? That would only be useful in rare scenarios.

org.eclipse.swt bundle is built but not used for anything after that. All other bundles are compiled against baseline. 

> 
> I agree that including the natives build would be a huge undertaking, but binary
> changes are rare compared to Java-only changes.
> 
> The https://hudson.eclipse.org/platform/job/eclipse.platform.swt.binaries-Gerrit
> job already looks like it successfully compiles the org.eclipse.swt project from
> source. I think that job would already be more useful than the current
> eclipse.platform.swt-Gerrit job. And the two builds combined would cover all
> cases except for changes to the natives.

There is a lot of room for improvement any help towards combining them is more than welcome.
Comment 4 Mickael Istria CLA 2017-07-20 03:45:24 EDT
If this is useful enough for SWT contributors, we could try to have the eclipse.platform.swt-Gerrit job builds simultaneously the binaries from masterand the regular SWT code from Gerrit patch.
It would mostly be a matter of configuring Hudson to also fetch the swt.binaries repo and to create a pom.xml that would reference both "modules".
Comment 5 Andrey Loskutov CLA 2017-12-19 01:55:37 EST
*** Bug 458228 has been marked as a duplicate of this bug. ***
Comment 6 Andrey Loskutov CLA 2017-12-19 02:53:11 EST
Would be great to fix this. 

Something like the script from bug 528274 should be done during maven/tycho build on Gerrit, to allow SWT consume the SWT jars built from patched sources and NOT coming from Internet. See also discussion on bug 528435.
Comment 7 Lakshmi P Shanmugam CLA 2018-08-28 04:22:37 EDT
Moving out of 4.9. Please re-target as required.
Comment 8 Eclipse Genie CLA 2020-08-24 08:26:15 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.