Multiple versions of freecad in one system (bug or feature)

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
looo
Veteran
Posts: 3903
Joined: Mon Nov 11, 2013 5:29 pm

Multiple versions of freecad in one system (bug or feature)

Post by looo »

I would like to finally find an answer to this question because it has impact on quite a lot of things.
If we treat freecad as an executable there is no problem with having multiple versions in the same system (daily, 0.18, 0.17). But if we treat freecad as a library this is definitely a bug, because dependencies cannot rely on a solid interface and must use workaround to get freecad imported.

So it would be interesting to know which linux distros allow the installation of multiple freecad packages. And I don't mean bundles which are somehow seperated from the system (like appimage, snaps, ...) Is it only debian/ubuntu or are there also other distros? And if there is any workaround for this problem? For example creating an abstraction layer which is only available in one package (eg. In the stable package provided by the system)

Here is one comment which says multiple versions are not supported: https://askubuntu.com/questions/758502/ ... tem#758503

And I guess by design it shouldn't be supported, because in the end (if a Programm has reached stability) there is no need for multiple versions.

Another inconsistency is the name of the the executable. By default it's FreeCAD. In Ubuntu it's freecad. Is there a convention to use lowercase?
openBrain
Veteran
Posts: 8996
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Multiple versions of freecad in one system (bug or feature)

Post by openBrain »

Here I have Python 2 & Python 3 installed simultaneously. As well as Qt4 & Qt5. ;)
So multiple versions of FC seem OK to me.
However (as Python & QT do) maybe the bin/lib should be strongly identified with a version number.

Regarding the second point, AFAIK all GNU tools are lowercase so probably it became a de facto standard.
User avatar
looo
Veteran
Posts: 3903
Joined: Mon Nov 11, 2013 5:29 pm

Re: Multiple versions of freecad in one system (bug or feature)

Post by looo »

openBrain wrote: Sat Nov 09, 2019 9:26 am Here I have Python 2 & Python 3 installed simultaneously. As well as Qt4 & Qt5.
So multiple versions of FC seem OK to me.
However (as Python & QT do) maybe the bin/lib should be strongly identified with a version number.
Now consider the python binding of qt. This will give you 8 different libraries (pyside2, pyqt). It worked somehow, but I would not call it a good solution.
And we are now seeing the good times with py3 as py2 will be deprecated soon.
openBrain wrote: Sat Nov 09, 2019 9:26 am Regarding the second point, AFAIK all GNU tools are lowercase so probably it became a de facto standard.
@wmayer is there any reason for the executable to be uppercase by default?
openBrain
Veteran
Posts: 8996
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Multiple versions of freecad in one system (bug or feature)

Post by openBrain »

looo wrote: Sat Nov 09, 2019 10:08 am
openBrain wrote: Sat Nov 09, 2019 9:26 am Here I have Python 2 & Python 3 installed simultaneously. As well as Qt4 & Qt5.
So multiple versions of FC seem OK to me.
However (as Python & QT do) maybe the bin/lib should be strongly identified with a version number.
That wasn't exactly the sense of it. I'd say that I have applications that run eg. Qt4 & others Qt5, and both lives correctly aside the other. ;) So why not FC couldn't do the same ?
User avatar
looo
Veteran
Posts: 3903
Joined: Mon Nov 11, 2013 5:29 pm

Re: Multiple versions of freecad in one system (bug or feature)

Post by looo »

openBrain wrote: Sat Nov 09, 2019 11:30 am That wasn't exactly the sense of it. I'd say that I have applications that run eg. Qt4 & others Qt5, and both lives correctly aside the other. ;) So why not FC couldn't do the same ?
Ok if we support multiple versions of FreeCAD this is how a FreeCAD interface looks like:
https://github.com/dcowden/cadquery/blo ... py#L57L145

note these lines:
# Make some dangerous assumptions...
# Try all the usual suspects
What we want is to depend on FreeCAD via python with:

Code: Select all

import freecad
and this is not possible if we can install multiple FreeCAD-versions for one python version. I think there is a compromise solution for allowing both (multiple FreeCAD-versions + easy imports). This is: only one FreeCAD version can be imported from python directly. So "import freecad" must refer to the stable library of FreeCAD. This restriction then asserts that there is only one stable version of FreeCAD installable on a system. I guess this is something we can rely on. Or are there systems where FreeCAD 0.17 is living next to FreeCAD 0.18?

So, can we rely on the rule:
There is only one official FreeCAD-version in every system.

Btw. qt4 / qt5 , py2 / py3 is something else, because this are majo changes of the libraries and this seperation is done by seperating the namespaces...
User avatar
kkremitzki
Veteran
Posts: 2422
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Multiple versions of freecad in one system (bug or feature)

Post by kkremitzki »

I am pretty sure the all-lowercase binaries thing is somewhere in the Debian Policy but a quick search couldn't find it just now. I ran into the same thing trying to reintroduce OCCT 7 with its DRAWEXE.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
looo
Veteran
Posts: 3903
Joined: Mon Nov 11, 2013 5:29 pm

Re: Multiple versions of freecad in one system (bug or feature)

Post by looo »

kkremitzki wrote: Sat Nov 09, 2019 3:22 pm I am pretty sure the all-lowercase binaries thing is somewhere in the Debian Policy but a quick search couldn't find it just now. I ran into the same thing trying to reintroduce OCCT 7 with its DRAWEXE.
thanks, so this is policy to create consistency for debian and create inconsistency for different distros/platforms . Sometime aiming for consistency leads to inconsistency. ;)

Anyway @kkremitzky can you confirm if this assumption for debian/ubuntu:
There is only one official FreeCAD-version in every system.
where official FreeCAD-version means the version installable via official package-sources.
Post Reply