FreeCAD icon indicating copy to clipboard operation
FreeCAD copied to clipboard

Docs: Add IfcOpenShell to ThirdPartyLibraries

Open luzpaz opened this issue 8 months ago • 1 comments

Closes #18650

This PR is still incomplete. It's missing a way to report the IfcOpenShell version and correcting whitespace uniformity.

luzpaz avatar May 08 '25 12:05 luzpaz

Anybody available to advise how to check ifcopenshell version info ?

luzpaz avatar May 10 '25 17:05 luzpaz

@luzpaz Like inside FC?

Open Python Console, run:

>>> import ifcopenshell
>>> ifcopenshell
>>> ifcopenshell.version
>>>

For me, after ifcopenshell.version it prints out: '0.8.1.post1'

tetektoza avatar May 11 '25 16:05 tetektoza

@tetektoza thanks, I'm aware of this but the issue is there is a delay when opening ifcopenshell per @oursland's observations in

  • https://github.com/FreeCAD/FreeCAD/issues/20837#issuecomment-2856750487

So i wonder if there is anyway around that? Maybe if ifcopenshell isn't loaded then we shouldn't load it and not show a version ? Thoughts?

luzpaz avatar May 11 '25 16:05 luzpaz

Hi @oursland, what's your opinion on this given #20837 ?

luzpaz avatar May 15 '25 22:05 luzpaz

@luzpaz All installed packages are included on the weekly releases and tagged releases in the file packages.txt (FreeCAD.app/Contents/packages.txt on macOS). This could be parsed to determine the version of ifcopenshell.

Alternatively, assuming that ifcopenshell is available at compile time and does not change, we can extract the version in CMake and place it in a #define within Version.h. This wouldn't capture updates that may take place after compilation, but this could be a compile time option used only for fixed-ifcopenshell releases.

oursland avatar May 16 '25 02:05 oursland

@hyarion could you weigh in ?

luzpaz avatar May 27 '25 12:05 luzpaz

ifcopenshell is LGPL3, not LGPL2.1+ so including it would probably not be a good idea. My understanding is that FreeCAD would have to be distributed as LGPL3.0/GPL3.0 if we include it.

We could improve the error message and create an addon that makes it easy to install latest ifcopenshell (would just be an empty package that tells FC to install it through pip)

hyarion avatar May 27 '25 13:05 hyarion

fcopenshell is LGPL3, not LGPL2.1+ so including it would probably not be a good idea. My understanding is that FreeCAD would have to be distributed as LGPL3.0/GPL3.0 if we include it.

We could improve the error message and create an addon that makes it easy to install latest ifcopenshell (would just be an empty package that tells FC to install it through pip)

That is a whole separate plot twist. If that's true then the discussion needs to be reexamined. I'm not sure the BIM folk are aware of that.

luzpaz avatar May 27 '25 13:05 luzpaz

That is a whole separate plot twist. If that's true then the discussion needs to be reexamined. I'm not sure the BIM folk are aware of that.

I think this is the reason why the library isn't included in the first place?

hyarion avatar May 27 '25 13:05 hyarion

It is included (more exactly, distributed if that makes a difference) in the snap builds, and I believe in the weekly Appimages as well.

The snap build fetches the ifcopenshell package from PyPI, installs it in the staging area during the build, it and bundles it with the resulting .snap package.

Quoting https://wiki.freecad.org/IfcOpenShell:

For Windows and MacOS systems, FreeCAD distributions put together with the Conda package manager usually include IfcOpenShell already so no further installation is necessary. Get the appropriate distribution from the Download page.

The AppImage for Linux is also based on Conda, and it also includes IfcOpenShell.

furgo16 avatar May 27 '25 17:05 furgo16

We can remove them from future releases if there is a license-related concern.

oursland avatar May 27 '25 19:05 oursland

I think we first have to establish whether there is a license incompatibility issue or not. Was there any research done back when ifcopenshell was included in the Conda builds? I did not do any additional research for the snap package inclusion, as I didn't even think it would be an issue. But my own ignorance is not an excuse :-)

@hyarion can you ellaborate on you concern?

furgo16 avatar May 27 '25 19:05 furgo16

No, I did not investigate license concerns when I included it into the builds. Given this is a fully open source project, it seemed like a non-issue. I am still unconvinced there is an issue, but in the case that there is a concern the fix is fairly straightforward.

oursland avatar May 27 '25 20:05 oursland

To my understanding we cannot distribute freecad under lgpl2.1+ if we have lgpl3 code or hard dependencies in the project. We can distribute it under lgpl3 though (or even gpl3), even if we keep the source code as lgpl2.1+.

I'm not a lawyer but I've never seen anything that indicates that this would not be the case.

The most simple solution would be to distribute the build binaries as lgpl3.

hyarion avatar May 27 '25 21:05 hyarion

Thank you. I'm not an expert, so I have more questions than answers:

if we have lgpl3 code

But we don't, do we? The FreeCAD repo does not have any portion of the ifcopenshell code. We fetch ifcopenshell as an external component and we bundle it in the binary package.

or hard dependencies in the project.

Would ifcopenshell constitute a hard dependency? FreeCAD does not require ifcopenshell to build. We are only using its Python API bindings by the BIM workbench at runtime, if that makes a difference.

furgo16 avatar May 27 '25 22:05 furgo16

Indeed I hadn't thought about that... (There might have been a relicensing somewhere... I didn't remember IfcOpenShell was LGPL3). In any case I believe @hyarion is right. We can provide LGPL3 libs together with FreeCAD (The LGPL2.1 license of FreeCAD allows that.), but then the provided bundle becomes LGPL3.

I don't think this is fundamentally a problem. We have taken good care in the last years to remove anything like pure GPL2 code that would prevent this kind of "automatic" relicensing. But, this needs to be agreed upon by the FreeCAD devs, and correctly documented and informed to the public.

I would say this is a good opportunity to assess the whole thing better, and make a list of everything we bundle together with FreeCAD, not in the source code but in the packages, and check for the licenses.

Let's debate this point at next devs meeting? I'll add to the agenda at https://github.com/FreeCAD/FreeCAD-developer-meetings/blob/main/Agendas/agenda-2025-06-01.md

yorikvanhavre avatar May 28 '25 09:05 yorikvanhavre

I've dived deeper into the rabbit hole of license LGPL licenses and I was wrong at this specific case.

I found a nice compatibility matrix over at GNU, which states: I want to license my code under LGPLv2.1 or later and I want to use a library under LGPLv3 is OK

This is contrary to: I want to license my code under LGPLv2.1 or later and I want to copy code under LGPLv3 is OK: Combination is under LGPLv3 with footnote If you have the ability to release the project under LGPLv2.1 or any later version, you can choose to release it under LGPLv3 or any later version—and once you do that, you'll be able to incorporate the code released under LGPLv3

The above only covers using LGPL3 in LGPL2.1, how this relates to combing LGPL2.1 with other (non-gnu) licenses is a bit of a gray area.

Sorry for the noise

hyarion avatar May 28 '25 10:05 hyarion

Sorry for the noise

Not at all, glad we've had the discussion. Thanks!

furgo16 avatar May 28 '25 10:05 furgo16

Thanks for checking on that, @hyarion.

A proper SBOM should be added to automate compliance checks. I have created issue https://github.com/FreeCAD/FreeCAD/issues/21626 to track this.

oursland avatar May 28 '25 14:05 oursland

We still haven't mentioned IfcOpenShell in ThirdPartyLibraries... is that problematic at all from a licensure POV ?

luzpaz avatar Jul 15 '25 01:07 luzpaz

We still haven't mentioned IfcOpenShell in ThirdPartyLibraries... is that problematic at all from a licensure POV ?

The current understanding is that this is not an issue.

hyarion avatar Jul 15 '25 07:07 hyarion

Should I close this PR then and link #18650 to #21626 ?

luzpaz avatar Jul 15 '25 13:07 luzpaz