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

Support 128-bit system API for cycles #54

Merged
merged 7 commits into from
Nov 1, 2021
Merged

Conversation

marcin-dziadus
Copy link
Contributor

No description provided.

@marcin-dziadus marcin-dziadus marked this pull request as ready for review October 29, 2021 16:33
Copy link
Contributor

@nomeata nomeata left a comment

Choose a reason for hiding this comment

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

Nice work

CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "${nixpkgs.llvmPackages_11.lld}/bin/lld";
RUSTFLAGS = "-C link-arg=-s"; # much smaller wasm
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "${nixpkgs.llvmPackages_12.lld}/bin/lld";
RUSTFLAGS = "-C link-arg=-s -C target-feature=+multivalue"; # much smaller wasm
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m surprised this work, given rust-lang/rust#73755, but 🤷🏻 :-)

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 was quite surprised too, when I found it working. I gave it a go and I did not regret. :)

However, there is one last problem. Even though the produced WASM is correct, the compiler spits out following warnings: "warning: extern block uses type (u64, u64), which is not FFI-safe". We can mitigate this at a price of obfuscating types by using a tuple struct, i.e. Pair(u64, u64). More radical option is to disable the troublesome check. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

For ic-ref-test, I have no strong opinions. If using a tuple struct works, go head – what matters is what happens on the Wasm level.

src/IC/Canister/Imp.hs Outdated Show resolved Hide resolved
src/IC/Canister/Imp.hs Outdated Show resolved Hide resolved
src/IC/Test/Agent.hs Outdated Show resolved Hide resolved
src/IC/Test/Spec.hs Outdated Show resolved Hide resolved
@marcin-dziadus
Copy link
Contributor Author

Thanks for the review, @nomeata!

Copy link
Contributor

@ielashi ielashi left a comment

Choose a reason for hiding this comment

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

LGTM. cc @AlexandraZapuc

@marcin-dziadus marcin-dziadus merged commit 81dce50 into master Nov 1, 2021
@marcin-dziadus marcin-dziadus deleted the marcin/cycles branch November 1, 2021 09:35
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