39 Commits

Author SHA1 Message Date
Akhil Velagapudi f494ade7b8 Normalize Registry resolution through DiodeHub 2026-08-03 11:56:27 -04:00
Akhil Velagapudi 4e01cb2635 Bundle kicad lib assets into lib/std (#886)
* docs: simplify README

* Add third-party notices

* Bundle stdlib KiCad assets

* Remove implicit KiCad library resolution

* Remove stale KiCad alias fixtures

* Remove layout-time model embedding

* Remove global KiCad footprint lookup

* Add KiCad stdlib path aliases

* Clean up KiCad stdlib aliases

* Derive WorkspaceConfig default

* Clean up KiCad STEP generator typing

* Use bundled KiCad footprints in tests

* Simplify interface template tests

* Ignore bundled KiCad library dependencies

* Bundle KiCad connector compatibility assets

* Resolve KiCad FPIDs to bundled stdlib footprints

* Normalize legacy KiCad library dependencies

* Bundle Governor KiCad compatibility assets

* Restore changelog entries
2026-06-17 11:56:42 -04:00
Akhil Velagapudi f94844770b Drop v1 resolver (#884)
* Make read commands dependency-state read-only

* Remove legacy dependency resolution

* Remove obsolete sync dependency cruft

* Remove workspace members compatibility

* Exclude lockfile from package hashes

* Simplify read-only dependency resolution

* Hydrate CI workspaces before read-only checks

* Always use frozen dependency resolution

* Use frozen package roots for active eval root
2026-06-15 21:06:37 -04:00
Akhil Velagapudi f0464212e0 Bump version to 0.4, add pcb migrate version bump (#873)
* chore: bump version to 0.4.0

* Add latest-toolchain workspace migration flow

* Handle global flags before migrate dispatch

* Address migrate review feedback

* Delete pcb.sum

* Bump workspace fixtures to pcb 0.4
2026-06-10 10:21:13 -04:00
Akhil Velagapudi adfdc228d8 pcb 0.4 breaking changes (#870)
* Migrate stdlib to KiCad 10 symbols + footprints (#701)

* Bump stdlib KiCad asset pin to 10.0.0

* Update crystal generic for KiCad 10 pin names

* Update snapshots

* Delete deprecated stdlib (#703)

* Delete deprecated stdlib files

* Fix tests

* Remove deprecated generic stdlib modules

* Remove deprecated standoff and terminal block generics

* Remove deprecated stdlib helpers and API shims

* Remove physical value range deprecation hook

* Drop legacy stdlib load path

* Remove V1 manifest migration support

* Remove legacy net moved directives

* Remove legacy manifest assets support

* Bump KiCad 10 assets to 10.0.3

* Error on legacy Component properties

* Remove legacy module property API

* Drop old toolchain compatibility shims

* Strict 0.4 net naming (#849)

* Enforce strict regular net naming

* Treat NotConnected nets as source-unnamed

* Update unreleased changelog for 0.4 changes

* Clean up 0.4 docs

* fix: pcb fmt

* Fix CI for KiCad 10 symbols and examples

* Fix symbol library fallback and NetTie defaults

* Use versioned KiCad parts index URL

* Include stdlib assets in frozen dependency materialization

* fix: bump W25Q128JVE dep

* Bundle KiCad split symbols granularly

* Remove flash module from workspace test board

* Update publish snapshots

* chore: bump @stdlib dependencies

* Fix Crystal compatibility for KiCad 9 symbols
2026-06-09 17:22:27 -04:00
Akhil Velagapudi b2e725caf2 Update docs for hydrated dependency manifests (#862) 2026-06-02 10:07:38 -04:00
Akhil Velagapudi 4413c9d4d9 Deprecate [workspace.members] (#852)
* Hydrate V2 deps during migrate

* Fix mixed hydrated package resolution

* Simplify workspace discovery

* Clean up workspace package discovery naming

* Update stdlib formatting paths
2026-05-27 16:23:57 -04:00
Akhil Velagapudi 6c89730afb Checkout release tag before creating GitHub releases (#835)
* Checkout tag before creating releases

* Fix CI to test checked-out pcbc

* Update build perf benchmark repos

* Fix build perf missing board rows

* Show pcbc changelogs during self update

* Fix e2e pcbc log filters
2026-05-21 11:09:59 -04:00
Akhil Velagapudi b3d193e07d Fix stdlib style warnings (#738)
* Fix stdlib style warnings

* Fix formatting, lints

* Update snapshot
2026-04-17 15:20:01 -04:00
Akhil Velagapudi 56e759e669 Add direction to io(), add input(), output() (#716)
* Add io() direction metadata

* Add input() and output() io sugar

* Move io helpers into stdlib prelude
2026-04-13 10:58:31 -04:00
Akhil Velagapudi c6b84946fa Exclude pcb.sum from package hashes 2026-03-23 22:36:01 -04:00
Akhil Velagapudi e843773185 Clean up noisy .zen comment banners
Remove decorative section banners and other low-value headers.
They added noise without adding meaning and were a waste of tokens.
2026-03-17 10:36:19 -04:00
Akhil Velagapudi cc167be4cb Add Part to stdlib prelude and update all usage (#613) 2026-03-08 11:12:26 -04:00
Akhil Velagapudi 0a000c548e Add stdlib prelude (Power, Ground, NotConnected, Layout, Board) (#606)
Make Power, Ground, NotConnected, Layout, and Board implicitly available
in user .zen files without explicit load() statements. Remove
now-redundant imports across all .zen files, tests, examples, and docs.
2026-03-06 18:45:47 -05:00
Akhil Velagapudi 020ec1dbea Embed stdlib in pcb (#604)
* Embed stdlib in toolchain and materialize via canonical hash

* Manage stdlib in toolchain

* Filter stdlib, update manifests

* Ignore layout log, snapshot files

* Fix wasm stdlib root directory listing

* Simplify stdlib ignore in resolver

* Align stdlib layout-json exclude glob

* simplify wasm stdlib path handling and filtering

* Fix typo: manufactuers -> manufacturers

* Bump stdlib in bench test workspace

* Simplify stdlib fork flow and remove semantics
2026-03-06 17:24:39 -05:00
Akhil Velagapudi 42f83f25f1 Add typed part metadata to Component (#600)
* feat(core): add typed Part and mutable alternatives

* test: cover Part netlist behavior in pcb-zen and pcb

* docs: fold Part spec into docs and update examples

* fix(core): preserve typed part over legacy part property

* feat(core): make part canonical over scalar sourcing fields

* refactor(core): simplify canonical part resolution

* refactor(core): simplify component sourcing flow and add unit tests

* builtin.part -> builtin.Part

* Use netlist snapshot tests for part api
2026-03-03 16:39:25 -05:00
Akhil Velagapudi 8e5b1d962d Deprecate [assets] and add built-in resolution of KiCad-style asset repositories (#573)
* Decouple KiCad libraries with [[workspace.kicad_library]] config

Replace hardcoded KiCad repo coupling with a generic
`[[workspace.kicad_library]]` config model. Each entry declares
symbol/footprint/model repo relationships and an optional http_mirror
template for archive-based fetching.

- Add `[[workspace.kicad_library]]` schema with version, symbols,
  footprints, models, and http_mirror fields
- Extract `kicad_library.rs` module with version selection, repo
  matching, and config validation helpers
- Default to KiCad 9.0.3 libraries when no explicit config is provided
- Route symbol->footprint linkage through matched config entries
  instead of hardcoded alias paths
- Make archive fetching config-driven via http_mirror template
- Remove hardcoded KICAD_ALIASES, kicad9-libraries-version, and
  special-case kicad auto-deps mutation
- Exclude non-manifest KiCad repos from pcb.sum lockfile
- Update docs/spec to reflect new config model

* Embed 3D models into KiCad layout files

Add model_embed_discovery module that embeds referenced 3D model files
directly into .kicad_pcb output. Discovers model references in
footprints, fetches and compresses model data with zstd, and rewrites
model paths to use embedded references. This eliminates the need for
external 3D model files at layout time.

* Simplify KiCad resolution and materialization flow

Consolidate resolution maps, remove implicit KiCad dependency injection,
and simplify the materialization pipeline. Config-driven version
selection replaces scattered version parsing. Assets backcompat hook
provides fallback version hints from legacy [assets] declarations.

* Stage KiCad library files from eval for offline release validation

Move KiCad file staging into copy_sources using eval1's schematic so
validate_build needs no network access. Place files in .pcb/cache with
.pcb-cached markers. Deduplicate sexpr node builders, kicad repo
matchers, and release staging helpers. Flatten nested code in model
embed discovery.

* Simplify KiCad library types and clean up dead code

- Parse KicadLibraryConfig.version as semver::Version at deserialize
  time, eliminating fallible kicad_entry_version and making match/version
  functions infallible
- Move kicad_model_dirs and asset_dep_versions to methods on
  WorkspaceInfo, computed on demand from config
- Remove kicad_model_dirs field from Schematic
- Simplify materialize_asset_deps to derive targets internally
- Format PCB output unconditionally at end of patch_pcb_file
- Remove dead code: package_roots dedup guard, redundant post-fetch
  assertion, trivial vendor config tests, duplicate tests
- Delete superseded kicad-libraries-proposal-v3 spec

* Remove the offline field from NativePathResolver

* Update changelog

* Remove unnecessary result wrapping

* Dedup resolution logic for assets

* Encode schema version in filename

* Search all package_resolutions for kicad asset deps

* Address bot review comments, dedup

* Fix confusing arg name
2026-03-02 01:48:03 +00:00
Akhil Velagapudi 49286912ea Raise error if required config value is not provided (#536)
We consider a config() as required if `optional=False` or if no default
value and no optional value.
2026-02-13 00:04:38 +00:00
Akhil Velagapudi 10da5b302e Use package:// URIs for stable, machine-independent file references (#529)
* Use package:// URIs for stable, machine-independent file references

* Fix pytest failures

* Replace package uris with relative paths in footprint properties

* Tolerate relative path in `footprint=` (instead of package uri)

* Tolerate relative path as "layout_path"

* Address PR comments
2026-02-11 22:25:08 -05:00
Akhil Velagapudi 2090ba42e9 ENG-180: support relative path imports in a workspace (#527)
* ENG-180: support relative path imports in a workspace

* Address underflow

* Address PR comments

* Add changelog entry
2026-02-11 14:54:44 -05:00
Akhil Velagapudi b49839a6d3 Nuke physical ranges (#498) 2026-02-04 21:31:46 +00:00
Akhil Velagapudi 1431874b77 Hyperfinify to reduce noise (#453) 2026-01-20 14:27:22 -05:00
Lenny Khazan f78bb18c1b Make pcb build fast again (#436)
* Add tracing

* Lazy symbol loading

* Parallel eval

* fix symbol inheritance

* fix net id collision

* update tests

* EvalConfig

* edge case fixes

* Add perf tracking

* tweak workflow

* fix cargo cache

* improve tracing

* dependency resolution tracing and optim

* Improve lock contention

* Remove needless module tree copy and file i/o

* More lock contention fixes

* Use mimalloc by default

* use cache for positions

* More micro-optimizations

* LSP improvements

* Add SD

* more runs

* Split up EvalSessionInner locks

* Remove unused allocators

* sqlite connection pool
2026-01-18 01:00:38 -05:00
Akhil Velagapudi d4d417823a Stable layout footprint paths (#398)
* Delete <workspace>/.pcb/cache symlinking for v1 dep resolution

* Symlink ~/.pcb/cache to workspace/.pcb/cache

Results in more stable fp-lib-table

* Patch fp-lib-table to point to vendor/ in release

* Run DRC on staged source layout directory

* Use source layout directly in release instead of separate copy

* Update tests, fix snapshots

* Run layout before release

* Dont ignore test

* Migrate test-workspaces/with-pcb-toml to v2

* Skip symlinks in release zip creation

* Buffer zip write

* Skip availability hydration on un-auth'd pcb bom

* Share cache directory for v2

* Update changelog
2026-01-09 17:43:57 -05:00
Akhil Velagapudi 222cced75e Simplify Component properties -> KiCad footprint properties pipeline (#256)
* Dedup PhysicalValue

We had 2 different PhysicalValue structs in pcb-sch and pcb-zen-core
just to avoid adding starlark deps to pcb-sch. I don't think its worth
it.

* Use rust_decimal_macros

Factor out some duplicate code

* Add proper enum -> String attr support

* Add config("mpn") to generated components for compat

* Format list component properties nicely when exporting to kicad

* Format physical value, enum, list kicad properties in compiler

* Don't rely on __attr__ values

Handle typed, stringified component properties directly.

* Title case kicad properties
2025-10-30 16:08:48 -04:00
Akhil Velagapudi d9bfb02551 Unified caching for load(), Module() (#180)
* Simplify eval error wrapping

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Simply Module() span resolution

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Unified caching for load(), Module()

This simplifies the code and improves the performance substantially.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-23 23:19:39 -04:00
Akhil Velagapudi 8e9c355a3f Disallow dots in names (#150)
* Disallow dots in names

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Bump stdlib

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Simplify is_instance_position

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update snapshot

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-15 18:06:28 -04:00
Akhil Velagapudi d5a2bc10e0 Revert #144, use moved() (#153)
* Revert "Revert net naming changes (#144)"

This reverts commit 51e5066276.

* Don't change net name prefix case

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Register moved() directives for new net names

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Dedup get_component_prefix

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Don't change case of net names

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update netlist tests

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Skip warnings for auto-generated directives

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-14 22:14:19 -04:00
Akhil Velagapudi bb0898dbef Add moved() directive (#152)
* Add pcb:sch comments to test board

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add moved() directive

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Include moved paths in Schematic

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Repair footprints, groups in layout

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update docs

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Compute remapper data *before* processing positions

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add warnings if old path exists or new path doesn't

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add snapshot tests for moved()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-14 21:15:37 -04:00
Akhil Velagapudi 0ca2f604ba Replace buildifier with ruff fmt (#146)
buildifier doesn't support f-strings, which we use in a bunch of places.
We also run fmt after `pcb upgrade`, and it's a bit annoying that it
fails due to a buildifier error.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-08 23:22:10 -04:00
Akhil Velagapudi 0c2c87c338 [DIO-352] Add TestBench() support (#129)
* Add TestBench

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add checks

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add net -> ports dict

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add port -> pin dict

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Provide component properties to check fns

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update spec, fix spans on check failures

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use check(), error() to fail checks instead of return value

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add ModuleView to group check fn args

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add component_values field, expose more typed values

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fully switch to ComponentValues in check fn

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use ModuleValue directly

Delete ModuleView

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add at() support for module which can return sub-module or component

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Rename testbench.rs -> test_bench.rs

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Move bench_test_cases to test-workspaces/bench

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Print "checks passed" log to eprintln

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Make .nets and .components functions

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add schematic to graph conversion, path finding

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add external net support to path finding

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Don't use bool ret for matchers

Use error(), check()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add path.matches()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add samples

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Moar samples

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update spec.mdx

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Consolidate seq matchers test code

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add suppress_errors

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add lm5163q1 example

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add test_cases, inputs arg to check fns

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update bmi270 example to use path.matches()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use more path.matches()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add span for path.matches()

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add pcb test

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Print stuff only to stderr

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Output test results in TAP or json

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* "testbench" -> "test_bench"

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add table output format for pcb test

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Tolerate non-callable inputs to "checks"

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add tuple checks support for renaming check fns

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add snapshot tests

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Make max_depth optional

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-09-04 22:30:30 -04:00
Akhil Velagapudi 44c73baf2d [DIO-319] Add board config to pcb.toml, pcb info (#92)
* Add board config to pcb.toml, pcb info

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Choose first board (when sorted) as fallback default

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add secondary heuristics pass to detect boards without pcb.toml

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update snapshots

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Don't allow malformed pcb.toml

Empty pcb.toml is fine.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Don't copy .pcb/cache into test fixture

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Replace test-workspace with snapshot tests of pcb info

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 15:20:16 -07:00
Akhil Velagapudi 9a1930c2c5 pcb cli-level testing (#96)
* Add sandbox

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add dir snapshotting

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add branch support, snapshot_dir

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add snapshot testing of stdout/stderr

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Only use local files for workspace root detection

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add bom, release tests

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add pcb vendor snapshot test

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Sanitize linux tmp dir paths

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Ignore some tests on Windows

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Reuse dep fetching code from pcb-zen

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix download race condition

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Bump lock file

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Specify default branch

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Suppress 3d export logs to stdout

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-21 13:52:38 -07:00
Akhil Velagapudi 1ee83c6e7e Initial implementation of interface subclasses + auto-promotion (#89)
* Add serialize(), deserialize() builtins for debugging

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add field(), __post_init__ to interface()

Also, add better print() behavior.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add interface/net promotion

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Remove Cargo.toml patch

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix example

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix test workspace

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add interface arg type checking

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Update spec.mdx

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Allow `using(Net)`

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-20 09:27:39 -07:00
Akhil Velagapudi f54aa468cc Add hierarchical package alias resolution (#91)
Deeper directories taking priority.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-20 08:50:47 -07:00
Akhil Velagapudi b9d101e129 Fix package resolution in pcb vendor/release (#80)
* Add [packages] to vendor/release test case

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix package resolution in pcb vendor/release

The TrackingLoadResolver middleware couldn't properly resolve packages.
To fix, eliminate the middleware entirely and enhance CoreLoadResolver
to handle all the necessary tracking. This is likely to reduce future
bugs as well.

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use public kicad package

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-18 14:32:31 -07:00
Akhil Velagapudi 23442e6577 Only detect workspace root if pcb.toml has [workspace] (#75)
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-15 15:28:37 -07:00
Akhil Velagapudi b97d9f053b [DIO-302] Generate 3d models for release (#73)
* Generate 3d models for release

Release file structure:
/a614869/3d
├── model.step
├── model.svg
└── model.wrl

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Ignore spurious kicad-cli errors

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-15 12:47:52 -07:00
Akhil Velagapudi 1636bc18f7 [DIO-300] Add pcb release command (#69)
* Add pcb release command

Intentially spartan in terms of flags/arguments. All that's needed is
the path to the .zen file.

To test:
cargo run -- release crates/pcb/test-workspace/boards/TestBoard.zen

Implemented:
- Workspace root detection (even without pcb.toml)
- Git-based versioning (e.g. tag > commit hash > dirty commit hash)
- Zen source files copied into release dir (release-dir/src)
- Dependencies are vendored into release dir (release-dir/src/vendor)
- Unmatched bom is generated into release dir (release-dir/bom)
- KiCad layout dir is copied into release dir (release-dir/layout)
- Metadata file is generated into release dir (release-dir/metadata.json)
- Generated artifacts are stored in .pcb/ dir (for now) and not uploaded

TODO:
- Upload the release bundle to API server
- Add a --dry-run to generate release bundle but not upload (similar to
  cargo)
- Use the vendor/ dir for dependency resolution for deterministic builds
- Add pcb vendor subcommand, --offline flag for build/layout
- Add more release artifacts (e.g. gerbers, odb, etc.)

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Fix windows compat

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Add support, test-coverage for workspace-relative loads

Assume that pcb.toml is needed for workspace-relative loads

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

* Use workspace root .pcb dir for staging releases

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>

---------

Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
2025-08-14 18:46:43 -07:00