fixup: Avoid host build of SBPF program test crates (#1711)#2145
Merged
illia-bobyr merged 1 commit intoanza-xyz:masterfrom Jul 16, 2024
Merged
Conversation
In commit da6f7f2 Author: Alexander Meißner <AlexanderMeissner@gmx.net> Date: Tue Jun 18 23:10:40 2024 +0200 Refactor - Avoid host build of SBPF program test crates (anza-xyz#1711) we changed the test selection process slightly, switching from the `test-bpf` feature to `sbf_rust` feature, and marking individual tests, rather then the whole module. The problem is that now when I run cd program/sbf ../../cargo check --bins --tests I see unused warnings for all the modules imported by the `simulation` and `sysvar` modules. At the later are, effectively, empty when `sbf_rust` is not set. Moving the config flag back to the module level seems to do the intended thing and removes the warnings. Alternatively, we could mark the `use` statement with an explicit `#[cfg(feature = "sbf_rust")]`, but it seems that all the tests are designed to be run only when `sbf_rust` is set.
Lichtso
approved these changes
Jul 16, 2024
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.
Problem
In
commit da6f7f2
Author: Alexander Meißner AlexanderMeissner@gmx.net
Date: Tue Jun 18 23:10:40 2024 +0200
we changed the test selection process slightly, switching from the
test-bpffeature tosbf_rustfeature, and marking individual tests, rather then the whole module. The problem is that now when I run../../cargo check --bins --tests
I see unused warnings for all the modules imported by the
simulationandsysvarmodules. At the later are, effectively, empty whensbf_rustis not set.Summary of Changes
Moving the config flag back to the module level seems to do the intended thing and removes the warnings. Alternatively, we could mark the
usestatement with an explicit#[cfg(feature = "sbf_rust")], but it seems that all the tests are designed to be run only whensbf_rustis set.