1
0
Fork 0
Commit graph

64 commits

Author SHA1 Message Date
4dd74b0f65 Remove underscore prefix from generated filenames 2026-07-17 23:26:34 -04:00
321b42f9af Complete filename/naming remediation with PascalCase convention 2026-07-17 22:48:16 -04:00
b61512c4eb Skip caller-allocates out-params instead of miscompiling them
GIR caller-allocates out-params (char *outbuf, gunichar *result) require
the caller to allocate and size the buffer, unlike callee-allocates T**
out-params where the callee fills in the pointee. The out-param
marshalling declared a single Swift scalar and passed its address, which
is correct only for the callee-allocates shape; for caller-allocates, C
wrote buffer payload past the one-element slot (g_unichar_fully_decompose)
or the payload was reinterpreted as a pointer and dereferenced
(g_unichar_to_utf8, segfault). GIR carries no buffer-size field, so these
are now skipped rather than generated. The guard also reclassifies
time_val_from_iso8601/signal_query/type_query from plainRecord to the
accurate caller-allocates reason.
2026-07-17 21:16:53 -04:00
16e5449cad Expand runtime smoke tests across binding categories
Add smoke tests exercising boxed-record lifetime (copy-on-borrow,
adopt-on-full, init(retaining:), isolated deinit over thousands of alloc/free
cycles), out-param tuple returns, enum returns, bitfield arguments, and GError
bridging on both the success and throwing paths — proving each marshalling
category reaches real GLib/GObject correctly at runtime.
2026-07-17 21:04:43 -04:00
164f8b7b9a Generate boxed-record memory management and interface requirements
Boxed records (C4): resolve each record's copy/free function from the GIR
copy-function/free-function attribute, else its own ref/copy and unref/free
method, and render init(retaining:) plus an isolated deinit. The deinit is
isolated because the package's default MainActor isolation makes accessing the
non-Sendable pointer from a nonisolated deinit a hard error. The registry uses
the same resolution so transfer=none returns copy instead of adopting a
borrowed pointer. This supersedes the earlier deferral: the hypothesised
OpaquePointer/Sendable barriers either did not hold or were solvable.

Interfaces (C5): plan each interface method through planMethod and render it as
a protocol requirement (no body); the conforming class supplies the C call.
2026-07-17 21:04:37 -04:00
8698d48e1c Generate out-params as inline tuple returns 2026-07-17 19:42:00 -04:00
144da7860e Generate class methods and constructors with runtime smoke tests 2026-07-17 15:43:30 -04:00
56de5bc976 Rearchitect generator around binding-plan layer with function generation 2026-07-17 14:43:54 -04:00
3b42593c72 B7: delete old CodeGen engine, make plan engine default
- Deleted CodeGen+Signal.swift entirely
- Replaced CodeGen.swift with minimal shim (scaffolding only)
- Removed returnType compat shims from IRModel.swift
- Simplified Main.swift to always use plan engine
- Removed single-GIR path (parser debugging only)
- Removed --engine=plan flag (plan engine is now default)
- Updated CLI tests and help text
- 124 tests pass, Gate 1 PASSES

Generated output: 271 types (GLib: 215 value types, GObject: 56 types incl. 30 classes)
Class wrappers with cross-module inheritance, ownership inits, and override.
Methods/functions deferred to Phase C (needs C enum bridging).
2026-07-17 01:49:34 -04:00
7f7d5b3cb8 Update skip baseline after class wrapper generation (Gate 1)
GObject: 56 bound types (30 class wrappers + 26 value types), up from 26.
GLib: 215 bound types (no classes - pure C library).
Gate 1 now PASSES with class wrappers, zero compile errors.
2026-07-17 01:41:33 -04:00
ebebd4b1b0 Add skip baseline for tier 1 (Gate 1a — first green gate)
241 types bound (GLib: 215, GObject: 26) across 1,157 skipped symbols.
Generated package compiles with zero errors via --engine=plan.
Skip reasons: unknownType (978), callbackWithoutUserData (97),
plainRecord (77), gtypeStruct (4), notIntrospectable (1).
2026-07-17 01:04:30 -04:00
73d4b442b5 Update MonorepoConfig.from to use [packages.Name] section format, update tests 2026-07-01 20:55:16 -04:00
880c1574d5 Add monorepo generation integration tests 2026-07-01 20:50:14 -04:00
173ad4bd65 Add qualifiedTypeToSwift and reexport umbrella unit tests 2026-07-01 20:48:18 -04:00
7ce28c0ba8 Add MultiPackageAnalyzer dependency resolution tests 2026-07-01 20:44:30 -04:00
f61a63f167 Add MonorepoConfig TOML parsing tests 2026-07-01 20:43:38 -04:00
58aef1a5d4 Add --monorepo-config CLI mode for unified multi-package generation 2026-07-01 20:35:56 -04:00
944b7cf670 Fix link name version suffix and Package.swift bracket alignment 2026-07-01 20:32:11 -04:00
5278fe90c3 Replace single-package scaffolding with monorepo Package.swift generation 2026-07-01 20:27:36 -04:00
f6adf61167 Remove dead buildNamespaceToModuleMap method 2026-07-01 20:25:31 -04:00
2956b23b58 Add re-export umbrella module generation with transitive import analysis 2026-07-01 20:22:12 -04:00
b32bc595ac Fix Task 4: remove dead nsToModule, add collision guards, fix pascalCase for aliases 2026-07-01 20:19:48 -04:00
3dde30dc70 Add qualifiedTypeToSwift and generateMonorepo for cross-namespace type references 2026-07-01 20:16:50 -04:00
cf9f762155 Fix code quality: add doc comments, document DAG assumption, clarify implicitImports 2026-07-01 20:14:19 -04:00
9eab7ffc72 Add MultiPackageAnalyzer with cross-package import resolution 2026-07-01 20:10:17 -04:00
bc67617649 Add includedPackages to Repository, populate from GIR include elements 2026-07-01 20:06:57 -04:00
4637693cdb Fix Task 1 review: remove duplicate parseObjectOverrides, add doc comments 2026-07-01 20:04:51 -04:00
1d6b70ae66 Add MonorepoConfig, PackageEntry, and IncludeEntry models 2026-07-01 20:01:08 -04:00
4bdc734f29 Address Task 11 review: shared test support, fix TestSkipError semantics, extract preamble 2026-07-01 19:19:47 -04:00
6ae74045fa Add GIR spec accuracy test suite validating all 269 Gtk classes against input spec 2026-07-01 19:14:25 -04:00
0792f45c4c Improve regression test script: portable path, cleanup trap, auto-build 2026-07-01 18:56:37 -04:00
34554c96c3 Drop public prefix for open classes (open implies public visibility) 2026-07-01 18:50:01 -04:00
ebcf7c227f Add regression test harness and baseline metrics 2026-07-01 18:46:59 -04:00
9dbd2b5a7a Force open class for classes with same-namespace subclasses 2026-07-01 18:33:05 -04:00
3a033057fb Map optional boolean return with .map { $0 != 0 } 2026-07-01 18:27:57 -04:00
2bcaafb3f5 Convert Swift Bool params to gboolean (Int32) via ? 1 : 0 2026-07-01 18:23:59 -04:00
94c98f4692 Emit override keyword for subclass methods; include static functions; stop at namespace boundary 2026-07-01 18:18:28 -04:00
681a15db51 Only emit pointer property for root or cross-namespace parent classes 2026-07-01 18:05:41 -04:00
50a42b2d83 Fix typed pointer casting: .assumingMemoryBound for C functions, remove double g_object_ref_sink in constructors 2026-07-01 17:49:00 -04:00
4a60aff56d Add cType field to Parameter and capture from GIR XML c:type attribute 2026-07-01 17:34:13 -04:00
39f0d97269 Fix signal @convention(c) missing -> Void return type 2026-07-01 17:28:36 -04:00
27edea19af Refactor CodeGen.swift into CodeGen+Signal.swift and CodeGen+Scaffolding.swift 2026-07-01 17:27:42 -04:00
84a536d314 Fix pipe deadlock in CLI generation lint test 2026-07-01 14:46:45 -04:00
cacd83dfe4 Fix pipe deadlock in plugin and CLI integration tests 2026-07-01 14:46:26 -04:00
dd1cad2961 Add build tool plugin integration test and fix list-files paths 2026-07-01 14:40:07 -04:00
15493a9821 Add CLI generation + swift-format lint integration test 2026-07-01 14:22:22 -04:00
ef1b08cbda Fix generated Package.swift trailing comma and missing newline 2026-07-01 14:19:31 -04:00
a1e9ee226b Fix plugin listing, exit-status check, DocC comments, lowercase config.toml 2026-07-01 14:06:16 -04:00
035c69b457 Rename Config.toml to config.toml across all files 2026-07-01 14:06:08 -04:00
9915723cd8 Update docs for Config.toml and auto-extracted namespace config 2026-07-01 13:56:42 -04:00