Skip to content

Conversation

mdaniels5757
Copy link
Contributor

@mdaniels5757 mdaniels5757 commented Aug 16, 2025

Manual backport of #412903 #421276 #422675 #434105 (and two treewides) to release-25.05.

  • Before merging, ensure that this backport is acceptable for the release.
    • Even as a non-committer, if you find that it is not acceptable, leave a comment.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This report is automatically generated by the PR / Check / cherry-pick CI workflow.

Some of the commits in this PR require the author's and reviewer's attention.

Sometimes it is not possible to cherry-pick exactly the same patch.
This most frequently happens when resolving merge conflicts.
The range-diff will help to review the resolution of conflicts.

If you need to merge this PR despite the warnings, please dismiss this review shortly before merging.

Warning

Difference between ec3180d and original d72cbf5 may warrant inspection.

Show diff
@@ Metadata
  ## Commit message ##
     freecad: avoid duplicate wrapping
 
+    (cherry picked from commit d72cbf576f98d6756d08565166f9803ba28f0d59)
+
  ## pkgs/by-name/fr/freecad/package.nix ##
 @@
    nix-update-script,
@@ pkgs/by-name/fr/freecad/package.nix
 -    py-slvs
 -    pybind11
 -    pycollada
+-    pyside2
+-    pyside2-tools
 -    pyside6
 -    python
 -    pyyaml
 -    scipy
+-    shiboken2
 -    shiboken6
 -    ;
 +  pythonDeps =
@@ pkgs/by-name/fr/freecad/package.nix
 +      py-slvs
 +      pybind11
 +      pycollada
-+      pyside6
 +      python
 +      pyyaml # (at least for) PyrateWorkbench
 +      scipy
-+      shiboken6
 +    ]
 +    ++ lib.optionals ifcSupport [
 +      ifcopenshell
++    ]
++    ++ lib.optionals (qtVersion == 5) [
++      pyside2
++      pyside2-tools
++      shiboken2
++    ]
++    ++ lib.optionals (qtVersion == 6) [
++      pyside6
++      shiboken6
 +    ];
 +
    freecad-utils = callPackage ./freecad-utils.nix { };
  in
  freecad-utils.makeCustomizable (
 @@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
+       wrapGAppsHook3
+     ]
+     ++ lib.optionals (qtVersion == 5) [
+-      pyside2-tools
++      python3Packages.pyside2-tools
+       qt5.wrapQtAppsHook
+     ]
+     ++ lib.optionals (qtVersion == 6) [ qt6.wrapQtAppsHook ];
  
