test(basics): fix and re-enable realloc + cross-program-invocation native#52
Merged
Merged
Conversation
…native Both native examples were excluded in .ghaignore as "build and test error". The real cause was the LiteSVM Rust tests pointing include_bytes!() at target/deploy/<program>.so, but build-and-test compiles the program .so into tests/fixtures/ — so cargo test failed to compile (file not found). - realloc: fix the include_bytes!() path to tests/fixtures/realloc_program.so. - cross-program-invocation: fix both include_bytes!() paths to tests/fixtures/. Additionally, `hand` depends on `lever` with the `cpi` (= `no-entrypoint`) feature, so building the whole workspace at once unified that feature onto `lever` and produced an entrypoint-less lever.so (896 bytes) that LiteSVM rejected with InvalidAccountData. build-and-test now builds each program separately so lever.so keeps its entrypoint. Also remove the false-green / localnet-only TypeScript suites (realloc's node:test-under-ts-mocha suite plus its now-unused ts/ client helpers, and cpi's localnet test), strip their JS tooling, and drop both examples from .github/.ghaignore so CI builds and tests them via the LiteSVM cargo tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
basics/realloc/nativeandbasics/cross-program-invocation/nativewere excluded in.github/.ghaignoreas "build and test error". I investigated — the real cause was their LiteSVM Rust tests pointinginclude_bytes!()attarget/deploy/<program>.so, whilebuild-and-testcompiles the program.sointotests/fixtures/. Socargo testfailed to even compile (file not found).Fixes
realloc/nativeinclude_bytes!()path →../../tests/fixtures/realloc_program.so. Test passes.cross-program-invocation/nativeinclude_bytes!()paths →tests/fixtures/.handdepends onleverwith thecpi(=no-entrypoint) feature. Building the whole workspace in onecargo build-sbfunified that feature ontolever, producing an entrypoint-lesslever.so(896 bytes) that LiteSVM rejected withInvalidAccountData.build-and-testnow builds each program separately, solever.sokeeps its entrypoint (81 KB) and the CPI test passes.Both
node:test-under-ts-mochasuite (plus its now-unusedts/client helpers); cpi's was a localnet-only test (reads~/.config/solana/id.json). Strip their JS tooling, regenerate the lockfiles, and rewirebuild-and-testto just build the fixtures the LiteSVMcargo testconsumes..github/.ghaignoreso CI builds and tests them.All verified locally against the CI toolchain (Solana 3.1.14 / platform-tools v1.52): full
install → build-and-test → cargo testis green for both.realloc-program(a root workspace member) also passescargo fmt --check+cargo clippy -D warnings.https://claude.ai/code/session_013dpnF6uSGWXjkJJZseqzcP
Generated by Claude Code