You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codegen(wasm): Crypto externs from #746 compile to unsupplied host imports (LinkError at load) #822
architectureStructural/system-level shape and runtime behaviourbindingsABI, FFI, WASM, and cross-language interop surfacesbugSomething is broken or behaves incorrectlyenhancementNew capability or improvement to existing behaviourscope:repoConfined to this repository
Follow-up to #746 (closed by #816, which covers the JS targets).
Gap
On the core-WASM target, the 6 Crypto externs from #816 (sha256, hmac_sha256, base64url_encode, base64url_decode, rsa_sign_pkcs1_sha256, rsa_verify_pkcs1_sha256) compile to host imports such as Crypto.sha256. No host shim in this repo supplies them. A program that uses one compiles, then fails at instantiation with a LinkError.
Repro:
use Crypto::{ sha256 };
pub fn main() -> Int { let d = sha256([1, 2]); len(d) }
affinescript compile succeeds. The module imports Crypto.sha256.
Problem: On the core-WASM target, the 6 Crypto externs from #816 (sha256, hmac_sha256, base64url_encode, base64url_decode, rsa_sign_pkcs1_sha256, rsa_verify_pkcs1_sha256) compile to host imports such as Crypto.sha256. No shim in the repo supplies these imports, so affinescript compile succeeds and instantiation then fails with LinkError.
Expected: The program either fails at compile time with UnsupportedFeature or runs, depending on which of options 1–3 is chosen.
Missing: which option to pursue (or which mix, such as 3 plus 1 for RSA), and the host runtime used to observe the LinkError.
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
architectureStructural/system-level shape and runtime behaviourbindingsABI, FFI, WASM, and cross-language interop surfacesbugSomething is broken or behaves incorrectlyenhancementNew capability or improvement to existing behaviourscope:repoConfined to this repository
Activity
whatproblem-ai commentedon Nov 27, 2026
Problem: On the core-WASM target, the 6 Crypto externs from #816 (
sha256,hmac_sha256,base64url_encode,base64url_decode,rsa_sign_pkcs1_sha256,rsa_verify_pkcs1_sha256) compile to host imports such asCrypto.sha256. No shim in the repo supplies these imports, soaffinescript compilesucceeds and instantiation then fails withLinkError.Expected: The program either fails at compile time with
UnsupportedFeatureor runs, depending on which of options 1–3 is chosen.Missing: which option to pursue (or which mix, such as 3 plus 1 for RSA), and the host runtime used to observe the
LinkError.Clarity: 90%. Clear enough to work on.
⌨️ Commands · 💬 Have feedback? Tell us · 🎯 New here? Add WhatProblem to your repo · 🔒 Privacy
coderabbitai commentedon Nov 27, 2026
🔗 Related PRs
#816 - feat(stdlib): Crypto sha256, HMAC, base64url, RS256 sign/verify (
#746) [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
test(#822): find stdlib from the dune runtest directory
fix(codegen): reject the #746 Crypto externs on core WASM by name (#822)
test(#822): find stdlib from the dune runtest directory
fix(codegen): reject the #746 Crypto externs on core WASM by name (#822)
test(#822): find stdlib from the dune runtest directory