* Fix fetching a commit from a non-default branch
Previously, we would do a shallow clone of the default branch and then
attempt to checkout the commit. This doesn't work if the commit is not
on the default branch.
Also, allow specifying short hash (len 7).
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Remove left over dbg
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Don't cache effective workspace root
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Drop tracked_local_files, and track local files in path_to_spec
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Remove workspace_root_cache
This was a premature optimization. Unclear whether it actually helps,
but has potential to introduce bugs.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Refactor diagnostics for warnings support
- Add render trait
- Render warnings after errors
- Reuse build code across build, layout
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Delete bundle
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Fix clippy lints
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Add git ref metadata
3 stages to fetch_remote:
- Ensure remote is in cache
- Add appropriate symlinks
- Classify + store ref metadata
Some code cleanup:
- Factored out some git clone dupe code
- Centralized git operations in git.rs
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Warn on unstable refs
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Add "-Dwarnings" flag to error on warnings
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Warn on unstable refs in Module()
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Add snapshot tests for warnings
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Fix span detection for chained Module()
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Add ResolveContext, dedup resolve code
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Use spec history for better alias warnings
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Add pcb.toml spans
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Add type-erased error storage to Diagnostic
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Fix bug with load() span detection
The previous logic would just attempt to match by path, but if there are
multiple load() statements in a single file with the same path, then
find_load_span_for_path with always return the first.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Added diagnostics passes
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Add LSP-specific pass to filter out some warnings
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Fix rebase conflicts
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Fix unstable ref detection logic
If we clone by tag and the tag exists in the git repo, it's a stable
ref. Same with commit.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Build after release in snapshot tests
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Copy all tracked files to release src/
Remove the filtering that I added, it's not needed. This can be further
simplified in the future by merging tracked_local_files into
path_to_spec.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Do offline build of staged sources
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Do --offline builds in release + build tests
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Error on local deps outside workspace when vendoring
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Track local pcb.toml files
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* sync zones and text
* add initial test for zone sync
* add zones to groups
* simpler zone test
* fix zone sync
* fix net determinism
* add more interesting test
* hack: amend tests with (0,0) positioning for now
* wip: fix nets for zones
* hack: keep old tests to make sure we don't mess up
* add zone sync
* fix sync graphics
* add complex test
* deterministic snapshot
* fix snapshots with no files
* add graphics test
* add timout
* bump timout
* reduce complexity
* move methods to virtual item
* add graphics groups
* use Duplicate
* add hatching to complex test
`pcb info` would mix and match absolute vs relative paths for workspace
root and board .zen paths. Enforce consistent behavior:
- Workspace root: always show full canonical path
- Board paths: always relative to workspace root
Also, removed the removed redundant directory field.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Add regression test for "//" dep in local path
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Resolve "effective_workspace_root" (with cache)
Which is different from overall "workspace_root".
Do this once at the top instead of at multiple downstream sites.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Use smart rust cache
Out cache sizes are blowing up:
Cache Size: ~8914 MB (9346691088 B)
"C:\Program Files\Git\usr\bin\tar.exe" -xf C:/a/_temp/277318a1-9141-472d-bf1b-4d0461835b0b/cache.tzst -P -C C:/a/pcb/pcb --force-local --use-compress-program "zstd -d"
Cache restored successfully
Cache restored from key: Windows-cargo-02b001115c33129b2426bd7db7faa11329497685bfa1d1e328c20e41bc781dca
Which is slowing down builds. Just fetching cargo cache took 6 mins.
Swatinem/rust-cache has much better default behavior:
- Cleans dependencies no longer used
- Cleans incremental build artifacts
- Cleans anything older than 1 week
It also only caches dependencies (and their built artifacts). Caching
workspace crates is not that useful.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Reuse build pcb for stdlib testing
Also use actions/checkout for faster cloning.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Mark vendor/ dir as alias root
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Don't consider pcb.toml files irrelevant
Use more LoadSpec helpers.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Track pcb.toml files in path_to_spec
This is enough for `pcb vendor` to pick up these files and copy them to
the vendor/ dir.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Use FileProvider::exists
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Switch to larger github runners
The "xlarge" in "macos-15-xlarge" doesn't actually mean extra large. The
"x" indicates arm64 as opposed to Intel.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Remove dep on deprecated actions-rs/toolchain@v1
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Use copied layout files as source for cad export
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Include pads, silkscreen, soldermask in CAD
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* Patch text vars in .kicad_pro file
This is used for CAD export for some reason over the .kicad_pcb file.
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
---------
Signed-off-by: akhilles <akhilvelagapudi@gmail.com>
* 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>