The codegen only ever needed a protoc binary, but every entry point installed
grpcio-tools to get one. That drags in the grpcio C extension, which has no
Windows/ARM64 wheel and falls back to building from source there, so the ARM64
job died with "Failed building wheel for grpcio" -> "protoc not found".
tools/codegen_toolchain.py resolves the toolchain instead: protoc from $PROTOC,
PATH, a cache, grpc_tools when already installed, or a pinned checksum-verified
protoc release unpacked into .codegen-tools/; protobuf and pyyaml from the
calling interpreter or a cached virtualenv it re-execs into (distro Pythons
refuse `pip install` under PEP 668). All four build scripts and all three CI
jobs are now just `python tools/run_codegen.py`, with no pip lines around it.
tools/config_metadata_pb2.py was the one generated file checked into git. The
orca.* option extensions are now read out of the descriptor set, which already
carries config_metadata.proto via --include_imports, so nothing is generated
into the tree -- and the protobuf>=6.33.5,<7 CI pin goes away with it, since it
only existed to satisfy gencode's hard ValidateProtobufRuntimeVersion check.
Generated C++ verified byte-identical under upb and the pure-Python protobuf
runtime (what win/arm64 installs), and under both grpc_tools' and standalone
protoc.
Also fixed:
- build_release_macos.sh still passed -DPython3_EXECUTABLE=<codegen venv>,
pointing the bundled *embed* interpreter at the codegen environment -- the
same confusion fae4b124 fixed on the CMake side.
- Tab.cpp #includes TabLayout_generated.cpp but had no dependency on
codegen_config, so an incremental build after a .proto edit could compile it
while the file was being rewritten. libslic3r already had this guard.
- ConfigCodegen.cmake now probes with `codegen_toolchain.py --check` (which
never downloads or installs), prefers a host interpreter over the embed one,
and lets a fresh clone generate at configure time instead of erroring out.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
main forces Python3_EXECUTABLE to the bundled *embed* interpreter (for the
in-app Python plugin runtime). ConfigCodegen.cmake used that same interpreter to
regenerate the config sources at build time, but the embed Python has no protoc
/ protobuf / pyyaml (and for cross-compiled targets isn't even the host arch),
so ninja's "Re-generating config C++ from changed .proto files" step failed with
"protoc not found" on every platform — even though the workflow's dedicated
codegen step had already generated the files.
Probe whether the interpreter can actually run the codegen (protobuf importable
AND a protoc available, standalone or via grpc_tools). Only wire up the
auto-regenerating custom command when it can; otherwise use the already-generated
files as-is (with a no-op codegen_config target) and only error if they are
missing. Adds ORCA_CODEGEN_PYTHON to let a build point at a tools-capable
interpreter independent of the embed one.
Generated files remain gitignored; the CI "Install codegen tools and generate
config sources" step still produces them before the build.
The Windows build's "Install codegen tools" step ran `pip install grpcio-tools`,
whose grpcio C-extension has no Windows/ARM64 wheel for current Python and fails
to build from source on windows-11-arm, so protoc was unavailable and
run_codegen aborted at the compile step.
The codegen only needs a protoc binary + the protobuf runtime + pyyaml. Install
those directly on Windows instead: pip install protobuf (>=6.33.5, matching the
committed config_metadata_pb2.py runtime check) + pyyaml, and download a
standalone protoc (win64; runs under x64 emulation on arm64). run_codegen
prefers a standalone protoc on PATH, so grpcio-tools is no longer needed on
Windows. Linux/macOS steps keep grpcio-tools (wheels available there).
Verified locally: run_codegen with a protobuf-only venv (no grpcio-tools) +
standalone protoc 28.3 -> Lint passed (712 fields), Validation PASSED.
Resolve the 4 proto-refactored conflicts (Preset.cpp, Print.cpp,
PrintConfig.cpp, Tab.cpp) by keeping the branch's generated-include
versions; auto-merged non-conflict changes from main are preserved.
Reconcile main's new settings into the proto schema. main added 52 new
active init_fff_params settings not present in the proto; ported them all
(type/label/tooltip/default/enum/preset) into print/filament/printer.proto
so the config registers, profiles load, and the GUI does not crash on
missing defs. Added GuiType.plugin_picker to config_metadata.proto and
regenerated config_metadata_pb2.py.
Codegen: run_codegen validate PASSED (712 fields). UI layout (layout.yaml
placement) for the 52 new settings is a follow-up; they are registered and
serialized but not yet placed in GUI tabs.
The Linux CI build fails at the encoding-check step:
"Source file is valid UTF-8 but contains a BOM mark"
These three files picked up a UTF-8 BOM (EF BB BF) during Windows-side
merges/edits. Removed the BOM (first 3 bytes only); file contents and line
endings are otherwise unchanged.
The merge of newer main brought three features (Top Surface Expansion #14296,
Anisotropic surfaces + Separated Infills #11682, Toolchange ordering #13582)
whose manual code (ConfigManipulation.cpp / Tab.cpp) came in, but whose
settings were never ported to the proto schema. ConfigManipulation::
toggle_print_fff_options then dereferenced options with no ConfigOptionDef
(opt_float("top_surface_expansion"), opt_bool("anisotropic_surfaces")),
crashing the GUI at startup (ACCESS_VIOLATION).
Add proto fields (ported from main, incl. defaults/enums/invalidation/UI):
- top_surface_expansion, top_surface_expansion_margin,
top_surface_expansion_direction (enum), center_of_surface_pattern (enum),
anisotropic_surfaces, separated_infills -> Strength page
- toolchange_ordering (enum) -> Multimaterial page
Verified: run_codegen validate PASSED (660 fields); Release build clean;
GUI now starts and runs past toggle_print_fff_options (no crash log).
The proto extraction had dropped several settings that still had struct
members and were used by the engine, and had resurrected two commented-out
ones. This closes those gaps so the generated config matches main.
Fixes startup crash `UnknownOptionException: outer_wall_filament_id`:
- Add proto defs (ported from main) for the 6 struct-backed per-region
filament-id keys the engine reads and handle_legacy resolves into:
outer_wall/inner_wall/internal_solid/sparse_infill/top_surface/
bottom_surface_filament_id. Registered + serialized, but intentionally no
tab UI (the coarse wall_filament/sparse_infill_filament/solid_infill_filament
settings provide the UI). Without a def these threw at profile load.
Restore user settings dropped from the proto (def + preset + UI, from main):
- bridge_line_width, relative_bridge_angle, lightning_overhang_angle,
lightning_prune_angle, lightning_straightening_angle (print.proto)
- initial_layer_fan_speed (filament.proto)
Remove settings the bootstrap resurrected from commented-out code (absent in
main; commented-out struct members): filament_extruder_id (coInts),
spaghetti_detector. The separate custom-gcode filament_extruder_id placeholder
var is untouched.
Add missing printer virtual_preset_keys so vendor machine profiles are not
stripped on load: use_3mf, support_parallel_printheads,
parallel_printheads_count, parallel_printheads_bed_exclude_areas.
Verified: run_codegen validate PASSED (653 fields); libslic3r builds;
OrcaSlicer_profile_validator over all bundled profiles now exits 0 with zero
errors (previously crashed / stripped keys).
The proto extraction had dropped several settings that still had struct
members and were used by the engine, and had resurrected two commented-out
ones. This closes those gaps so the generated config matches main.
Fixes startup crash `UnknownOptionException: outer_wall_filament_id`:
- Add proto defs (ported from main) for the 6 struct-backed per-region
filament-id keys the engine reads and handle_legacy resolves into:
outer_wall/inner_wall/internal_solid/sparse_infill/top_surface/
bottom_surface_filament_id. Registered + serialized, but intentionally no
tab UI (the coarse wall_filament/sparse_infill_filament/solid_infill_filament
settings provide the UI). Without a def these threw at profile load.
Restore user settings dropped from the proto (def + preset + UI, from main):
- bridge_line_width, relative_bridge_angle, lightning_overhang_angle,
lightning_prune_angle, lightning_straightening_angle (print.proto)
- initial_layer_fan_speed (filament.proto)
Remove settings the bootstrap resurrected from commented-out code (absent in
main; commented-out struct members): filament_extruder_id (coInts),
spaghetti_detector. The separate custom-gcode filament_extruder_id placeholder
var is untouched.
Add missing printer virtual_preset_keys so vendor machine profiles are not
stripped on load: use_3mf, support_parallel_printheads,
parallel_printheads_count, parallel_printheads_bed_exclude_areas.
Verified: run_codegen validate PASSED (653 fields); libslic3r builds;
OrcaSlicer_profile_validator over all bundled profiles now exits 0 with zero
errors (previously crashed / stripped keys).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reconcile main's config changes with the protobuf codegen:
- New settings ported to proto schema (already present) and verified in
generated PrintConfigDef/Preset_options/TabLayout + PrintConfig.hpp:
small_support_perimeter_speed, small_support_perimeter_threshold,
top_layer_direction, bottom_layer_direction, hole_to_polyhole_max_edges
- Ported main's label/tooltip updates for adaptive_pressure_advance_overhangs
and adaptive_pressure_advance_bridges into filament.proto (were dropped in
the conflict resolution) and regenerated.
- Kept main's non-generated logic (Preset.cpp nullable filament override
force-emit).
Codegen validated (python tools/run_codegen.py --validate-only): PASSED.
Reconcile main's config changes with the protobuf codegen:
- New settings ported to proto schema (already present) and verified in
generated PrintConfigDef/Preset_options/TabLayout + PrintConfig.hpp:
small_support_perimeter_speed, small_support_perimeter_threshold,
top_layer_direction, bottom_layer_direction, hole_to_polyhole_max_edges
- Ported main's label/tooltip updates for adaptive_pressure_advance_overhangs
and adaptive_pressure_advance_bridges into filament.proto (were dropped in
the conflict resolution) and regenerated.
- Kept main's non-generated logic (Preset.cpp nullable filament override
force-emit).
Codegen validated (python tools/run_codegen.py --validate-only): PASSED.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>