Skip to content

Indexes 8: Fixes the spk build or mkb crash with indexes enabled#1355

Open
dcookspi wants to merge 1 commit intoindex-7-lockfile-for-indexgenfrom
index-8-spk-build-fix
Open

Indexes 8: Fixes the spk build or mkb crash with indexes enabled#1355
dcookspi wants to merge 1 commit intoindex-7-lockfile-for-indexgenfrom
index-8-spk-build-fix

Conversation

@dcookspi
Copy link
Copy Markdown
Collaborator

@dcookspi dcookspi commented Apr 16, 2026

This fixes a crash that happens when using spk build or spk mkb with indexes enabled. spk would panic because downstream_build_requirements() was not implemented for IndexedPackage objects. Implementing this method using the existing index data fixed the problem.

This also refactors the existing downstream_runtime_requirements() method to use a filter function based shared downstream_requirements() method - along the same lines as the exisitng v0/PackageSpec does. Both downstream_*_requirements methods are added to the flatbuffer index tests.

This is the 8th of the chained PRs for adding indexes to spk solves:

  1. Indexes 1: Change Package and related traits to not return references to fields #1336
  2. Indexes 2: Add new_unchecked() constructors to spk schema objects #1337
  3. Indexes 3: Adds flatbuffers schema and SolverPackageSpec for indexes to spk #1338
  4. Indexes 4: Adds Indexes for SPK repositories #1339
  5. Indexes 5: Adds spk repo index subcommand for index generation and updates #1340
  6. Indexes 6: Changes version_filter field in index schema #1344
  7. Indexes 7: Adds a lock file around index generation and updates #1354
  8. this PR
  9. Indexes 9 - Adds messaging on package events to kafka #1356

@dcookspi dcookspi self-assigned this Apr 16, 2026
@dcookspi dcookspi added bug Something isn't working SPI AOI Area of interest for SPI pr-chain This PR doesn't target the main branch, don't merge! labels Apr 16, 2026
@dcookspi dcookspi requested review from jrray and rydrman April 16, 2026 01:10
@dcookspi dcookspi force-pushed the index-8-spk-build-fix branch from 68c823f to 8d8583a Compare April 16, 2026 01:13
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 68.29268% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/spk-schema/src/v0/indexed_package.rs 62.85% 13 Missing ⚠️

📢 Thoughts on this report? Let us know!

Implements downstream_build_requirements function for IndexedPackage.

Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
@dcookspi dcookspi force-pushed the index-8-spk-build-fix branch from d2119c4 to 8566af4 Compare May 1, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working pr-chain This PR doesn't target the main branch, don't merge! SPI AOI Area of interest for SPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants