Commit Graph

22746 Commits

Author SHA1 Message Date
Andrej730 0da17c6515 build-deps: manifold to support co-existing Release/Debug builds 2026-09-11 19:12:01 +05:00
Andrej730 81df7982bc build-deps: --reuse-boost to support co-existing Release/Debug builds 2026-09-11 19:12:01 +05:00
Andrej730 c3b1c49157 ci: test building with manifold
As it's part of the default build in build-all.py.
2026-09-11 19:12:01 +05:00
Andrej730 7f9423daa6 build-deps.py: shortcut for getting active toolset 2026-09-11 19:12:01 +05:00
Andrej730 fb0a826ac9 build-deps.py: add kw args
So now user doesn't have to provide positional args they don't need if they're fine with the defaults - e.g. `python build-deps.py --build-cfg Debug`.
2026-09-11 19:12:01 +05:00
Andrej730 3be454447f build-deps.py: rename build_type_cfg to build_cfg (more concise) 2026-09-11 19:12:01 +05:00
Andrej730 8b571913ed api.h: format consistently for readibility 2026-09-11 19:12:01 +05:00
Thomas Krijnen 148ff02859 Fix to_string() on eof marker token (#9463)
* Rewrite to_string() to use switch{} and handle Token_NONE and identifier without as_string()

* Add regression tests for to_string() on tokens without a string form

Cover both halves of the recursion that made a whitespace-only file
segfault: token::to_string() on the EOF marker and on an instance name,
and a parse of input that lexes to zero tokens, which is how the header
parser reaches token::as_string() on the EOF marker.

Generated with the assistance of an AI coding tool.

---------

Co-authored-by: Bruno Postle <bruno@postle.net>
2026-09-10 11:02:00 +02:00
Dion Moult e1be433207 ifcparse: unregister a deleted instance's inverse records via its attributes (#9467)
process_deletion_inverse() called inverse_index::remove_source(), which
walked every record in the file's inverse index to find the ones whose
source is the deleted instance: O(R) per deletion, the dominant cost of
file.remove() on large files now that the lookup side no longer re-sorts.

The records a deleted instance contributed are exactly the entity
references in its own attributes, so walk those with the same visitor
build_inverses_() uses for registration and remove each record with a
targeted binary search instead. remove_source() has no callers left and
is deleted.

Also use the ordered view of batch_deletion_ids_ (a boost multi_index
that already had one) for the is-this-referencer-also-being-deleted
check in process_deletion_(), which was a linear std::find over the
sequenced view: O(b) per referencing instance made batch deletion of b
instances quadratic.

file.remove on 300 IfcPropertySet of a 155 MB IFC4 model (201k IfcRoot)
drops from 3.15 ms to 0.17 ms per call, batched removal of 2000 from
3.34 ms to 0.17 ms per call, root.remove_product on 100 walls from
332 ms to 131 ms per call.


Claude-Session: https://claude.ai/code/session_01HNrXDmR88wKPCYwGE21SyH
(cherry picked from commit 938442303f)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-10 08:04:58 +10:00
Bruno Postle 41390dad92 Accept an unquoted decimal in a selector value
Requiring quotes around a decimal was a surprise with no way to predict it:
Foobar.Baz>1 works, Foobar.Baz>1.5 is a syntax error, and > >= < <= are
almost always used on numbers. Writing Width>"0.2" also reads like a text
comparison even though it is not.

The "." is excluded from unquoted_string because it separates a pset from a
property, but that separator has already been consumed by the time a value is
read, so a number is unambiguous in value position. Add a decimal_string
alternative to the value rule only. Signed and leading dot forms are accepted,
1. is not, and pset, prop and query keys are unchanged - they still need
quoting for a ".".

The transformer returns the same string a quoted value would, so =1.5 and
="1.5" are the same query and compare() does the existing type coercion.
Nothing that parses today changes meaning; only inputs that used to be a
syntax error now work.

Update the quoting docs accordingly, and assert the Bay property that the
filter test set up but never checked.

Generated with the assistance of an AI coding tool.
bonsai-0.9.0-alpha2609092144
2026-09-10 07:44:17 +10:00
Bruno Postle 1c6362ec31 Document the quoting rule in the selector syntax
An unquoted pset, prop, key or value may not contain any of , . = > < * !
or whitespace. This was never stated, and the only motivation the docs gave
for quoting was the "Level 3" example having a space, so there was nothing
to suggest that Pset_WallCommon.ThermalTransmittance=1.5 is a syntax error
while FireRating=2HR is fine. Decimal numbers are the common way to hit it.

State the rule where the reader meets values, in a new subsection under each
of the two value tables. The two grammars exclude different characters, so
the element value section states its own set and only the delta. Note that
all of these characters are a syntax error except the comma, which is read
as the filter separator instead, so Name=Foo,IfcWall silently means "named
Foo and an IfcWall" rather than matching the literal value.

Also fix the Query filter example, which had the same problem in the file
itself: query:types.count=0 does not error, it is silently parsed as a
property filter for a count property in a property set named query:types,
and matches nothing. Quote the keys, as the other query examples already do.

Generated with the assistance of an AI coding tool.
2026-09-10 07:44:17 +10:00
Dion Moult ba9810f459 [AI-generated, unverified] ifcparse: stop re-sorting the inverse index on every read after a write (#9460) bonsai-0.9.0-alpha2609092131 2026-09-10 07:31:45 +10:00
Andrej730 bfce5b9415 Introduce build-deps.py, deprecate build-deps.cmd
Moving to Python to make Windows build scripts more maintainable.

It's intended to be a drop-in replacement, so it should be possible to just switch `.\build-deps.cmd` to `python build-deps.py`, keeping exactly the same arguments and behaviour will be the same.
`build-deps.cmd` is deprecated, but not yet removed, but will be shortly after more testing.

Other batch files will be migrated to Python shortly after too.
bonsai-0.9.0-alpha2609091143
2026-09-09 16:43:04 +05:00
Andrej730 b588d52ebe bonsai_deps: print executed commands 2026-09-09 16:43:04 +05:00
Andrej730 b76a25e553 Bump ruff and ty 2026-09-09 16:43:04 +05:00
Andrej730 509b0f7f76 Fix ty disjoint-cast on geom/main.py
It was casting to `set`, while it's actually cannot be a set - both `include` and `exclude` can only be a list.
2026-09-09 16:43:04 +05:00
Andrej730 79fddd802e Fix ty warnings for using shutil.which on Windows
Apparently `ty` is being too strict here and warning about `Any` possibly being `PathLike` which is not supported on older Pythons.

```
error[deprecated]: The overload of `which` is deprecated
    --> src\bonsai\bonsai\bim\module\drawing\operator.py:2267:34
     |
2267 |                     command[0] = shutil.which(command[0]) or command[0]
     |                                  ^^^^^^^^^^^^ On Windows before Python 3.12, using a PathLike as `cmd` would always fail or return `None`.

error[deprecated]: The overload of `which` is deprecated
    --> src\bonsai\bonsai\tool\drawing.py:1324:30
     |
1324 |                 command[0] = shutil.which(command[0]) or command[0]
     |                              ^^^^^^^^^^^^ On Windows before Python 3.12, using a PathLike as `cmd` would always fail or return `None`.
```
2026-09-09 16:43:04 +05:00
Andrej730 33462ecc7c win/readme: drop stale IFCOS_USE_OCCT note (15c28a1) 2026-09-09 16:43:04 +05:00
Andrej730 39e331fb5a cmake: drop commented out static VC runtime linking
Commented out long time ago in ec04644.
Nowadays static linking would be done differently - using `CMAKE_MSVC_RUNTIME_LIBRARY`, but we don't really support static runtime.
2026-09-09 16:43:04 +05:00
Andrej730 0dd418fb1c cmake: drop stale static VC runtime warning
Since cmake 3.15 dynamic runtime is used by default and we don't really support static runtime.
2026-09-09 16:43:04 +05:00
Andrej730 633b35e171 build-ifcopenshell: add example usage 2026-09-09 16:43:04 +05:00
Andrej730 f36f48819e build-ifcopenshell: process cpp files in parallel (5d8d6a0) 2026-09-09 16:43:04 +05:00
Andrej730 c027615f4d cmake: fix issue building with rocksdb on multi-configs
Example error that occurred:
```
CMake Error in CMakeLists.txt:
  IMPORTED_LOCATION not set for imported target "RocksDB::rocksdb"
  configuration "MinSizeRel".
```
2026-09-09 16:43:04 +05:00
Andrej730 fe5b826ec1 run-cmake: wire manifold
Renamed variable to `MANIFOLD_INSTALL_PATH` to avoid relying on env variables for manifold package discovery in cmake.
2026-09-09 16:43:04 +05:00
Andrej730 e9a547dd5e build-deps/manifold: use BuildCMakeProject instead of BuildSolution
We use `BuildSolution` only in one other case - mpfr that doesn't have a cmake.
2026-09-09 16:43:04 +05:00
Andrej730 d94653cd1f build-deps/manifold: drop redundant git reset
It already happens during git clone.
2026-09-09 16:43:04 +05:00
Andrej730 2486dd38cb build-deps/manifold: make it reachable
manifold was introduced in a19d398, but its `goto :manifold` occurred too early in the file skipping bunch of dependencies - I guess that's why it was removed in 6ad5fbb, but then new target, qt was using `Successful` as the next label, so `manifold` end up being always skipped.
Making it reachable as we do use it in nix/build-all.
2026-09-09 16:43:04 +05:00
Andrej730 f4445e7e99 build-deps/rocksdb: remove redundant cmake args 2026-09-09 16:43:04 +05:00
Andrej730 a856ca9bf2 build-deps/qt: reuse NEXT_DEPENDENCY_LABEL 2026-09-09 16:43:04 +05:00
Andrej730 6ad9386a8d build: dont provide dependencies to cgal installation
CGAL never runs `find_package` for `Boost`, `GMP` or `MPFR` during its configuration and never hardcodes their paths to the generated configs. So providing them have no effect. It's also can be confirmed by `build-deps.cmd` on Windows running all this time without the most of these args. Though it was settings `BOOST_ROOT` but it had no effect too.

Probably it's some kind of artifact from CGAL past when it's used to be non-header-only library.
2026-09-09 16:43:04 +05:00
Andrej730 9fd3fd17ab build: drop CGAL_HEADER_ONLY flag
Since cgal 5.3 the library is header only and flag is not needed. `BUILD_SHARED_LIBS` - same story.

See https://www.cgal.org/2021/07/06/cgal53/
2026-09-09 16:43:04 +05:00
Andrej730 cb510519a1 run-cmake: drop default value for SWIG_INSTALL_DIR
Caching of version path was introduced in c5f6d47, awhile ago, removing it, since all new installations are already using the cache instead of this default fallback.

`robocopy` line was an artifact from old layout.
2026-09-09 16:43:04 +05:00
Andrej730 649a869d9c build-deps/python: remove redundant PYTHON_AMD64_POSTFIX variable
It was only needed to set `PYTHON_INSTALLER` correctly, but
`PYTHON_INSTALLER` is actually only used when arch is not x64/arm64,
exactly the only cases when `PYTHON_AMD64_POSTFIX` is set.
2026-09-09 16:43:04 +05:00
Andrej730 865fd99eba build-deps/occt: drop cleaning up inc directory
Turned out it wasn't cmake/occt problem and was a general Windows issue - realtime protection is slowing down cmake reinstalls.
See https://redirect.github.com/Open-Cascade-SAS/OCCT/issues/901
2026-09-09 16:43:04 +05:00
Andrej730 69f5fca049 build-deps/occt: use CMAKE_INSTALL_PREFIX for consistency with build-all
Switched from custom `INSTALL_DIR` to generic `CMAKE_INSTALL_PREFIX` in build-all in f3d1c62f5, mirroring the change on Windows too.
2026-09-09 16:43:04 +05:00
Andrej730 01d489589e build-deps/occt: set dependency name just once 2026-09-09 16:43:04 +05:00
Andrej730 0e39abf88e build-deps/occt: drop -new-layout suffix on next version update automatically 2026-09-09 16:43:04 +05:00
Andrej730 eaae0072e4 build-deps/opencollada: drop stale helper comment
It's dating back to the original implementation in 5c0eb05, it was
needed to avoid rebuilding opencollada. Not needed anymore since
previous installations are now recognized.
2026-09-09 16:43:04 +05:00
Andrej730 b4687b5caa build-deps/opencollada: remove note about release/debug builds switching
It was since the beginning in 5c0eb0548, it's probably resolved after we
added coexisting debug/release installs.
2026-09-09 16:43:04 +05:00
Andrej730 5ae30c4264 build-deps: remove mark_based_on_artifacts workaround
We mark some dependency installations using empty `.release/debug_installation` files to support coexisting release/debug installations, which is needed on Windows to be able to easily switch between Release/Debug builds of IfcOpenShell and avoiding conflicts when different binaries are using different debubg/non-debug runtimes.

It was introduced in 517ba237f and `mark_based_on_artifacts` was pre-existing installations based on the found artifacts, all new installations were not relying on this for marking. Since it's been some time, dropping this workaround.
2026-09-09 16:43:04 +05:00
Andrej730 2d6ec159d2 build-deps/boost: don't specify runtime-link explicitly
As it is assumed `shared` by default.
2026-09-09 16:43:04 +05:00
Andrej730 35d5980959 build-deps/boost: drop check_boost_vc145_compatibility workaround
It's needed to support vc145 (vs2026) for boost versions <1.91. Since
05ba93a we're now building using 1.92, so the workaround is no longer
needed.
2026-09-09 16:43:04 +05:00
Andrej730 b6dd061f14 build-deps/boost: drop fallback for older archive names
Introduced in 2e35b07 when moving to github releases, removing it since
it's been 20 months already.
Added temporary clean up step to remove previous installation.
2026-09-09 16:43:04 +05:00
Andrej730 9624a17809 build-deps/mpfr: consider VS_TOOLSET override
Previously it constructed toolset from `VC_VER`, while it's possible
it's overridden using `VS_TOOLSET`.
2026-09-09 16:43:04 +05:00
Andrej730 2eba0addf2 build-deps/mpfr: clean up repo dir on the rebuild
For consistency with `mpir`
2026-09-09 16:43:04 +05:00
Andrej730 97caf8033c build-deps: note about mpfr/mpir missing some configurations 2026-09-09 16:43:04 +05:00
Andrej730 fe8753bb17 build-deps: document target arg in BuildSolution 2026-09-09 16:43:04 +05:00
Andrej730 71950f6b85 cmake/svgfill: drop undocumented USE_STATIC_MSVC_RUNTIME option
I've found this commit 4400a6e that was introducing this option to the main cmake, but I'm not sure if it ever was propagated to the main branch or was reverted inside one of the merges.

But anyway, `USE_STATIC_MSVC_RUNTIME` is currently used only in svgfill, not used in the main cmake and works out of sync with main cmake (it sets `Boost_USE_STATIC_RUNTIME` to `OFF` instead of guard+setting it to `ON`).

So removing this option and syncing the code.
2026-09-09 16:43:04 +05:00
Andrej730 2be991fff4 build-deps: remove USE_STATIC_RUNTIME option in mpfr/mpir
Typically we always avoid using static runtime as it causes issues when
binaries are interacting.
2026-09-09 16:43:04 +05:00
Andrej730 0e9dc6a87f buld-deps/proj: fix use of deprecated variables
Resolves the warnings below:
```

CMake Deprecation Warning at CMakeLists.txt:207 (message):
  Use SQLite3_INCLUDE_DIR instead of SQLITE3_INCLUDE_DIR

CMake Deprecation Warning at CMakeLists.txt:211 (message):
  Use SQLite3_LIBRARY instead of SQLITE3_LIBRARY
```
2026-09-09 16:43:04 +05:00