Stream: bugs

Topic: Three WASM build pipeline issues on latest nightly (afef911)


view this post on Zulip thelamplighter_ (Jul 21 2026 at 16:17):

Environment**: Linux x86_64, roc version release-fast-afef9119 (2026-07-21 nightly)


1. JSON parsing errors during rocup (reported separately)

rocup latest fails with JSON parse errors. Currently pinned to an older nightly via rocup -1. Not sure if this is a rocup or release-server issue — others seeing this?

2. --no-link flag missing for roc build --target=wasm32

The wasm4 platform docs describe roc build --target=wasm32 --no-link to produce a relocatable WASM object (before manual linking with the host). But the current nightly doesn't recognize --no-link:

$ roc build --target=wasm32 --no-link main.roc
FILE NOT FOUND: --no-link   # treated as filename

Not listed in roc build --help either.

Workaround: roc build --target=wasm32 --opt=dev links the host object + app object automatically via cranelift, so --no-link isn't strictly needed — but it would be useful for splitting the pipeline (e.g. warm-cache obj builds, separate host linking).

3. --opt=speed LLVM WASM backend produces objects with MissingRelocCode

When building for --target=wasm32 with the LLVM backend (default or --opt=speed), the generated WASM object file triggers a linker error:

error: Failed to preload wasm input
/tmp/roc/release-fast-afef9119/GsH3kFzNoNnlRYb1LYzRJA7GFJX5BGcV/
roc_app_llvm_wasm32_speed_1bdb5a19_pic.o: error.MissingRelocCode

The cranelift backend (--opt=dev) succeeds:

$ roc build --target=wasm32 --opt=dev app/main.roc
0 errors and 0 warnings found in 9ms while successfully building:
/tmp/test-dev.wasm

Output from dev is 1.2KB with correct exports (memory, cabi_realloc, Golem guest + cabi_post functions). The LLVM object doesn't have relocation sections that wasm-ld expects.


Summary workaround: roc build --target=wasm32 --opt=dev works end-to-end for producing WASM modules with custom platform host linking. LLVM path blocked.

view this post on Zulip Anton (Jul 21 2026 at 17:09):

Hi @thelamplighter_,
There where some recent changes around JSON things, rocup needs to be updated.

view this post on Zulip Anton (Jul 21 2026 at 17:30):

I can't find any mention of --no-link in the roc-wasm4 repo. Is this a LLM hallucination?

view this post on Zulip Anton (Jul 21 2026 at 17:32):

Can you share a minimal reproduction main.roc for the MissingRelocCode error?

view this post on Zulip thelamplighter_ (Jul 21 2026 at 18:50):

Anton said:

Hi thelamplighter_,
There where some recent changes around JSON things, rocup needs to be updated.

Okay, so maybe I should download the binary directly right??

view this post on Zulip thelamplighter_ (Jul 21 2026 at 18:52):

Anton said:

I can't find any mention of --no-link in the roc-wasm4 repo. Is this a LLM hallucination?

Maybe, I guess :sweat_smile:, I was trying to build a platform for the first time for golem cloud using opencode, so I can generate golem compatible wasm components

view this post on Zulip thelamplighter_ (Jul 21 2026 at 19:06):

Anton said:

Can you share a minimal reproduction main.roc for the MissingRelocCode error?

this is my main.roc (pls keep in mind, I am still a novice and just testing things out):

app [main, getAgentType, initialize, invoke, discoverTypes, save, load] {
    pf: platform "../platform/main.roc"
}

getAgentType : Str -> Str
getAgentType = |typeName| typeName

initialize : Str, Str -> I32
initialize = |_, _| 0

invoke : Str, Str -> Str
invoke = |methodName, _input| methodName

discoverTypes : {} -> Str
discoverTypes = |_| "[]"

save : {} -> Str
save = |_| "{}"

load : Str -> I32
load = |_| 0

main = {}

and the platform code being imported too:

platform "roc-golem"
    requires { main : {}, getAgentType : Str -> Str, initialize : Str, Str -> I32, invoke : Str, Str -> Str, discoverTypes : {} -> Str, save : {} -> Str, load : Str -> I32 }
    exposes []
    packages {}
    provides {
        "roc_get_agent_type": get_agent_type!,
        "roc_initialize":     initialize!,
        "roc_invoke":         invoke!,
        "roc_discover_types": discover_types!,
        "roc_save":           save!,
        "roc_load":           load!,
    }
    hosted {}
    targets: {
        inputs_dir: "targets/",
        wasm32: {
            inputs: ["host.wasm", app],
            output: Shared,
            exports: [
                "roc_get_agent_type",
                "roc_initialize",
                "roc_invoke",
                "roc_discover_types",
                "roc_save",
                "roc_load",
                "golem:agent/guest@1.5.0#initialize",
                "golem:agent/guest@1.5.0#invoke",
                "golem:agent/guest@1.5.0#get-definition",
                "golem:agent/guest@1.5.0#discover-agent-types",
                "golem:api/save-snapshot@1.5.0#save",
                "golem:api/load-snapshot@1.5.0#load",
                "cabi_realloc",
                "cabi_post_golem:agent/guest@1.5.0#initialize",
                "cabi_post_golem:agent/guest@1.5.0#invoke",
                "cabi_post_golem:agent/guest@1.5.0#get-definition",
                "cabi_post_golem:agent/guest@1.5.0#discover-agent-types",
                "cabi_post_golem:api/save-snapshot@1.5.0#save",
                "cabi_post_golem:api/load-snapshot@1.5.0#load",
            ],
            import_memory: Zeroed,
            initial_stack_size: 14752,
            minimum_memory: 65536,
        },
    }

get_agent_type! : Str -> Str
get_agent_type! = |type_name| getAgentType(type_name)

initialize! : Str, Str -> I32
initialize! = |agent_type, input| initialize(agent_type, input)

invoke! : Str, Str -> Str
invoke! = |method_name, input| invoke(method_name, input)

discover_types! : {} -> Str
discover_types! = |_| discoverTypes({})

save! : {} -> Str
save! = |_| save({})

load! : Str -> I32
load! = |snapshot| load(snapshot)

main! : {} -> I32
main! = |_| 0

view this post on Zulip thelamplighter_ (Jul 22 2026 at 10:01):

so i guess this is already fixed, i also realized there is no --no-link for the compiler, that was definitely an LLM hallucination, and the errors from compiling with --opt=speed was due to wrong code - skill issue on my side. but the json errors still remain, i guess the basic-cli platform will need to be updated to support the newer nightlies for that. thanks.


Last updated: Jul 23 2026 at 13:15 UTC