Ticket #4343 - OPENSCAD not working with AppImage distros
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Ticket #4343 - OPENSCAD not working with AppImage distros
Hello to all, I would like to thanks all the FreeCAD community for the great work done.
I'm writing to issue a bug, I don't now if this is the right place to do it, in case forgive me, I searched a developer-appimage section without success. There is a bug in the AppImage distros, all of them (I tried 0.18 and all 0.19 until the 18694 release.
The error is due to the different Qt library versions between AppImage decompressed app and the system it are running in (openscad being an external command should use these last ones). I'm using Arch Linux to the last (today) update and openscad is linked to Qt_5.13 while the Appimage conatins QT_5.10 (not sure about this exact number.
To reproduce the error: launch AppImage => open an openscad file.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/hd/tmp/squashfs-root/usr/Mod/OpenSCAD/importCSG.py", line 78, in open
tmpfile=callopenscad(filename)
File "/home/hd/tmp/squashfs-root/usr/Mod/OpenSCAD/OpenSCADUtils.py", line 183, in callopenscad
check_output2([osfilename,'-o',outputfilename, inputfilename])
File "/home/hd/tmp/squashfs-root/usr/Mod/OpenSCAD/OpenSCADUtils.py", line 163, in check_output2
raise OpenSCADError('%s %s\n' % (stdoutd.strip(),stderrd.strip()))
<class 'OpenSCADUtils.OpenSCADError'>: " /usr/bin/openscad: /home/hd/tmp/squashfs-root/usr/lib/libQt5Core.so.5: version `Qt_5.13' not found (required by /usr/bin/openscad)\n/usr/bin/openscad: /home/hd/tmp/squashfs-root/usr/lib/libQt5Core.so.5: version `Qt_5.13' not found (required by /usr/lib/libqscintilla2_qt5.so.15)\n"
The fix is very simple to do and consists in changing the LD_LIBRARY_PATH env variable before launching the OpenSCAD external command, this is accomplished by the OpenSCADUtils.py. Please find the diff that makes the fix of OpenSCADUtils.py in the following lines.
Hopes the fix can be included in future releases of the AppImage in the meantime I'm using a patched version successfully.
Best regards to all,
Giuseppe
------------------ DIFF of OpenSCADUtils.py
134,135d133
< env = os.environ.copy()
< env['LD_LIBRARY_PATH'] = "/usr/lib/"
137c135
< stdout=subprocess.PIPE,stderr=subprocess.PIPE,universal_newlines=True, env=env)
---
> stdout=subprocess.PIPE,stderr=subprocess.PIPE,universal_newlines=True)
160,162c158
< env = os.environ.copy()
< env['LD_LIBRARY_PATH'] = "/usr/lib/"
< p=subprocess.Popen(*args,**kwargs,env=env)
---
> p=subprocess.Popen(*args,**kwargs)
I'm writing to issue a bug, I don't now if this is the right place to do it, in case forgive me, I searched a developer-appimage section without success. There is a bug in the AppImage distros, all of them (I tried 0.18 and all 0.19 until the 18694 release.
The error is due to the different Qt library versions between AppImage decompressed app and the system it are running in (openscad being an external command should use these last ones). I'm using Arch Linux to the last (today) update and openscad is linked to Qt_5.13 while the Appimage conatins QT_5.10 (not sure about this exact number.
To reproduce the error: launch AppImage => open an openscad file.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/hd/tmp/squashfs-root/usr/Mod/OpenSCAD/importCSG.py", line 78, in open
tmpfile=callopenscad(filename)
File "/home/hd/tmp/squashfs-root/usr/Mod/OpenSCAD/OpenSCADUtils.py", line 183, in callopenscad
check_output2([osfilename,'-o',outputfilename, inputfilename])
File "/home/hd/tmp/squashfs-root/usr/Mod/OpenSCAD/OpenSCADUtils.py", line 163, in check_output2
raise OpenSCADError('%s %s\n' % (stdoutd.strip(),stderrd.strip()))
<class 'OpenSCADUtils.OpenSCADError'>: " /usr/bin/openscad: /home/hd/tmp/squashfs-root/usr/lib/libQt5Core.so.5: version `Qt_5.13' not found (required by /usr/bin/openscad)\n/usr/bin/openscad: /home/hd/tmp/squashfs-root/usr/lib/libQt5Core.so.5: version `Qt_5.13' not found (required by /usr/lib/libqscintilla2_qt5.so.15)\n"
The fix is very simple to do and consists in changing the LD_LIBRARY_PATH env variable before launching the OpenSCAD external command, this is accomplished by the OpenSCADUtils.py. Please find the diff that makes the fix of OpenSCADUtils.py in the following lines.
Hopes the fix can be included in future releases of the AppImage in the meantime I'm using a patched version successfully.
Best regards to all,
Giuseppe
------------------ DIFF of OpenSCADUtils.py
134,135d133
< env = os.environ.copy()
< env['LD_LIBRARY_PATH'] = "/usr/lib/"
137c135
< stdout=subprocess.PIPE,stderr=subprocess.PIPE,universal_newlines=True, env=env)
---
> stdout=subprocess.PIPE,stderr=subprocess.PIPE,universal_newlines=True)
160,162c158
< env = os.environ.copy()
< env['LD_LIBRARY_PATH'] = "/usr/lib/"
< p=subprocess.Popen(*args,**kwargs,env=env)
---
> p=subprocess.Popen(*args,**kwargs)
Last edited by Kunda1 on Mon Dec 07, 2020 3:58 pm, edited 1 time in total.
Reason: Added ticket number to thread title
Reason: Added ticket number to thread title
Re: OPENSCAD not working with AppImage distros
What do you think?keithsloan52 wrote: ping
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: OPENSCAD not working with AppImage distros
Welcome gst0098
I ping our AppImage guru.
I ping our AppImage guru.
triplus wrote:ping
"fight the good fight"
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: OPENSCAD not working with AppImage distros
I see this as a Qt issue.
One has a Qt application invoking another Qt application, each built with a different level of Qt.
Need a Qt expert to pronoun on what is best way to handle. Seems Changing the Library referenced works, but is that the way it is supposed to be done?
One has a Qt application invoking another Qt application, each built with a different level of Qt.
Need a Qt expert to pronoun on what is best way to handle. Seems Changing the Library referenced works, but is that the way it is supposed to be done?
Re: OPENSCAD not working with AppImage distros
Bug still there on the last AppImage (18947), if possible in the mean time while a better and more elegant solution is found, fix at least with the given method, I confirm after months of use that it works well also after system upgrade.
Giuseppe
Giuseppe
Re: OPENSCAD not working with AppImage distros
Packaging openscad with conda and including it in the appimage might be one way to ensure compatibility.
Re: Ticket #4343 - OPENSCAD not working with AppImage distros
bump regarding issue #4343
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Ticket #4343 - OPENSCAD not working with AppImage distros
bumping again
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Ticket #4343 - OPENSCAD not working with AppImage distros
bumping. Anyone interested in creating an openscad conda recipe ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Ticket #4343 - OPENSCAD not working with AppImage distros
I've been doing some work on making OpenSCAD callable from FreeCAD even when one or the other app is sandboxed. Once there's an AppImage that includes the changes I've just made in git commit eb9f47048 I'll have a look into this. I'd like to find ways to allow FreeCAD to use whatever pre-existing OpenSCAD is installed on the system whenever possible.