Local labels on a sheet need to be able to connect just to other labels
for intersheet routing. This was mistakenly disallowed to check to for
dangling local labels
Background async library loading workers hold raw LIBRARY_TABLE_ROW
pointers into the LIBRARY_TABLE::m_rows vector. When ProjectChanged()
calls LoadProjectTables(), it destroys the old LIBRARY_TABLE objects
via unique_ptr replacement.
The workers were not aborted until after the tables were destroyed,
creating a window where workers could access freed memory.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23480
* add VARIANT and VARIANT_DESC to the list of known vars in the drawing
sheet editor.
* cache variant and variant description in respective objects.
* expand the respective text variables when building the drawing sheet.
* keep the cached variant and its description up-to-date when selecting
a variant in the GUI.
* pass variant and its description to the plotters.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23430
Extend the schematic Properties panel dynamic field handling to cover
SCH_SHEET items in addition to SCH_SYMBOL items.
This allows custom subsheet attributes added in Sheet Properties to
appear in the Properties panel.
Libraries with permanent load errors (LOAD_ERROR) were re-added to
m_pending_load_libraries on every timer tick, creating an infinite
retry loop. Each iteration called m_lazyLoadHandler() which triggered
Regenerate(), rebuilding the tree and resetting scroll position every
second.
Skip LOAD_ERROR libraries instead of retrying them, and only call the
lazy load handler when at least one library was actually loaded in the
current iteration.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23455
Savers now serialize to in-memory HISTORY_FILE_DATA on the UI thread,
then Prettify + file writes + git stage/diff/commit run on a background
thread via GetKiCadThreadPool(). An atomic skip-if-busy flag prevents
overlapping saves; WaitForPendingSave() ensures clean shutdown.
Extracted FormatBoardToFormatter and FormatSchematicToFormatter so
SaveToHistory can serialize without touching disk. PROJECT savers use
sourcePath for file-copy semantics since project files are small.
choose ResolveExcludedFromBOM() over GetExcludedFromBOM() to test refs
for exclusion from BOM in order to honor a rule area's "exclude from
BOM" flag for all refs inside that area.
closes#23411.
Variant add, delete, rename, and copy operations in the Bulk Edit
Symbol Fields dialog (and toolbar variant selector) modify the
schematic data model but did not call OnModify(), so closing eeschema
afterward would not prompt to save changes.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23410
Parse variant data from Altium .PrjPcb project files and
apply it to both schematic symbols and board footprints
during import. Each ProjectVariant section is read as an
INI group, and per-component variation entries are mapped
to KiCad variant structures on the matching designators.
A malicious or corrupt ZSTD frame content-size header could cause an
unbounded allocation. Clamp the expected size against the provider's
max_download_bytes (if available) or a 64 MB fallback before calling
resize().
When multiple top-level sheets in a multi-root schematic reference the
same sub-sheet file, each sub-sheet must share a single SCH_SCREEN
object. Previously, loadHierarchy() only searched the current root
sheet's hierarchy for an existing screen, so screens loaded by earlier
top-level sheets were never found. This caused each top-level sheet to
create its own copy of the shared sub-sheet's screen, leading to data
loss on save as later writes would overwrite earlier ones.
Add m_loadedRootSheets to SCH_IO_KICAD_SEXPR to track root sheets from
prior LoadSchematicFile() calls within the same IO instance. During
loadHierarchy(), after the existing search fails, also search through
previously loaded root sheets. The cache is cleared when the SCHEMATIC
pointer changes, preventing stale references when the IO object is
reused for unrelated loads.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23403
Extract duplicated helpers from remote provider files into shared
utilities. Split sendRpcMessage into purpose-specific functions.
Implement standard nonce-based exchange for re-auth. Provide
additional models for more efficient model/symbol/fp/etc using
external URLs. This allows us to better handle connection errors,
retries and large data packets.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23381
The XOR of the variant exclude from BOM while technically correct gets
performed on every load which makes the intent of the change less clear.
The inversion of the state only needs to be performed when the file format
is older than the version defined in MR2485. Also add a comment to let
developers know why this change was made.
MR https://gitlab.com/kicad/code/kicad/-/merge_requests/2485
This is not necessary, and since 10.0 causes invalid ERC
for several reasons:
1) Library loading now relies on grabbing the project path
via Pgm().GetSettingsManager()
2) Bus alias definitions now live in the project file, also
loaded through Pgm()
Also fix an issue where the LoadSchematic helper would wipe
out the bus aliases because `SCHEMATIC::Reset` could never
be called after the initial creation, but was via
`CreateDefaultScreens`.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23326
The S-expression serializer only writes variant attributes that differ
from the symbol/sheet default values. When deserializing, the parser
created variants with all-false attribute defaults from the VARIANT
constructor. This meant any variant attribute matching the owner's
default was silently lost on save/reload.
Call InitializeAttributes() on each variant immediately after
construction in the parser so that unparsed attributes inherit the
correct default values from the owning symbol or sheet.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23347
A local label that only connects to other labels or hierarchical sheet
pins without any component pin on the same sheet serves no local purpose
and is likely mislabeled. Extend the existing bus-member check to all
local labels so that ercCheckLabels() flags these cases as
ERCE_LABEL_NOT_CONNECTED.
The allPins > 1 guard prevents double-reporting with
ERCE_LABEL_SINGLE_PIN which already covers the allPins == 1 case.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23346
cacheLib() was unconditionally calling Load() for new caches even when
buffering was enabled, introduced by e013691d02 to fix issue #22191.
This broke "Save Library As" because the target file doesn't exist yet,
causing Load() to throw IO_ERROR. The exception was caught but no
symbols were added to the cache, resulting in an empty file
Additionally, the unbuffered library save path was passing the library
nickname instead of the target file path to the plugin's LoadSymbol/
SaveSymbol calls. While this was always wrong, it was masked before
e013691d02 because buffering mode skipped Load() entirely.
Fix cacheLib() to only call Load() for new caches when the library file
actually exists on disk, and fix the unbuffered save path to use the
target file path.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/23337
The BOM revision in IPC-2581 export was hardcoded to "1.0"
instead of reflecting the actual design revision.
The project file stores two separate fields: bomRev for
explicit user overrides set in the PCBnew export dialog or
via --bom-rev on the CLI, and schRevision for the value
auto-propagated from eeschema.
AddDrawItem() called cachePinCount() and cacheChooserFields() after
adding items, but RemoveDrawItem() did not. This left stale cached
values after pin or field removal, causing incorrect pin counts and
stale chooser field data.
The non-const SCH_SHEET::GetField(FIELD_T) auto-creates missing
fields via emplace_back, so the null check could never be true.
Use FindField() instead, which returns nullptr when the field is
absent, making the validation check actually work.
cacheShownDescription() computed shownText but never assigned it to
m_shownDescriptionCache, causing GetShownDescription() to always
return an empty string. Symbol descriptions in the chooser and
tooltips were blank as a result.
Connector pins (e.g. J12-1 through J12-53) were imported as
separate single-pin symbols instead of units of one shared
symbol. Add BuildMultiUnitConnectorSymbol which creates a
multi-unit LIB_SYMBOL where each unit has the connector decal
graphics and one pin with the correct number.
Multi-gate parts like TL082 (U1-A, U1-B) appeared as separate
symbols because AddHierarchicalReference was called with the
unsuffixed reference "U1-A" instead of the stripped "U1".
Also move the connector SetRef call to after ApplyPartAttributes,
which only strips alphabetic gate suffixes and would otherwise
override the base reference back to "J12-1".
When a net subgraph name-matched a bus candidate, the absorption
condition at processSubGraphs only checked that the outer
connection was not a bus. It did not check whether the candidate
was a bus, so a net could absorb a bus subgraph. Later, when
resolving bus parents through the m_absorbed_by chain, the
absorbed-into subgraph had a net driver connection instead of a
bus, triggering the assertion in matchBusMember.
Add a check that the candidate is also not a bus before allowing
absorption. Also replace the assertion in matchBusMember with a
null return as defense in depth, since all callers already handle
null.