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

Add support for cargo features to playground server #96

Closed
mcintyre94 opened this issue Dec 6, 2022 · 1 comment
Closed

Add support for cargo features to playground server #96

mcintyre94 opened this issue Dec 6, 2022 · 1 comment

Comments

@mcintyre94
Copy link
Contributor

In Seahorse when using Pyth, it is an optional dependency that is enabled using anchor build -- --features pyth-sdk-solana

This enables code in the generated src/lib.rs:

    #[cfg(feature = "pyth-sdk-solana")]
    pub use pyth_sdk_solana::{load_price_feed_from_account_info, PriceFeed};

I think for Playground to compile this code we'd need to have it pass the feature flag.

I think ideally we should be able to pass features: ["pyth-sdk-solana"] to the /build server, alongside rust files + uuid, and then have the build server include this feature flag when building

One thing I'm not sure about is how dependencies work in the build server, because we don't pass cargo.toml in. I guess the build server would need to detect the pyth dependency only if that feature flag is passed in?

@mcintyre94
Copy link
Contributor Author

I'll close this, we don't need this for seahorse features any more and doesn't seem to have been any other interest in the idea. Probably not worth doing!

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

No branches or pull requests

1 participant