Files
dotCooCoo 9fd4419eb4 DWG: correct the worker docs on conversions without a worker
use_own_worker's doc comment said the reader and writer stay in this
process when the program's path can't be found. In that case
use_own_worker only logs a warning, so a worker set earlier stays set.
Since #1345, with no worker set, the conversions refuse unless
allow_in_process was called.

The module doc, use_own_worker and allow_in_process now name all four
conversions that take this path: decode, encode_as, encode_noted and
encode_kept_noted. The README's sentence on a worker that cannot start
now begins with "Conversions" instead of "Coordinates".
2026-11-19 11:27:07 -08:00

1.5 KiB

craft-dwg

A byte-level bridge between DWG and DXF. It does not expose acadrust types: callers pass bytes, choose limits, and receive converted bytes plus notes about data the conversion could not preserve. Application document mapping remains with the caller.

The default limits reject DWG inputs over 512 MiB and stop DXF output over 1 GiB. The bridge also catches panics from the dependency and validates its conversion diagnostics. Because a small hostile file can declare very large internal sections, size checks alone cannot prevent an allocation failure inside the decoder. On native applications, call use_own_worker() during startup and call serve_if_asked() before normal argument handling. Subsequent decode and encode_* calls then run in a child process with a 30-minute timeout; a crash or stack overflow is contained to that child. The worker has no operating-system memory limit yet. Without a configured worker, conversions are refused rather than run in the current process: call allow_in_process() only for input that is known to be trusted (tests, or bytes this process produced itself). Conversions, once a worker is configured but cannot start, also fail closed.

The bridge is not built for wasm32 or FreeBSD/aarch64. Those targets retain the public API and return a clear unsupported-build error. The acadrust 0.6.6 dependency is used unmodified under MPL-2.0; its license and third-party notices are in licenses/dwg/ at the workspace root.