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

SWT has ~130 API errors showing "no longer an API" markers for API code #1187

Closed
iloveeclipse opened this issue Mar 7, 2024 · 11 comments · Fixed by #1191
Closed

SWT has ~130 API errors showing "no longer an API" markers for API code #1187

iloveeclipse opened this issue Mar 7, 2024 · 11 comments · Fixed by #1191
Assignees
Labels
bug Something isn't working regression Regression defect
Milestone

Comments

@iloveeclipse
Copy link
Member

After fixing #1073 I hoped to see no more API errors on SWT, but some dark force will not give up on that and immediately with the begin of 4.32 development I see again ~130 API errors on SWT.
As usually, I can build as many times as I can, errors do not disappear...

image

The nightmare is back, org.eclipse.swt.gtk.linux.x86_64 project has lot of API errors... :-(
I'm running I20240306-1800 build, baseline is set to 4.31 RC2.

It looks like all the classes/fields carrying @noextend or @noreference are not considered API anymore.

I don't see any changes in 4.32 that would cause that, the latest from 4.31 that could be related would be #1094, but I haven't seen API errors before, running most of the 4.31 builds.

Anyone else seeing this or has an idea what could be wrong?

@iloveeclipse iloveeclipse added bug Something isn't working regression Regression defect labels Mar 7, 2024
@iloveeclipse
Copy link
Member Author

I can reproduce on Windows too, and also in debugger.
Touching Display class in editor (triggers API builder) and looking at Display class visited in ClassFileComparator.getDelta() I see that IApiDescription.resolveAnnotations(IElementDescriptor) returns API / NO_EXTEND annotation for the workspace class and API / NO_RESTRICTIONS for the baseline class. That is definitely wrong end explains the weird API analysis.

The descriptions seem to be coming from ApiDescription.findNode(IElementDescriptor, boolean) but that one can't find a description for the Display class type so it returns description for the package and there are no restrictions.

I see that .api_description file is almost empty in org.eclipse.swt.win32.win32.x86_64_3.125.0.v20240227-1638.jar from 4.31 RC2:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component name="org.eclipse.swt.win32.win32.x86_64_3.125.0.v20240227-1638" version="1.2">
    <plugin id="org.eclipse.swt.win32.win32.x86_64_3.125.0.v20240227-1638"/>
</component>

whereas it is full of data in org.eclipse.swt.win32.win32.x86_64_3.124.200.v20231113-1355.jar from 4.30RC2:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component name="org.eclipse.swt.win32.win32.x86_64_3.124.200.v20231113-1355" version="1.2">
    <plugin id="org.eclipse.swt.win32.win32.x86_64_3.124.200.v20231113-1355"/>
    <package name="org.eclipse.swt.accessibility" visibility="1">
        <type name="Accessible" restrictions="0">
            <method name="internal_WM_GETOBJECT" restrictions="8" signature="(JJ)J"/>
            <method name="internal_dispose_Accessible" restrictions="8" signature="()V"/>
            <method name="internal_new_Accessible" restrictions="8" signature="(Lorg/eclipse/swt/widgets/Control;)Lorg/eclipse/swt/accessibility/Accessible;"/>
        </type>
    </package>
    <package name="org.eclipse.swt.browser" visibility="1">
        <type name="Browser" restrictions="2"/>
    </package>
    <package name="org.eclipse.swt.custom" visibility="1">
        <type name="CBanner" restrictions="2"/>
        <type name="CTabFolder" restrictions="2"/>
        <type name="CTabItem" restrictions="2"/>
        <type name="StyledText" restrictions="2"/>
        <type name="ViewForm" restrictions="2"/>
    </package>
    <package name="org.eclipse.swt.dnd" visibility="1">
        <type name="Clipboard" restrictions="2"/>
        <type name="DragSource" restrictions="2"/>
        <type name="DropTarget" restrictions="2"/>
        <type name="TransferData" restrictions="0">
            <field name="formatetc" restrictions="8"/>
            <field name="pIDataObject" restrictions="8"/>
            <field name="result" restrictions="8"/>
            <field name="stgmedium" restrictions="8"/>
            <field name="type" restrictions="8"/>
        </type>
    </package>
    <package name="org.eclipse.swt.graphics" visibility="1">
        <type name="Color" restrictions="0">
            <field name="handle" restrictions="8"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/graphics/Device;I)Lorg/eclipse/swt/graphics/Color;"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/graphics/Device;II)Lorg/eclipse/swt/graphics/Color;"/>
        </type>
        <type name="Cursor" restrictions="0">
            <field name="handle" restrictions="8"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/graphics/Device;I)Lorg/eclipse/swt/graphics/Cursor;"/>
        </type>
        <type name="Device" restrictions="0">
            <method name="getDeviceZoom" restrictions="24" signature="()I"/>
            <method name="internal_dispose_GC" restrictions="8" signature="(JLorg/eclipse/swt/graphics/GCData;)V"/>
            <method name="internal_new_GC" restrictions="8" signature="(Lorg/eclipse/swt/graphics/GCData;)J"/>
        </type>
        <type name="Drawable" restrictions="0">
            <method name="internal_dispose_GC" restrictions="8" signature="(JLorg/eclipse/swt/graphics/GCData;)V"/>
            <method name="internal_new_GC" restrictions="8" signature="(Lorg/eclipse/swt/graphics/GCData;)J"/>
            <method name="isAutoScalable" restrictions="8" signature="()Z"/>
        </type>
        <type name="Font" restrictions="0">
            <field name="handle" restrictions="8"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/graphics/Device;J)Lorg/eclipse/swt/graphics/Font;"/>
        </type>
        <type name="FontData" restrictions="0">
            <field name="data" restrictions="8"/>
            <field name="height" restrictions="8"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/internal/win32/LOGFONT;F)Lorg/eclipse/swt/graphics/FontData;"/>
        </type>
        <type name="FontMetrics" restrictions="0">
            <field name="handle" restrictions="8"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/internal/win32/TEXTMETRIC;)Lorg/eclipse/swt/graphics/FontMetrics;"/>
        </type>
        <type name="GC" restrictions="0">
            <method name="getGCData" restrictions="8" signature="()Lorg/eclipse/swt/graphics/GCData;"/>
            <field name="handle" restrictions="8"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/graphics/Drawable;Lorg/eclipse/swt/graphics/GCData;)Lorg/eclipse/swt/graphics/GC;"/>
            <method name="win32_new" restrictions="8" signature="(JLorg/eclipse/swt/graphics/GCData;)Lorg/eclipse/swt/graphics/GC;"/>
        </type>
        <type name="GCData" restrictions="8"/>
        <type name="Image" restrictions="0">
            <field name="handle" restrictions="8"/>
            <method name="internal_dispose_GC" restrictions="8" signature="(JLorg/eclipse/swt/graphics/GCData;)V"/>
            <method name="internal_new_GC" restrictions="8" signature="(Lorg/eclipse/swt/graphics/GCData;)J"/>
            <field name="type" restrictions="8"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/graphics/Device;IJ)Lorg/eclipse/swt/graphics/Image;"/>
        </type>
        <type name="ImageData" restrictions="0">
            <method name="internal_new" restrictions="8" signature="(IIILorg/eclipse/swt/graphics/PaletteData;I[BI[B[BIIIIIII)Lorg/eclipse/swt/graphics/ImageData;"/>
        </type>
        <type name="Path" restrictions="0">
            <field name="handle" restrictions="8"/>
        </type>
        <type name="Pattern" restrictions="0">
            <field name="handle" restrictions="8"/>
        </type>
        <type name="Region" restrictions="0">
            <field name="handle" restrictions="8"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/graphics/Device;I)Lorg/eclipse/swt/graphics/Region;"/>
        </type>
        <type name="TextLayout" restrictions="0">
            <method name="setDefaultTabWidth" restrictions="8" signature="(I)V"/>
        </type>
        <type name="Transform" restrictions="0">
            <field name="handle" restrictions="8"/>
        </type>
    </package>
    <package name="org.eclipse.swt.ole.win32" visibility="1">
        <type name="OleClientSite" restrictions="0">
            <method name="&lt;init&gt;" restrictions="8" signature="(Lorg/eclipse/swt/widgets/Composite;ILjava/lang/String;Ljava/io/File;)V"/>
        </type>
        <type name="OleControlSite" restrictions="0">
            <method name="&lt;init&gt;" restrictions="8" signature="(Lorg/eclipse/swt/widgets/Composite;ILjava/lang/String;Ljava/io/File;)V"/>
        </type>
        <type name="Variant" restrictions="0">
            <method name="win32_copy" restrictions="8" signature="(JLorg/eclipse/swt/ole/win32/Variant;)V"/>
            <method name="win32_new" restrictions="8" signature="(J)Lorg/eclipse/swt/ole/win32/Variant;"/>
        </type>
    </package>
    <package name="org.eclipse.swt.printing" visibility="1">
        <type name="PrintDialog" restrictions="2"/>
        <type name="Printer" restrictions="0">
            <field name="handle" restrictions="8"/>
            <method name="internal_dispose_GC" restrictions="8" signature="(JLorg/eclipse/swt/graphics/GCData;)V"/>
            <method name="internal_new_GC" restrictions="8" signature="(Lorg/eclipse/swt/graphics/GCData;)J"/>
            <method name="isAutoScalable" restrictions="8" signature="()Z"/>
        </type>
    </package>
    <package name="org.eclipse.swt.widgets" visibility="1">
        <type name="Button" restrictions="2"/>
        <type name="Caret" restrictions="2"/>
        <type name="ColorDialog" restrictions="2"/>
        <type name="Combo" restrictions="2"/>
        <type name="Control" restrictions="2">
            <field name="handle" restrictions="8"/>
            <method name="internal_dispose_GC" restrictions="8" signature="(JLorg/eclipse/swt/graphics/GCData;)V"/>
            <method name="internal_new_GC" restrictions="8" signature="(Lorg/eclipse/swt/graphics/GCData;)J"/>
        </type>
        <type name="CoolBar" restrictions="2"/>
        <type name="CoolItem" restrictions="2"/>
        <type name="DateTime" restrictions="2"/>
        <type name="Decorations" restrictions="2"/>
        <type name="DirectoryDialog" restrictions="2"/>
        <type name="Display" restrictions="2">
            <method name="findWidget" restrictions="8" signature="(J)Lorg/eclipse/swt/widgets/Widget;"/>
            <method name="findWidget" restrictions="8" signature="(JJ)Lorg/eclipse/swt/widgets/Widget;"/>
            <method name="findWidget" restrictions="8" signature="(Lorg/eclipse/swt/widgets/Widget;J)Lorg/eclipse/swt/widgets/Widget;"/>
            <method name="internal_dispose_GC" restrictions="8" signature="(JLorg/eclipse/swt/graphics/GCData;)V"/>
            <method name="internal_new_GC" restrictions="8" signature="(Lorg/eclipse/swt/graphics/GCData;)J"/>
            <field name="msg" restrictions="8"/>
            <method name="sendPostExternalEventDispatchEvent" restrictions="8" signature="()V"/>
            <method name="sendPreExternalEventDispatchEvent" restrictions="8" signature="()V"/>
        </type>
        <type name="ExpandBar" restrictions="2"/>
        <type name="ExpandItem" restrictions="2"/>
        <type name="FileDialog" restrictions="2"/>
        <type name="FontDialog" restrictions="2"/>
        <type name="Group" restrictions="2"/>
        <type name="IME" restrictions="2"/>
        <type name="Label" restrictions="2"/>
        <type name="Link" restrictions="2"/>
        <type name="List" restrictions="2"/>
        <type name="Menu" restrictions="2">
            <field name="handle" restrictions="8"/>
        </type>
        <type name="MenuItem" restrictions="2"/>
        <type name="MessageBox" restrictions="2"/>
        <type name="ProgressBar" restrictions="2"/>
        <type name="Sash" restrictions="2"/>
        <type name="Scale" restrictions="2"/>
        <type name="ScrollBar" restrictions="2"/>
        <type name="Scrollable" restrictions="2"/>
        <type name="Shell" restrictions="2">
            <method name="internal_new" restrictions="8" signature="(Lorg/eclipse/swt/widgets/Display;J)Lorg/eclipse/swt/widgets/Shell;"/>
            <method name="win32_new" restrictions="8" signature="(Lorg/eclipse/swt/widgets/Display;J)Lorg/eclipse/swt/widgets/Shell;"/>
        </type>
        <type name="Slider" restrictions="2"/>
        <type name="Spinner" restrictions="2"/>
        <type name="TabFolder" restrictions="2"/>
        <type name="TabItem" restrictions="2"/>
        <type name="Table" restrictions="2"/>
        <type name="TableColumn" restrictions="2"/>
        <type name="TableItem" restrictions="2"/>
        <type name="TaskBar" restrictions="2"/>
        <type name="TaskItem" restrictions="2"/>
        <type name="Text" restrictions="2"/>
        <type name="ToolBar" restrictions="2"/>
        <type name="ToolItem" restrictions="2"/>
        <type name="ToolTip" restrictions="2"/>
        <type name="Tracker" restrictions="2"/>
        <type name="Tray" restrictions="2"/>
        <type name="TrayItem" restrictions="2"/>
        <type name="Tree" restrictions="2"/>
        <type name="TreeColumn" restrictions="2"/>
        <type name="TreeItem" restrictions="2">
            <field name="handle" restrictions="8"/>
        </type>
        <type name="TypedListener" restrictions="0">
            <method name="&lt;init&gt;" restrictions="8" signature="(Lorg/eclipse/swt/internal/SWTEventListener;)V"/>
            <method name="getEventListener" restrictions="8" signature="()Lorg/eclipse/swt/internal/SWTEventListener;"/>
            <method name="handleEvent" restrictions="8" signature="(Lorg/eclipse/swt/widgets/Event;)V"/>
        </type>
        <type name="Widget" restrictions="0">
            <method name="removeListener" restrictions="24" signature="(ILorg/eclipse/swt/internal/SWTEventListener;)V"/>
        </type>
    </package>
</component>

@iloveeclipse
Copy link
Member Author

iloveeclipse commented Mar 9, 2024

  • SDK-I20240202-1800 OK (org.eclipse.swt.win32.win32.x86_64_3.125.0.v20240201-1628.jar)
  • SDK-I20240209-1800 Bad (org.eclipse.swt.win32.win32.x86_64_3.125.0.v20240208-1757.jar)

The last good build is https://download.eclipse.org/eclipse/updates/4.31-I-builds/I20240207-0610/

@iloveeclipse
Copy link
Member Author

@laeubi : which tycho task creates .api_description files in jars?
Does it use something from PDE to create that file or it is fully implemented in tycho?

I guess whatever code created that file, it doesn't traverse right directories anymore, may be after 15d3065bc26e206eac005917adb3814b3dd497f7

@iloveeclipse
Copy link
Member Author

it should operate on the compiled classes

API descriptions need source code, as they include annotations info from javadoc

@laeubi
Copy link
Contributor

laeubi commented Mar 9, 2024

it gets a pointer to the project root and it gets a pointer to the compiled classes ... everything else is handled then by APIFileGenerator.

@iloveeclipse
Copy link
Member Author

I guess it is broken here and can't find source files anymore:

@laeubi
Copy link
Contributor

laeubi commented Mar 9, 2024

