Skip to content

Conversation

majabbour
Copy link
Contributor

@majabbour majabbour commented Jul 21, 2022

Running Cargo test compiles the oracle into native (none-bpf) code, which causes a linker error when linking with the bpf C oracle.

This PR makes it so that we do not link on cargo test. I believe this is reasonable because unit tests should not involve FFI calls. It makes more sense to unit test each component in the language it is written in. If we think we want the linking to happen, then we would need to understand how to compile the c oracle into a native architecture as well, and link to that when we run cargo test. That seems like unnecessary work to me (specially with the issues around solana and libc compatibility), but happy to do it if we believe it's useful.

@majabbour majabbour changed the title link with c only when targer is bpf link with c only when target is bpf Jul 21, 2022
@majabbour majabbour requested a review from guibescos July 21, 2022 14:58
@guibescos guibescos merged commit 0fc4caf into main Jul 21, 2022
@guibescos guibescos deleted the fixing-cargo-test branch July 21, 2022 15:32
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