-     buildInputs =
-       [
+     buildInputs = [
 -      boost
        coin3d
        eigen
@@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
        vtk
        xercesc
        yaml-cpp
-         zlib
+@@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
+     ++ lib.optionals (qtVersion == 5) [
+       libsForQt5.soqt
+       opencascade-occt_7_6
+-      pyside2
+-      pyside2-tools
+-      shiboken2
+       qt5.qtbase
+       qt5.qttools
+       qt5.qtwayland
+@@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
+     ]
+     ++ lib.optionals (qtVersion == 6) [
        opencascade-occt
 -      pyside6
 -      shiboken6
@@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
 -      ifcopenshell
 -    ]
 +    ++ pythonDeps
-       ++ lib.optionals spaceNavSupport [ libspnav ];
- 
-     patches = [
+     ++ lib.optionals spaceNavSupport (
+       [ libspnav ] ++ lib.optionals (qtVersion == 5) [ libsForQt5.qtx11extras ]
+     );
 @@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
-       "-DFREECAD_USE_PYBIND11=ON"
+     ]
+     ++ lib.optionals (qtVersion == 5) [
+       "-DBUILD_QT5=ON"
+-      "-DSHIBOKEN_INCLUDE_DIR=${shiboken2}/include"
++      "-DSHIBOKEN_INCLUDE_DIR=${python3Packages.shiboken2}/include"
+       "-DSHIBOKEN_LIBRARY=Shiboken2::libshiboken"
+       (
+-        "-DPYSIDE_INCLUDE_DIR=${pyside2}/include"
+-        + ";${pyside2}/include/PySide2/QtCore"
+-        + ";${pyside2}/include/PySide2/QtWidgets"
+-        + ";${pyside2}/include/PySide2/QtGui"
++        "-DPYSIDE_INCLUDE_DIR=${python3Packages.pyside2}/include"
++        + ";${python3Packages.pyside2}/include/PySide2/QtCore"
++        + ";${python3Packages.pyside2}/include/PySide2/QtWidgets"
++        + ";${python3Packages.pyside2}/include/PySide2/QtGui"
+       )
+       "-DPYSIDE_LIBRARY=PySide2::pyside2"
+     ]
+     ++ lib.optionals (qtVersion == 6) [
        "-DBUILD_QT5=OFF"
        "-DBUILD_QT6=ON"
 -      "-DSHIBOKEN_INCLUDE_DIR=${shiboken6}/include"
@@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
        "--prefix PATH : ${libredwg}/bin"
 +      "--prefix PYTHONPATH : ${python3Packages.makePythonPath pythonDeps}"
 +      "\${gappsWrapperArgs[@]}"
-     ];
+     ]
+     ++ lib.optionals (!withWayland) [ "--set QT_QPA_PLATFORM xcb" ];
  
-     postFixup = ''

Warning

Difference between e4732a8 and original f772e38 may warrant inspection.

Show diff
@@ Commit message
     why it should be conditional to a flag that causes a
     from-source rebuild. It should just be always enabled.
 
+    (cherry picked from commit f772e38277b387b1e225987fb84ed61af38174b3)
+
  ## pkgs/by-name/fr/freecad/package.nix ##
 @@
    pkg-config,
    python3Packages,
    spaceNavSupport ? stdenv.hostPlatform.isLinux,
 -  ifcSupport ? false,
++  ifcSupport ? false, # Now a no-op, retained on 25.05 branch for backport compat.
    stdenv,
    swig,
    vtk,
-@@
-   nix-update-script,
- }:
- let
--  pythonDeps =
--    with python3Packages;
--    [
--      boost
--      gitpython # for addon manager
--      matplotlib
--      opencamlib
--      pivy
--      ply # for openSCAD file support
--      py-slvs
--      pybind11
--      pycollada
--      pyside6
--      python
--      pyyaml # (at least for) PyrateWorkbench
--      scipy
--      shiboken6
--    ]
+@@ pkgs/by-name/fr/freecad/package.nix: let
+     [
+       boost
+       gitpython # for addon manager
++      ifcopenshell
+       matplotlib
+       opencamlib
+       pivy
+@@ pkgs/by-name/fr/freecad/package.nix: let
+       pyyaml # (at least for) PyrateWorkbench
+       scipy
+     ]
 -    ++ lib.optionals ifcSupport [
 -      ifcopenshell
--    ];
-+  pythonDeps = with python3Packages; [
-+    boost
-+    gitpython # for addon manager
-+    ifcopenshell
-+    matplotlib
-+    opencamlib
-+    pivy
-+    ply # for openSCAD file support
-+    py-slvs
-+    pybind11
-+    pycollada
-+    pyside6
-+    python
-+    pyyaml # (at least for) PyrateWorkbench
-+    scipy
-+    shiboken6
-+  ];
- 
-   freecad-utils = callPackage ./freecad-utils.nix { };
- in
+-    ]
+     ++ lib.optionals (qtVersion == 5) [
+       pyside2
+       pyside2-tools
 
  ## pkgs/by-name/fr/freecad/tests/default.nix ##
 @@

Warning

Difference between 02e44a7 and original c7e08ed may warrant inspection.

Show diff
@@ Metadata
  ## Commit message ##
     freecad: enable gmsh integration
 
+    (cherry picked from commit c7e08edcf0761463a2d89a9688c96fc07cb30de4)
+
  ## pkgs/by-name/fr/freecad/package.nix ##
 @@
-   zlib,
+   qt5,
    qt6,
    nix-update-script,
 +  gmsh,
 +  which,
  }:
  let
-   pythonDeps = with python3Packages; [
+   pythonDeps =
 @@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
        })
      ];
@@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
 -      "--prefix PATH : ${libredwg}/bin"
 -      "--prefix PYTHONPATH : ${python3Packages.makePythonPath pythonDeps}"
 -      "\${gappsWrapperArgs[@]}"
--    ];
+-    ]
+-    ++ lib.optionals (!withWayland) [ "--set QT_QPA_PLATFORM xcb" ];
 +    qtWrapperArgs =
 +      let
 +        binPath = lib.makeBinPath [
@@ pkgs/by-name/fr/freecad/package.nix: freecad-utils.makeCustomizable (
 +        "--prefix PATH : ${binPath}"
 +        "--prefix PYTHONPATH : ${python3Packages.makePythonPath pythonDeps}"
 +        "\${gappsWrapperArgs[@]}"
-+      ];
++      ]
++      ++ lib.optionals (!withWayland) [ "--set QT_QPA_PLATFORM xcb" ];
  
      postFixup = ''
        mv $out/share/doc $out

Hint: The full diffs are also available in the runner logs with slightly better highlighting.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 4.workflow: backport This targets a stable branch labels Aug 16, 2025
@nix-owners nix-owners bot requested a review from LordGrimmauld August 16, 2025 22:08
@mdaniels5757 mdaniels5757 force-pushed the backport-434105-to-release-25.05 branch from e0e4999 to 7011468 Compare August 16, 2025 23:09
@mdaniels5757
Copy link
Contributor Author

