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

Allow cw-orch wasm compilation without features #342

Conversation

Buckram123
Copy link
Contributor

@Buckram123 Buckram123 commented Mar 11, 2024

This PR aims to allow adding derive attributes for wasm targets, by not generating any code.

Interface can be removed as well.
Users can also use the #[cfg(not(target_arch = "wasm32"))] to shield the interface instead of the interface feature

Copy link

cloudflare-workers-and-pages bot commented Mar 11, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 17e108f
Status: ✅  Deploy successful!
Preview URL: https://0c8feadd.cw-orchestrator.pages.dev
Branch Preview URL: https://misha-orc-85-cw-orchqueryfns.cw-orchestrator.pages.dev

View logs

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 91.11111% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 66.8%. Comparing base (40a8a0f) to head (17e108f).
Report is 1 commits behind head on main.

Additional details and impacted files
Files Coverage Δ
contracts/counter/src/msg.rs 75.0% <100.0%> (ø)
contracts/mock_contract/src/lib.rs 97.9% <100.0%> (+1.0%) ⬆️
contracts/mock_contract/src/msg_tests.rs 94.8% <100.0%> (ø)
packages/cw-orch-contract-derive/src/lib.rs 93.0% <100.0%> (+0.6%) ⬆️
packages/cw-orch-fns-derive/src/execute_fns.rs 99.2% <100.0%> (+<0.1%) ⬆️
packages/cw-orch-fns-derive/src/query_fns.rs 94.9% <100.0%> (+0.3%) ⬆️
contracts/mock_contract/src/custom_resp.rs 0.0% <0.0%> (ø)
contracts/mock_contract_u64/src/lib.rs 83.5% <62.5%> (+0.1%) ⬆️

#[cfg(feature = "daemon")]
pub mod daemon;

#[cfg(not(target_arch = "wasm32"))]
mod error;
#[cfg(feature = "osmosis-test-tube")]
pub mod osmosis_test_tube;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should either arch-flag all the exports or only the non-featured ones (if we assume a user doesn't enable the feature in their wasm env).

Right now daemon is arch-flagged but test-tube is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think arch-flagging features would work as well!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, that's a mistake yes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flaggin features doesn't seem to work : rust-lang/cargo#1197

@Kayanski Kayanski merged commit f5ff6fb into main Mar 19, 2024
18 checks passed
@Kayanski Kayanski deleted the misha/orc-85-cw_orchqueryfnsexecutefns-attributes-fails-to-expand-with branch March 19, 2024 15:38
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.

3 participants