app [main!] {
pf: platform "../basic-cli/platform/main.roc",
}
import pf.Stdout
main! = \{} ->
_ = Num.pow 1 1
Stdout.write! "hi"
Running num.Pow is giving a compiler error, is this a known issue? Current running on roc commit d782542 (PI)
There could be a few things going on here.
Does this happen for you in the REPL? if you use $ roc repl
?
Can you share the error message too please?
repl works fine!
here is the error
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
Undefined Symbol in relocation, (+124a, Relocation { kind: PltRelative, encoding: Generic, size: +20, target: Symbol(SymbolIndex(+71)), addend: +fffffffffffffffc, implicit_addend: false }): Ok(Symbol { name: "log", address: +0, size: +0, kind: Unknown, section: Undefined, scope: Unknown, weak: false, flags: Elf { st_info: +10, st_other: +0 } })
Location: crates/linker/src/elf.rs:1452:25
It only fails when you assign the value
To a discard binding
Does that track with what you see @Agustin Romero ?
Num.pow 1 1
and
a = Num.pow 1 1
works in Repl
But
_ = Num.pow 1 1
crashes in Repl. But I think binding to a _ in the repl always crashes. Is that known?
Oh yeah
not really.
this crashes
app [main!] {
pf: platform "../basic-cli/platform/main.roc",
}
import pf.Stdout
main! = \{} -> Stdout.write! "$(Inspect.toStr (2^2))\n"
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
ambient functions don't unify
Location: crates/compiler/unify/src/unify.rs:202:18
Only handles ident binding
and assigning to a variable crashes aswell
app [main!] {
pf: platform "../basic-cli/platform/main.roc",
}
import pf.Stdout
main! = \{} ->
a = 2 ^ 2
Stdout.write! ""
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
Undefined Symbol in relocation, (+124a, Relocation { kind: PltRelative, encoding: Generic, size: +20, target: Symbol(SymbolIndex(+71)), addend: +fffffffffffffffc, implicit_addend: false }): Ok(Symbol { name: "log", address: +0, size: +0, kind: Unknown, section: Undefined, scope: Unknown, weak: false, flags: Elf { st_info: +10, st_other: +0 } })
Location: crates/linker/src/elf.rs:1452:25
Are you using the legacy linker?
Undefined Symbol in relocation
this makes me think it may be linker related
no i wasn't let me give that a try
Oh... the log
has me thinking maybe the way I'm handling the Err
from main is the issue.
Can you add a type annotation to main!
and try again?
legacy linker makes it run
I'm confused where this log
symbol is coming from
adding the type annotation didn't help
app [main!] {
pf: platform "../basic-cli/platform/main.roc",
}
import pf.Stdout
main! : {} => Result {} [StdoutErr [
AlreadyExists,
BrokenPipe,
Interrupted,
NotFound,
Other Str,
OutOfMemory,
PermissionDenied,
Unsupported,
]]
main! = \{} ->
a = 2 ^ 2
Stdout.write! ""
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
Undefined Symbol in relocation, (+124a, Relocation { kind: PltRelative, encoding: Generic, size: +20, target: Symbol(SymbolIndex(+71)), addend: +fffffffffffffffc, implicit_addend: false }): Ok(Symbol { name: "log", address: +0, size: +0, kind: Unknown, section: Undefined, scope: Unknown, weak: false, flags: Elf { st_info: +10, st_other: +0 } })
Location: crates/linker/src/elf.rs:1452:25
And you're running x64 linux right?
It's working ok for me on my arm64 mac
x64 linux, correct
We have a related issue https://github.com/roc-lang/roc/issues/7068
Totally missed it. Would that be a good first issue for me to solve?
I suspect this is a known issue, I'm having trouble tracking down the related Issue.
@Brendan Hansknecht would probably know from looking at this error message if we are already tracking.
I'm asking if adding the recommendation could be a good first issue, not expecting to fix the actual issue myself :laughing:
Agustin Romero said:
Totally missed it. Would that be a good first issue for me to solve?
Anton has labelled it as an intermediate issue.
Maybe for providing more information as recommended in this issue it's as simple as including a note in internal_error
macro message. That would be easy to do.
if you think it's possible i'll take a look, have some spare time right now
why does pow need log....strange
Should i create a fork to create a PR, i'd be changing a single line
If you don't have contributor / write access to the repo you will need a fork.
got it.
https://github.com/roc-lang/roc/pull/7323
Last updated: Jul 06 2025 at 12:14 UTC