FreeCAD / FreeCAD-Bundle

Stand-alone repo to Build and Deploy installable FreeCAD images. Do not open general FreeCAD issues here.
https://freecad.org
GNU Lesser General Public License v2.1
332 stars 65 forks source link

Issue with Freecad weekly `.AppImage` (black startscreen) #97

Closed leoheck closed 2 years ago

leoheck commented 2 years ago

Black Start page image

OS: Ubuntu Jammy Jellyfish (development branch) (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.27936 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 66f3474)
Hash: 66f34746c8e8e2b18f308d705b6a98d9d6942791
Python 3.9.10, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * A2plus 0.4.54b
  * fasteners 0.3.38
  * Assembly4 0.11.10
  * kicadStepUpMod 10.11.1
  * ExplodedAssembly
luzpaz commented 2 years ago

There is no 'daily' appimage. Do you mean weekly? About info

luzpaz commented 2 years ago

@looooo I can reproduce this on the latest weekly Appimage

OS: Manjaro Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28193 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 9c16923)
Hash: 9c1692336740c3bc7fa0c4d430ad5ceea223384f
Python 3.9.10, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: C/Default (C)
Installed mods: 
  * A2plus 0.4.54b
luzpaz commented 2 years ago

We need more conda packagers looking at this.

KenwoodFox commented 2 years ago

Also thanks for the material, im coming from another issue with a glider dependency breaking a while ago. I can confirm this issue is still present, tested on latest Arch, Manjaro and KDE Neon (ubuntu)

leoheck commented 2 years ago

I can change my pr or make a new one with this one. Then we can use it for some time to see how it feels.

luzpaz commented 2 years ago

Looks like the StartWB isn't even loading correctly. I don't see it's toolbar either. Weird thing is that I don't see any errors

OS: Manjaro Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.28567 (Git) AppImage
Build type: Release
Branch: (HEAD detached at eb65256)
Hash: eb652569c1bc905b9ece89598ce99e2a2549acae
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * A2plus 0.4.55a
luzpaz commented 2 years ago

StartWB relevant thread: https://forum.freecadweb.org/viewtopic.php?p=584953#p584953

Edit: QtWebEngine failing to load

chennes commented 2 years ago

This looks like three different bug reports: can we split it?

onekk commented 2 years ago

From

https://forum.freecadweb.org/viewtopic.php?p=585485#p585485

adding:

export QTWEBENGINE_DISABLE_SANDBOX=1

to FC launching scripts (that I use)

Seems to solve the problem.

further investigation seems to lead to:

https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1939993

I don't know if it is relevant.

Regards

Carlo D.

luzpaz commented 2 years ago

How does one add entries in to AppRun? Does that happen here: https://github.com/FreeCAD/FreeCAD-Bundle/blob/master/conda/linux/create_bundle.sh#L85-L89

Someone in the forum thread mentioned: Screenshot_20220402_152420

luzpaz commented 2 years ago

Workaround:
Invoke AppImage from the terminal like this:
QTWEBENGINE_DISABLE_SANDBOX=1 ./FreeCAD_weekly-builds-28567-Linux-Conda_glibc2.12-x86_64.AppImage

onekk commented 2 years ago

see maybe:

https://forum.freecadweb.org/viewtopic.php?p=585715#p585715

For other type of solution.

Regards

Carlo D.

luzpaz commented 2 years ago

This is fixed in 7d89de1c4d265ef8b5ccad72672815133a55c913 thanks to @onekk and @looooo and others. Closing ticket

luzpaz commented 2 years ago

@looooo can you generate new appimage build to incorporate 7d89de1c4d265ef8b5ccad72672815133a55c913

onekk commented 2 years ago

Hello, unrelated thing, but miniconda environment is not updated incorporating this patch to the more "general problem" of "Blank (Black) Start Page" on some Systems.

Not a critics, only to note the disalignment between packaging system (AppImage, miniconda, FlatPack ....)

why not make this modification to "stock source tree" that will make things work despite the "Packaging system":

in file:

.../miniconda3/envs/fcenv-dev/Mod/Start/Init.py (This is the location of the miniconda install, I know :-D)

I've inserted these lines:

import os
os.environ["QTWEBENGINE_DISABLE_SANDBOX"] = "1"

And all it's working.

Regards

looooo commented 2 years ago

@luzpaz I guess the appimage should be updated. But haven't tested. @onekk where should we apply these changes? freecad-source? patching via the freecad-feedstock?

luzpaz commented 2 years ago

@looooo the fix worked in the appimage for me. So it looks like https://github.com/FreeCAD/FreeCAD-Bundle/commit/7d89de1c4d265ef8b5ccad72672815133a55c913 worked.
Note: there is a secondary issue that has popped us since, see #102

onekk commented 2 years ago

The code has to be applied to the stock freecad sources so it is loaded when Start page is invoked, and will be integrated in all the "packaging system" solution for AppImage patch the AppRun environment only, good thing, but other "packaging system" are not patched so as example my miniconda install was broken when updating the miniconda as it has overwritten my "workaround lines" in /mod/Start/Init.py.

The workaround should be used only in FC as Init.py is modifying only the sys.environment of the running FreeCAD I think, at least in an AppImage or in a miniconda install that is not very far from an AppImage in workings as it appears that an AppImage use a "sort of" miniconda environment internally.

102 seems related to some problem with Xorg but Xorg is external to the AppImage, or maybe FC is asking for some OpenGL things that the driver is not supplying, (a rough guess), some other programs, has a "OpenGL" version settings, that could address problems if the OS distribution use an old OpenGL but as usual, I don't know in deep things, about miniconda and AppImage workings.

I suppose that libc++ and Xorg are managed by the "OS Distribution" and miniconda and AppImages use the "OS services", in this case it seems strange that FC is asking for a precise place where libraries are residing, as different distributions have different places where libraries are put.

Debian Ubuntu is known to have different places, at least in the past, now it seems more "standardized", probably diue to the SystemD adoption, but in past some libraries that other distributions placed in /usr/lib or in /usr/share/lib are found in /usr/lib64 or /usr/chare/lib64, I have had some program that need some symlinks as when running on Debian they won't find libraries and fails (notably was a proprietary driver for a printer), then driver suppliers have done a complex installation script that take in account these differences.

But probably here this discussion is rather OT, sorry.

Regards.

Carlo D.

looooo commented 2 years ago

@onekk I added a patch to the freecad-feedstock. https://github.com/looooo/freecad-feedstock/blob/master/recipe/qtwebengine_disable_sandbox.patch

If you think this patch needs to be applied to the freecad source please discuss this via an separate issue or in the forum.

onekk commented 2 years ago

@looooo (hope the number o o is correct :-D)

I think that this patch should be made "upstream" i.e directly in FC sources, pleas on what forum I have to discuss it?

Regards

Carlo D.