Commit Graph
33 Commits
Author SHA1 Message Date
ExPikaPakaandClaude Opus 5 2f67e46047 fix(codegen): drop grpcio-tools, stop committing generated code
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>
2026-07-28 12:53:05 +02:00
ExPikaPaka fae4b1241b fix(codegen): don't run build-time codegen with the embed Python (fixes CI build)
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.
2026-07-28 10:17:59 +02:00
ExPikaPaka 5a5c25b8d1 ci(windows): fix config codegen on Windows ARM64 (drop grpcio-tools)
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.
2026-07-28 09:00:25 +02:00
ExPikaPaka 571819bfb2 Merge origin/main into feature/protobuf_config_and_dynamic_ui
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.
2026-07-28 08:01:22 +02:00
ExPikaPaka d47b57af8a strip UTF-8 BOM from PrintConfig.cpp, Print.cpp, Tab.cpp
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.
2026-07-10 08:27:58 +02:00
ExPikaPaka 5f15ead5ee Merge branch 'main' into feature/protobuf_config_and_dynamic_ui 2026-07-10 08:02:45 +02:00
ExPikaPaka 9679cc5b81 fix(protobuf): port 7 new settings from main merge (fixes GUI startup crash)
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).
2026-07-09 23:27:07 +02:00
ExPikaPaka 08bfb37bb6 Merge branch 'feature/protobuf_config_and_dynamic_ui' of https://github.com/OrcaSlicer/OrcaSlicer into feature/protobuf_config_and_dynamic_ui 2026-07-09 22:51:33 +02:00
ExPikaPaka 4583516e4a fix(protobuf): close config migration gaps (orphaned settings, startup crash)
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).
2026-07-09 08:38:08 +02:00
ExPikaPakaandClaude Opus 4.8 bb919a7171 fix(protobuf): close config migration gaps (orphaned settings, startup crash)
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>
2026-07-09 08:38:08 +02:00
ExPikaPaka 1c576873fc Merge remote-tracking branch 'origin/main' into feature/protobuf_config_and_dynamic_ui
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.
2026-07-08 10:31:10 +02:00
ExPikaPakaandClaude Opus 4.8 b1d1fb7dfc Merge remote-tracking branch 'origin/main' into feature/protobuf_config_and_dynamic_ui
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>
2026-07-08 10:31:10 +02:00
ExPikaPaka 8be6b40e7f Merge branch 'main' into feature/protobuf_config_and_dynamic_ui 2026-07-03 08:38:15 +02:00
ExPikaPaka cd6223ffaf Make typo verification more robust 2026-06-18 08:48:42 +02:00
ExPikaPaka 0458925f85 Install proto before flatpack when there is internet. Add missing include that caused fail only on Unix 2026-06-04 17:41:40 +02:00
ExPikaPaka 7c34e089e4 Try to fix mac build again
Ahh, I never compiled any program on Mac, i thought it will behave the same was as Linux,
but there are some diferences of course..
2026-06-04 14:37:03 +02:00
ExPikaPaka d314e9c09a Fix build for Mac 2026-06-04 14:22:04 +02:00
ExPikaPaka 7fa650e410 Fix build script as it was not working on some platforms 2026-06-04 12:28:25 +02:00
ExPikaPaka 1c1cee7784 Add missing fix for BOM file encoding 2026-06-04 12:27:43 +02:00
ExPikaPaka 1d7da51991 Fix encoding and build script 2026-06-04 12:13:10 +02:00
ExPikaPaka 3be63d4369 Use venv for python on Linux and macOS 2026-06-04 11:52:05 +02:00
ExPikaPaka 99a0dd8556 Fix BOM mark 2026-06-04 11:41:24 +02:00
ExPikaPaka fcd3a66af4 Merge branch 'feature/protobuf_config_and_dynamic_ui' of https://github.com/OrcaSlicer/OrcaSlicer into feature/protobuf_config_and_dynamic_ui 2026-06-04 09:09:32 +02:00
ExPikaPaka 972da86fbc Fix incorrect path at codegen config 2026-06-04 09:08:27 +02:00
ExPikaPaka a29fac5de8 Update printer section in automatic layout 2026-06-04 08:41:43 +02:00
ExPikaPaka 14097382d8 Adds custom hooks that are called cause they need special code and can't be implemented purely via protobuf definition 2026-06-04 08:40:54 +02:00
ExPikaPaka 3db76d7f89 Extend code generators to properly handle new data types 2026-06-04 08:40:20 +02:00
ExPikaPaka c47fc4529e Wire in generated files 2026-06-04 08:40:00 +02:00
ExPikaPaka b823994feb Add cmake config to properly do incremental build 2026-06-04 08:38:50 +02:00
ExPikaPaka 403766b1b6 Add .gitignore entry to ignore generated code 2026-06-04 08:38:24 +02:00
ExPikaPaka 6e84139d60 Configure CI/CD build to properly build OrcaSlicer with Protobuf and codegen 2026-06-04 08:37:32 +02:00
ExPikaPaka a78ef9ce1c Fix proto files after merging them from ~15 files to 3 2026-06-04 08:36:51 +02:00
ExPikaPaka 064e10c069 Remove outdated files 2026-06-04 08:36:28 +02:00