Closed Bug 1663588 Opened 4 years ago Closed 4 years ago

Do not build NPAPI on Linux platform

Categories

(Core Graveyard :: Plug-ins, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: okias, Unassigned)

References

()

Details

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0

Steps to reproduce:

Placeholder for patches to drop flash support - NPAPI for Linux platform.

Goal of these patches is remove dependency on old GTK2 libraries required to build Firefox.

Attached patch GTK2_drop.patch (obsolete) — Splinter Review

from some weird reason this patch fails at:

 0:18.06 In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/bits/stl_algobase.h:60,
 0:18.07                  from /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/bits/specfun.h:45,
 0:18.07                  from /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/cmath:1927,
 0:18.08                  from /var/tmp/notmpfs/portage/www-client/firefox-80.0.1-r1/work/firefox-80.0.1/ff/dist/system_wrappers/cmath:3,
 0:18.08                  from /var/tmp/notmpfs/portage/www-client/firefox-80.0.1-r1/work/firefox-80.0.1/ff/dist/stl_wrappers/cmath:52,
 0:18.08                  from /var/tmp/notmpfs/portage/www-client/firefox-80.0.1-r1/work/firefox-80.0.1/ff/dist/include/mozilla/MathAlgorithms.h:14,
 0:18.09                  from /var/tmp/notmpfs/portage/www-client/firefox-80.0.1-r1/work/firefox-80.0.1/gfx/gl/GLContextProviderGLX.cpp:17:
 0:18.09 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/bits/functexcept.h:48:3: error: conflicting declaration of 'void std::__throw_bad_exception()' with 'C++' linkage
 0:18.09    48 |   __throw_bad_exception(void) __attribute__((__noreturn__));
 0:18.09       |   ^~~~~~~~~~~~~~~~~~~~~

but hopefully I'll solve it soon.

This patch is just mashup to measure if it's worth to not build NPAPI for Linux. If it gives improvement in loading time or build-size, I'd go for temporarily adding build option or just maintain patch until NPAPI gets dropped.

Hi,

I will move this over to a component so developers can take a look over it. If is not the correct component please feel free to change it to an appropriate one.

Thanks for the enhancement suggestion.

Best regards, Clara.

Component: Untriaged → Plug-ins
Product: Firefox → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true

Using David's patch as a base I have succeeded in building Firefox without GTK+2 present. My additional changes are a little sloppy in places (breaks support for macOS likely, among other things) but I'll be cleaning it up over the net week or so. My goal was to get this working first.

https://raw.githubusercontent.com/dylanaraps/wayland-experiment/master/extra/firefox/patches/no-gtk2.patch

The patch has been redone to target Firefox 81.0bX and works fine under Wayland but is untested with X11. To fix the aforementioned error above I had to (most likely) break support for X11 by removing some if blocks (see gfx/gl/GLContextProviderWayland.cpp) and a few includes of gdk/gdk.h. Again, I'll be cleaning this up. This seems to have been required to remove the conflicting declarations, any insight is appreciated.

If the change is desirable upstream, I'm happy to submit this through proper channels. If David would like to continue working on this I'm also happy to end things with this comment and hope that at the very least my modifications save you some time. My overall goal is a system based on Wayland but without any X11 present. This is more or less a step in this direction.

Did some more testing and can confirm that the above patch (in its current state) works just fine in an environment with only X11 (no Wayland at all). It builds and runs without issue.

Blocks: 1377445
No longer blocks: remove-plugin-support

(In reply to dylan.araps from comment #4)

Using David's patch as a base I have succeeded in building Firefox without GTK+2 present. My additional changes are a little sloppy in places (breaks support for macOS likely, among other things) but I'll be cleaning it up over the net week or so. My goal was to get this working first.

https://raw.githubusercontent.com/dylanaraps/wayland-experiment/master/extra/firefox/patches/no-gtk2.patch

The patch has been redone to target Firefox 81.0bX and works fine under Wayland but is untested with X11. To fix the aforementioned error above I had to (most likely) break support for X11 by removing some if blocks (see gfx/gl/GLContextProviderWayland.cpp) and a few includes of gdk/gdk.h. Again, I'll be cleaning this up. This seems to have been required to remove the conflicting declarations, any insight is appreciated.

If the change is desirable upstream, I'm happy to submit this through proper channels. If David would like to continue working on this I'm also happy to end things with this comment and hope that at the very least my modifications save you some time. My overall goal is a system based on Wayland but without any X11 present. This is more or less a step in this direction.

Wow, thank you for feedback. I gave up (since my coding skills are very limited), but if you plan to work on this further, I'm really happy!

Attachment #9174323 - Attachment is obsolete: true

Also here are some other patches which being slowly upstreamed into Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1661450

(In reply to David Heidelberg [:okias] from comment #2)

This patch is just mashup to measure if it's worth to not build NPAPI for Linux. If it gives improvement in loading time or build-size, I'd go for temporarily adding build option or just maintain patch until NPAPI gets dropped.

Is this still relevant? Isn't NPAPI only depending on Flash which will no longer be supported on firefox version > 84?
https://blog.mozilla.org/futurereleases/2020/11/17/ending-firefox-support-for-flash/

The underlying codebase will currently quickly changes, because plugins got disabled and some parts being removed. Nonetheless reviewing and sending patches which will #ifdef or remove unused stuff will be hopefully appreciated (also in small chunks, so this patch will likely not possible to merge).

I recommend to watch meta [1] for plugin removal and if possible to contribute :)

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1455897

This series of patches seems to do work of this giant patch step by step, I recommend to follow this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1682030

Was trying to contribute but 1682030 really covers most of this bug AFAICT. Then it's just the disable gtk2 in mozgtk which is already in the patch above. After that, I guess we could kill mozgtk?

I suppose this can be closed, especially after bug 1682030 landed?

I assume it can! Thanks to everyone involved.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: