Metadata-Version: 2.4
Name: zalfmas-capnp-schemas
Version: 0.1.62
Summary: 
License-File: LICENSE
Author: Michael Berg-Mohnicke
Author-email: michael.berg@zalf.de
Requires-Python: >=3.12,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: pycapnp (>=2.2.1,<3.0.0)
Description-Content-Type: text/markdown

# zalfmas-capnp-schemas

Containerized Cap'n Proto schema compiler with C++, C#, Go, Python, and capnp-offset support.

## Build image

```bash
docker build -t capnp-gen .
```

Optional build arguments:

- CAPNP_VERSION (default 1.2.0)
- JOBS (parallel make jobs, default 6)
- CAPNPC_GO_PKG (Go plugin module path)
- CAPNPC_GO_VERSION (default v3.1.0-alpha.2)

Example:

```bash
docker build --build-arg CAPNP_VERSION=1.2.0 --build-arg JOBS=12 -t capnp-gen .
```

## Basic usage

The image ENTRYPOINT is: `python3 capnp_compile.py`
Default CMD: `--lang c++ go csharp python capnp_offsets`

```bash
docker run --rm -u $(id -u):$(id -g) \
  -v "$(pwd)":/workspace -w /workspace capnp-gen
```

Explicit (C++ + Go):

```bash
docker run --rm -u $(id -u):$(id -g) \
  -v "$(pwd)":/workspace -w /workspace capnp-gen --lang c++ go
```

## Notes

- Schemas must be available inside the mounted workspace (default: current directory).
- Generated code is written relative to /workspace (your mounted directory).
- capnpc-go is on PATH (installed in /usr/local/bin).
- Go generation maintains a single module rooted at `gen/go`.
- `gen/go/go.mod` is preserved by the generator, and `go mod tidy` runs automatically after Go regeneration to refresh `go.sum`.
- Adjust UID/GID mapping with -u to avoid root-owned outputs.

## Updating Go plugin only

Rebuild with a different CAPNPC_GO_VERSION:

```bash
docker build --build-arg CAPNPC_GO_VERSION=v3.0.0 -t capnp-gen .
```

