Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixup: Avoid host build of SBPF program test crates (#1711) #2145

Conversation

ilya-bobyr
Copy link

Problem

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 (#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.

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 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.

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.
@ilya-bobyr ilya-bobyr requested a review from Lichtso July 16, 2024 06:15
@ilya-bobyr ilya-bobyr merged commit 62a1827 into anza-xyz:master Jul 16, 2024
40 checks passed
@ilya-bobyr ilya-bobyr deleted the pr/programs-sbf-no-unused-warnings-for-tests branch July 16, 2024 19:47
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