Looks like one should use <extraSourceLocations> here... what a mess.

@laeubi
Copy link
Contributor

laeubi commented Mar 9, 2024

I'll try to take a look, but actually it seems like an SWT issue then, is there already a ticket at SWT?

iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Mar 9, 2024
Added SWT API description files from last good 4.31 build I20240207-0610
https://download.eclipse.org/eclipse/updates/4.31-I-builds/I20240207-0610/plugins/

The files will be loaded instead of "empty" SWT API description files
shipped with 4.31 RC2 build (3.125.0.v20240227-1638).

Fixes eclipse-pde#1187
@iloveeclipse
Copy link
Member Author

With #1191 I see no API errors anymore in SWT (tested on Windows).

iloveeclipse added a commit that referenced this issue Mar 10, 2024
Added SWT API description files from last good 4.31 build I20240207-0610
https://download.eclipse.org/eclipse/updates/4.31-I-builds/I20240207-0610/plugins/

The files will be loaded instead of "empty" SWT API description files
shipped with 4.31 RC2 build (3.125.0.v20240227-1638).

Fixes #1187
@iloveeclipse iloveeclipse self-assigned this Mar 10, 2024
@iloveeclipse iloveeclipse added this to the 4.32 M1 milestone Mar 10, 2024
@iloveeclipse
Copy link
Member Author

Verified works also on Linux with I20240310-1800 (I've tested original patch on Windows).

iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Mar 11, 2024
Tycho/maven renames original bundles and replaces underscore with dash,
so let our "expected" 4.31 bundle file patches have everything with
dashes. That should work in IDE / on tycho build.

See eclipse-platform/eclipse.platform.swt#1011

See eclipse-pde#1187
iloveeclipse added a commit that referenced this issue Mar 11, 2024
Tycho/maven renames original bundles and replaces underscore with dash,
so let our "expected" 4.31 bundle file patches have everything with
dashes. That should work in IDE / on tycho build.

See eclipse-platform/eclipse.platform.swt#1011

See #1187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Regression defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants