Skip to content

Refactor - Splits SBPF program test crates into deps to remove cfg feature program#1687

Merged
Lichtso merged 1 commit intoanza-xyz:masterfrom
Lichtso:refactor/remove_sbpf_program_cfg_feature
Jun 12, 2024
Merged

Refactor - Splits SBPF program test crates into deps to remove cfg feature program#1687
Lichtso merged 1 commit intoanza-xyz:masterfrom
Lichtso:refactor/remove_sbpf_program_cfg_feature

Conversation

@Lichtso
Copy link
Copy Markdown

@Lichtso Lichtso commented Jun 11, 2024

This PR is split off from #1581.

Problem

We want to use the normal cargo workspace build procedure instead of using a build.rs script.
Currently some test program crates export a part of their interface to others (for CPI) and to do so they utilize a cfg feature program. That cfg feature toggles if the crate is build as a dependency / lib for another crate or as a standalone test program. However, with workspaces that won't work anymore because in a workspace each crate can only be build with one feature set. Additionally, some program test crates are already split into a dep crate, so it is currently somewhat inconsistent.

Summary of Changes

Splits the following into a separate dep crate each:

  • "invoke"
  • "invoked"
  • "realloc"
  • "realloc-invoke"

For each this:

  • Adjusts the crate-type and dependencies in the Cargo.toml accordingly
  • Removes program cfg feature
  • Moves processor.rs into the lib.rs of the existing crate
  • Moves instructions.rs into the lib.rs of a new crate

Also cleans up the following without splitting (as they were never used as dependencies elsewhere):

  • "log_data"
  • "sibling_instructions"
  • "sibling_inner_instructions"

@Lichtso Lichtso force-pushed the refactor/remove_sbpf_program_cfg_feature branch 3 times, most recently from 49ce3ca to f9475fa Compare June 11, 2024 13:30
@Lichtso Lichtso force-pushed the refactor/remove_sbpf_program_cfg_feature branch from f9475fa to cd39bfa Compare June 11, 2024 16:12
@Lichtso Lichtso requested a review from dmakarov June 11, 2024 18:47
@Lichtso Lichtso merged commit d5b924f into anza-xyz:master Jun 12, 2024
@Lichtso Lichtso deleted the refactor/remove_sbpf_program_cfg_feature branch June 12, 2024 12:58
samkim-crypto pushed a commit to samkim-crypto/agave that referenced this pull request Jul 31, 2024
…feature `program` (anza-xyz#1687)

Splits crates into "dep"s to remove cfg feature "program".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants