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

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

ninegua
Copy link
Member

@ninegua ninegua commented Jan 11, 2025

The following command currently failed to compile the registry canister if running 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 running from the top-level directory, but would produce incorrect 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
@ninegua ninegua marked this pull request as ready for review January 13, 2025 00:50
@ninegua ninegua requested review from basvandijk and a team January 13, 2025 00:51
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

If this pull request affects the behavior of any canister owned by
the Governance team, remember to update the corresponding
unreleased_changes.md file(s).

To acknowldge this reminder (and unblock the PR), dismiss this
code review by going to the bottom of the pull request page, and
supply one of the following reasons:

  1. Done.

  2. No canister behavior changes.

@ninegua ninegua dismissed github-actions[bot]’s stale review January 14, 2025 03:49

No canister behiavor changes.

@ninegua ninegua added this pull request to the merge queue Jan 15, 2025
Merged via the queue into master with commit d90e934 Jan 15, 2025
43 checks passed
@ninegua ninegua deleted the paulliu/fix-wasm32-cargo-build branch January 15, 2025 09:50
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.

2 participants