Builds on aarch64-linux.

@nixpkgs-ci nixpkgs-ci bot removed the 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. label Aug 16, 2025
pbsds and others added 7 commits August 17, 2025 13:07
(cherry picked from commit 7139b50)
(cherry picked from commit d72cbf5)
(cherry picked from commit 51fb016)
closes NixOS#370121

follow-up to NixOS#330190

The BIM workspace depends on ifc, there is little reason
why it should be conditional to a flag that causes a
from-source rebuild. It should just be always enabled.

(cherry picked from commit f772e38)
@mdaniels5757 mdaniels5757 force-pushed the backport-434105-to-release-25.05 branch from 7011468 to e134cdb Compare August 17, 2025 17:10
@LordGrimmauld
Copy link
Contributor

LordGrimmauld commented Aug 22, 2025

regular freecad (qt5) build succeeded on ofborg. However, the "no pr check fails" job failed, so i'll be restarting the CI on this (meaning the successfull ofborg runs will disappear, so i am documenting those in a comment). I am building freecad-qt6 locally to see whether the wayland crash fix works correctly, and once that is done i'll merge.

Edit: never mind, ofborg is smart enough to not run again it seems? Nice.

@LordGrimmauld
Copy link
Contributor

Hmm, the qt6 package is giving me issues...
Log:

FreeCAD 1.0.1, Libs: 1.0.1RUnknown
(C) 2001-2025 FreeCAD contributors
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.

QOpenGLWidget is not supported on this platform.
QObject::disconnect: wildcard call disconnects from destroyed signal of QObject::139803890106688
QRhiGles2: Failed to create temporary context
QRhiGles2: Failed to create context
Failed to create QRhi for QBackingStoreRhiSupport
QOpenGLWidget: Failed to create context

It then just outright refuses to start. strace reveals its stuck indefinitely on ppoll and never actually gets anywhere. Not sure what is actually wrong here, but something isn't right yet.

@mdaniels5757
Copy link
Contributor Author

@LordGrimmauld Sorry, I hadn't tested with Wayland enabled. It looks like this was fixed in v1.0.2 (FreeCAD/FreeCAD#21903); could you please try again? It now launches for me with and without wayland on x86_64-linux (NixOS on WSL).

@LordGrimmauld
Copy link
Contributor

The formatter is complaining, but i'll run a build

@LordGrimmauld LordGrimmauld changed the title [Backport release-25.05] freecad: various fixes [Backport release-25.05] freecad: 1.0.1 -> 1.0.2, various fixes Aug 23, 2025
@LordGrimmauld
Copy link
Contributor

freecad-qt6 is still stalling indefinitely. The loading window opens, but the actual freecad never shows. It does work when forcing x11 via QT_QPA_PLATFORM=xcb though, not sure why wayland fails.

According to upstream, "Med Fichier can require MPI".
We do not have Med Fichier, so we can remove mpi.
If this causes issues, it should be reverted. However,
FEM still works, so this is probably fine.

(cherry picked from commit 7138517)
(cherry picked from commit c7e08ed)
@mdaniels5757 mdaniels5757 force-pushed the backport-434105-to-release-25.05 branch from ac61693 to 02e44a7 Compare August 23, 2025 16:40
@mdaniels5757
Copy link
Contributor Author

mdaniels5757 commented Aug 23, 2025

Fixed the lint; thanks for updating the PR title for me.

May I ask how exactly you are building (and which architecture you're on)? When I build with nix-build -A freecad-qt6 on x86_64-linux (NixOS on WSL), then run any of /nix/store/6jsjaadpr2695b5701r7fylmdwhjf2v1-freecad-1.0.2/bin/freecad, QT_QPA_PLATFORM=xcb /nix/store/6jsjaadpr2695b5701r7fylmdwhjf2v1-freecad-1.0.2/bin/freecad, or QT_QPA_PLATFORM=wayland /nix/store/6jsjaadpr2695b5701r7fylmdwhjf2v1-freecad-1.0.2/bin/freecad, it launches and opens a file perfectly for me.

Screenshot 2025-08-23 124810

@mdaniels5757
Copy link
Contributor Author

@LordGrimmauld: pbsds inquired about this in #434326 (comment), mind taking another look when you can?

@LordGrimmauld
Copy link
Contributor

Last i checked i had driver issues and the wayland version wouldn't launch on my unstable system. You tested on WSL it seems, but that too does weird driver things. I did not yet have the confidence in this not breaking for people, though the nix code itself does look fine. I was mostly waiting for a "real" 25.05 user with wayland to go and test this, but i suppose i can look into setting up a VM too. Shouldn't be that hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.workflow: backport This targets a stable branch 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants