Skip to content

python3Packages.build123d: init at 0.10.0#433247

Open
tnytown wants to merge 8 commits intoNixOS:masterfrom
tnytown:tnytown/build123d-0.9.1
Open

python3Packages.build123d: init at 0.10.0#433247
tnytown wants to merge 8 commits intoNixOS:masterfrom
tnytown:tnytown/build123d-0.9.1

Conversation

@tnytown
Copy link
Contributor

@tnytown tnytown commented Aug 13, 2025

Depends on #433252.
Fixes #245258.

Adds build123d and its dependencies: ocpsvg, cadquery-ocp, lib3mf, and trianglesolver. A lot of these were based on derivations originally in https://github.com/vinszent/cq-flake; although I had to make some fairly involved changes to compile the latest versions of build123d and cadquery-ocp.

Tagging @vinszent and @marcus7070 for visibility as you seem to be the most involved in creating and maintaining cq-flake :)

Happy to split any of these changes out into individual PRs if necessary!

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nix-owners nix-owners bot requested a review from natsukium August 13, 2025 00:59
@tnytown tnytown changed the title build123d: init at 0.9.1 python3Packages.build123d: init at 0.9.1 Aug 13, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 6.topic: python Python is a high-level, general-purpose programming language. 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` labels Aug 13, 2025
@nix-owners nix-owners bot requested a review from qbisi August 13, 2025 01:03
@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch from 4026045 to 162fd40 Compare August 13, 2025 01:13
@qbisi
Copy link
Contributor

qbisi commented Aug 13, 2025

Fixing the cyclic dependency of occt and vtk is a good point.
Please spilit the first two commits in a individiual pull request.

@tnytown
Copy link
Contributor Author

tnytown commented Aug 13, 2025

Fixing the cyclic dependency of occt and vtk is a good point.
Please spilit the first two commits in a individiual pull request.

Done in #433252 with requested changes :)

@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch from 8c619f0 to ff42ecd Compare August 13, 2025 02:01
@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch from 6487dfb to 329ac73 Compare August 13, 2025 04:59
@Sigmanificient Sigmanificient requested a review from qbisi August 13, 2025 05:02
@Sigmanificient
Copy link
Member

Diff lgtm, untested

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 13, 2025
@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch from 329ac73 to 7f6a6a7 Compare August 13, 2025 05:05
@tnytown
Copy link
Contributor Author

tnytown commented Aug 13, 2025

(Pushed because I realized I forgot a change in 29f3333dd114e0e084882a002ba223aa3e1bb1b6.) Running nixpkgs-review now, may take a few hours ...

@tnytown
Copy link
Contributor Author

tnytown commented Aug 13, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 433247
Commit: 7f6a6a7f8834163ddbf363525d745c45ec57f49d


x86_64-linux

❌ 17 packages failed to build:
  • ants
  • mrtrix
  • python312Packages.build123d
  • python312Packages.build123d.dist
  • python312Packages.cadquery-ocp
  • python312Packages.cadquery-ocp.dist
  • python312Packages.ocpsvg
  • python312Packages.ocpsvg.dist
  • python312Packages.pyotb
  • python312Packages.pyotb.dist
  • python313Packages.build123d
  • python313Packages.build123d.dist
  • python313Packages.cadquery-ocp
  • python313Packages.cadquery-ocp.dist
  • python313Packages.ocpsvg
  • python313Packages.ocpsvg.dist
  • rtabmap
✅ 205 packages built:
  • appcsxcad
  • c3d
  • cloudcompare
  • csxcad
  • elastix
  • elmerfem
  • exhibit
  • expliot
  • expliot.dist
  • ezminc
  • f3d
  • f3d.man
  • freecad
  • gdcm
  • intensity-normalization (python313Packages.intensity-normalization)
  • intensity-normalization.dist (python313Packages.intensity-normalization.dist)
  • itk (itk_5)
  • itk_5_2
  • libsForQt5.qcsxcad (plasma5Packages.qcsxcad)
  • libsForQt5.qcsxcad.dev (plasma5Packages.qcsxcad.dev)
  • mirtk
  • octavePackages.dicom
  • openems
  • otb
  • paraview
  • pcl
  • python312Packages.dcmstack
  • python312Packages.dcmstack.dist
  • python312Packages.deid
  • python312Packages.deid.dist
  • python312Packages.dicom-numpy
  • python312Packages.dicom-numpy.dist
  • python312Packages.dicom2nifti
  • python312Packages.dicom2nifti.dist
  • python312Packages.dicomweb-client
  • python312Packages.dicomweb-client.dist
  • python312Packages.dipy
  • python312Packages.dipy.dist
  • python312Packages.f3d
  • python312Packages.f3d.man
  • python312Packages.fast-simplification
  • python312Packages.fast-simplification.dist
  • python312Packages.fslpy
  • python312Packages.fslpy.dist
  • python312Packages.gdcm
  • python312Packages.gstools
  • python312Packages.gstools.dist
  • python312Packages.heudiconv
  • python312Packages.heudiconv.dist
  • python312Packages.highdicom
  • python312Packages.highdicom.dist
  • python312Packages.intensity-normalization
  • python312Packages.intensity-normalization.dist
  • python312Packages.itk
  • python312Packages.lib3mf
  • python312Packages.lib3mf.dist
  • python312Packages.mayavi
  • python312Packages.mayavi.dist
  • python312Packages.medpy
  • python312Packages.medpy.dist
  • python312Packages.medvol
  • python312Packages.medvol.dist
  • python312Packages.napari-nifti
  • python312Packages.napari-nifti.dist
  • python312Packages.nibabel
  • python312Packages.nibabel.dist
  • python312Packages.nilearn
  • python312Packages.nilearn.dist
  • python312Packages.nipy
  • python312Packages.nipy.dist
  • python312Packages.nipype
  • python312Packages.nipype.dist
  • python312Packages.nitime
  • python312Packages.nitime.dist
  • python312Packages.nitransforms
  • python312Packages.nitransforms.dist
  • python312Packages.niworkflows
  • python312Packages.niworkflows.dist
  • python312Packages.pybids
  • python312Packages.pybids.dist
  • python312Packages.pydicom
  • python312Packages.pydicom.dist
  • python312Packages.pykrige
  • python312Packages.pykrige.dist
  • python312Packages.pylibjpeg
  • python312Packages.pylibjpeg-openjpeg
  • python312Packages.pylibjpeg-openjpeg.dist
  • python312Packages.pylibjpeg.dist
  • python312Packages.pymatgen
  • python312Packages.pymatgen.dist
  • python312Packages.pymedio
  • python312Packages.pymedio.dist
  • python312Packages.pynetdicom
  • python312Packages.pynetdicom.dist
  • python312Packages.pyorthanc
  • python312Packages.pyorthanc.dist
  • python312Packages.pyradiomics
  • python312Packages.pyradiomics.dist
  • python312Packages.python-csxcad
  • python312Packages.python-csxcad.dist
  • python312Packages.python-openems
  • python312Packages.python-openems.dist
  • python312Packages.pyvista
  • python312Packages.pyvista.dist
  • python312Packages.sfepy
  • python312Packages.sfepy.dist
  • python312Packages.simpleitk
  • python312Packages.simpleitk.dist
  • python312Packages.sumo
  • python312Packages.sumo.dist
  • python312Packages.templateflow
  • python312Packages.templateflow.dist
  • python312Packages.torchio
  • python312Packages.torchio.dist
  • python312Packages.trianglesolver
  • python312Packages.trianglesolver.dist
  • python312Packages.trx-python
  • python312Packages.trx-python.dist
  • python312Packages.vtk
  • python312Packages.xnatpy
  • python312Packages.xnatpy.dist
  • python313Packages.dcmstack
  • python313Packages.dcmstack.dist
  • python313Packages.deid
  • python313Packages.deid.dist
  • python313Packages.dicom-numpy
  • python313Packages.dicom-numpy.dist
  • python313Packages.dicom2nifti
  • python313Packages.dicom2nifti.dist
  • python313Packages.dicomweb-client
  • python313Packages.dicomweb-client.dist
  • python313Packages.dipy
  • python313Packages.dipy.dist
  • python313Packages.f3d
  • python313Packages.f3d.man
  • python313Packages.fast-simplification
  • python313Packages.fast-simplification.dist
  • python313Packages.fslpy
  • python313Packages.fslpy.dist
  • python313Packages.gdcm
  • python313Packages.gstools
  • python313Packages.gstools.dist
  • python313Packages.highdicom
  • python313Packages.highdicom.dist
  • python313Packages.itk
  • python313Packages.lib3mf
  • python313Packages.lib3mf.dist
  • python313Packages.medpy
  • python313Packages.medpy.dist
  • python313Packages.medvol
  • python313Packages.medvol.dist
  • python313Packages.napari-nifti
  • python313Packages.napari-nifti.dist
  • python313Packages.nibabel
  • python313Packages.nibabel.dist
  • python313Packages.nilearn
  • python313Packages.nilearn.dist
  • python313Packages.nipy
  • python313Packages.nipy.dist
  • python313Packages.nitime
  • python313Packages.nitime.dist
  • python313Packages.nitransforms
  • python313Packages.nitransforms.dist
  • python313Packages.pybids
  • python313Packages.pybids.dist
  • python313Packages.pydicom
  • python313Packages.pydicom.dist
  • python313Packages.pykrige
  • python313Packages.pykrige.dist
  • python313Packages.pylibjpeg
  • python313Packages.pylibjpeg-openjpeg
  • python313Packages.pylibjpeg-openjpeg.dist
  • python313Packages.pylibjpeg.dist
  • python313Packages.pymedio
  • python313Packages.pymedio.dist
  • python313Packages.pynetdicom
  • python313Packages.pynetdicom.dist
  • python313Packages.pyorthanc
  • python313Packages.pyorthanc.dist
  • python313Packages.pyotb
  • python313Packages.pyotb.dist
  • python313Packages.pyradiomics
  • python313Packages.pyradiomics.dist
  • python313Packages.python-csxcad
  • python313Packages.python-csxcad.dist
  • python313Packages.pyvista
  • python313Packages.pyvista.dist
  • python313Packages.simpleitk
  • python313Packages.simpleitk.dist
  • python313Packages.templateflow
  • python313Packages.templateflow.dist
  • python313Packages.torchio
  • python313Packages.torchio.dist
  • python313Packages.trianglesolver
  • python313Packages.trianglesolver.dist
  • python313Packages.trx-python
  • python313Packages.trx-python.dist
  • vtk-full (python313Packages.vtk)
  • python313Packages.xnatpy
  • python313Packages.xnatpy.dist
  • simpleitk
  • therion
  • vtk (vtk_9_5)
  • vtkWithQt5
  • vtkWithQt6

Error logs: `x86_64-linux`
ants
warning: Skipping impure flag -mtune=native because NIX_ENFORCE_NO_NATIVE is set
warning: Skipping impure flag -mtune=native because NIX_ENFORCE_NO_NATIVE is set
warning: Skipping impure flag -mtune=native because NIX_ENFORCE_NO_NATIVE is set
warning: Skipping impure flag -mtune=native because NIX_ENFORCE_NO_NATIVE is set
warning: Skipping impure flag -mtune=native because NIX_ENFORCE_NO_NATIVE is set
warning: Skipping impure flag -mtune=native because NIX_ENFORCE_NO_NATIVE is set
In file included from /build/source/Examples/ImageMathHelper3D.cxx:1:
/build/source/Examples/ImageMath_Templates.hxx: In function 'int ants::ReplicateDisplacement(int, char**) [with unsigned int ImageDimension = 3]':
/build/source/Examples/ImageMath_Templates.hxx:10554:40: warning: 'vec.itk::Vector::itk::FixedArray.itk::FixedArray::m_InternalArray[3]' may be used uninitialized [8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wmaybe-uninitialized�-Wmaybe-uninitialized8;;�]
10554 |   typename VectorRImageType::PixelType vec;
      |                                        ^~~
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [Examples/CMakeFiles/antsUtilities.dir/build.make:261: Examples/CMakeFiles/antsUtilities.dir/ImageMathHelper3D.cxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[2]: *** [Examples/CMakeFiles/antsUtilities.dir/build.make:149: Examples/CMakeFiles/antsUtilities.dir/antsRegistration3DFloat.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:730: Examples/CMakeFiles/antsUtilities.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

@tnytown
Copy link
Contributor Author

tnytown commented Aug 13, 2025

Hmm, seems to be a spurious failure? Can't imagine that these changes caused that issue. Rerunning ...

@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch 4 times, most recently from 0abc09a to 532cf72 Compare August 14, 2025 05:08
@nix-owners nix-owners bot requested a review from amiloradovsky August 14, 2025 05:14
@qbisi
Copy link
Contributor

qbisi commented Sep 29, 2025

In fact, since cadquery-ocp vendors the headers of the OCCT version it's designed to build against, it's using the 7.9 interface with the 7.8 library.

Can we replace the cadquery vendered occt's headers with the nixpkgs's one c.f. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-ocp#n107

So we can use the cadquery-ocp 7.9 branch with fetching submodule pywrap, no more splited source.

@tnytown
Copy link
Contributor Author

tnytown commented Sep 29, 2025

In fact, since cadquery-ocp vendors the headers of the OCCT version it's designed to build against, it's using the 7.9 interface with the 7.8 library.

Can we replace the cadquery vendered occt's headers with the nixpkgs's one c.f. https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-ocp#n107

So we can use the cadquery-ocp 7.9 branch with fetching submodule pywrap, no more splited source.

Maybe? I think in that case we would have to investigate how the config in the new branch interacts with older headers. Then we need to do more work to validate that the build succeeds and doesn't produce undesirable side effects.

I'm of the opinion that the current pywrap situation is a long-term undesirable hack, but it does work. The only maintenance burden that would come with it, IMO, is when we bump to 7.9. At that point, we just drop the big CMakeLists.txt patch and the pywrap fetch. If you'd rather take a different approach, I think we should try your earlier suggestion of (1) packaging opencascade-occt_7_9; (2) packaging cadquery-ocp 7.9 with the minimal config patching necessary for the Darwin build; and (3) modifying build123d to accept cadquery-ocp 7.9 with pythonRelaxDeps.

@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch from 03a2d7a to b38f314 Compare September 29, 2025 14:43
Copy link
Contributor

@qbisi qbisi left a comment

Choose a reason for hiding this comment

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

Some file structure change suggestions.

Comment on lines +222 to +223
(lib.cmakeFeature "LLVM_DIR" "${lib.getDev libllvm}/lib/cmake/llvm")
(lib.cmakeFeature "Clang_DIR" "${lib.getDev libclang}/lib/cmake/clang")
Copy link
Contributor

@qbisi qbisi Sep 29, 2025

Choose a reason for hiding this comment

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

I dont know cross build. But put llvmPackages.{libclang,llvm} in buildInputs should be suffice to help cmake find the config module.

description = "Python wrapper for OCCT generated using pywrap";
homepage = "https://github.com/CadQuery/OCP";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ tnytown ];
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe add

broken = (lib.versions.majorMinor finalAttrs.version) != (lib.versions.majorMinor opencascade-occt');

to not block upgrade of opencascade-occt

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 26, 2026
@cjshearer cjshearer mentioned this pull request Feb 1, 2026
13 tasks
@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch 2 times, most recently from f277fea to 30415b8 Compare February 9, 2026 07:12
@nixpkgs-ci nixpkgs-ci bot added 8.has: package (new) This PR adds a new package 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. and removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Feb 9, 2026
@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch from 30415b8 to d20f134 Compare February 9, 2026 07:27
@tnytown tnytown force-pushed the tnytown/build123d-0.9.1 branch from d20f134 to a45624c Compare February 10, 2026 05:41
@tnytown
Copy link
Contributor Author

tnytown commented Feb 10, 2026

Took an initial stab at syncing cadquery-ocp and packaging 0.10.0. Some tests fail but weirdly they don't fail the build:

build123d> =========================== short test summary info ============================
build123d> FAILED tests/test_direct_api/test_face.py::TestFace::test_make_surface_patch - RuntimeError: Error building non-planar face with provided constraints
build123d> FAILED tests/test_direct_api/test_face.py::TestFace::test_make_surface_patch_error_checking - OCP.Standard.Standard_OutOfRange: NCollection_Sequence::ChangeValue
build123d> FAILED tests/test_persistence.py::TestPersistence::test_serialize_obj - TypeError: Read_s(): incompatible function arguments. The following argumen...
build123d> FAILED tests/test_persistence.py::TestPersistence::test_serialize_shape - TypeError: Read_s(): incompatible function arguments. The following argumen...
build123d> = 4 failed, 1318 passed, 1 skipped, 5 deselected, 5 xfailed, 2 xpassed, 4 warnings in 190.62s (0:03:10) =
build123d> Finished executing pytestCheckPhase
build123d> pytestCheckPhase completed in 3 minutes 12 seconds

@tnytown tnytown changed the title python3Packages.build123d: init at 0.9.1 python3Packages.build123d: init at 0.10.0 Feb 10, 2026
@qbisi
Copy link
Contributor

qbisi commented Feb 17, 2026

@tnytown Sorry for late review, I made a separate draft pr following the build logic of your work: #491280. You can take that draft pr as my advice for change. I prefer the latest 7.9.3.1 release cause we need not patch ocp.toml / pywrap, though ocp-7.9.3.1 is not yet compatible with build123d-0.10.0 or cq-editor.

I guess opencascade-occt 7.9.3 will have long term support (occt 8.0 is on the horizon so we will have both 7.9 and 8.0 for a long time). So it looks better we build cadquery-ocp based on occt 7.9.3. Further work needs to be done for cq-editor and build123d to valid the functionality of ocp-7.9.3 built on #491280.

@tnytown
Copy link
Contributor Author

tnytown commented Feb 18, 2026

@qbisi no worries on the delay, thanks for cleaning the work up!

I guess opencascade-occt 7.9.3 will have long term support (occt 8.0 is on the horizon so we will have both 7.9 and 8.0 for a long time). So it looks better we build cadquery-ocp based on occt 7.9.3. Further work needs to be done for cq-editor and build123d to valid the functionality of ocp-7.9.3 built on #491280.

In this case, would you like to wait for official occt 7.9.3 support in build123d before we continue? I'm honestly not too enthused about the prospect of tracking down regressions with 7.9.3 given that we're already having weird issues with the test suite in 7.8.1.

@tnytown
Copy link
Contributor Author

tnytown commented Feb 18, 2026

I just took a look and the latest (untagged) revision targets OCP 7.9! https://github.com/gumyr/build123d/blob/cb155f79d18f8247eb8e951617d0a3056be0ceec/pyproject.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package request: build123d

3 participants