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

fix: cargo build registry-canister for wasm32 target #3408

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ninegua
Copy link
Member

@ninegua ninegua commented Jan 11, 2025

The following command would fail to compile the registry canister if run from the /ic/rs/registery/canister sub-directory:

cargo build --profile canister-release --target wasm32-unknown-unknown --bin registry-canister

The fix is to make sure the feature getrandom/custom is enabled.

Note that the above command would succeed if run from the top-level directory, but would produce wrong wasm binary. This is because cargo would bring in global dependencies that enable both getrandom/custom and getrandom/js features, and the latter will lead to wasm binaries having unwanted imports (See #3309 for more details).

Since this problem does not affect bazel builds, this fix is only relevant to cargo.

@github-actions github-actions bot added the fix label Jan 11, 2025
@ninegua ninegua changed the title fix: Enable getrandom/custom feature manually for registry canister fix: cargo build registry-canister for wasm32 target Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant