roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
3.86k stars 284 forks source link

Error When Building C Platform: failed to open file "platform/dynhost": No such file or directory (os error 2) #6814

Closed ishehadeh closed 2 weeks ago

ishehadeh commented 2 weeks ago

log:

🔨 Rebuilding platform...
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
thread '<unnamed>' panicked at crates/linker/src/lib.rs:556:29:
failed to open file "platform/dynhost": No such file or directory (os error 2)
stack backtrace:
   0:     0x6432f931df9b - <unknown>
   1:     0x6432f852b720 - <unknown>
   2:     0x6432f9319c03 - <unknown>
   3:     0x6432f931dd34 - <unknown>
   4:     0x6432f931f890 - <unknown>
   5:     0x6432f931f5af - <unknown>
   6:     0x6432f931fdae - <unknown>
   7:     0x6432f931fcb2 - <unknown>
   8:     0x6432f931e496 - <unknown>
   9:     0x6432f931fa20 - <unknown>
  10:     0x6432f841ae55 - <unknown>
  11:     0x6432f8c668de - <unknown>
  12:     0x6432f8c385bb - <unknown>
  13:     0x6432f8c628ec - <unknown>
  14:     0x6432f872f8d5 - <unknown>
  15:     0x6432f873b046 - <unknown>
  16:     0x6432f9325cc5 - <unknown>
  17:     0x760afb4a6ded - <unknown>
  18:     0x760afb52a0dc - <unknown>
  19:                0x0 - <unknown>
thread 'main' panicked at crates/compiler/build/src/program.rs:981:46:
Failed to (re)build platform.: Any { .. }
stack backtrace:
   0:     0x6432f931df9b - <unknown>
   1:     0x6432f852b720 - <unknown>
   2:     0x6432f9319c03 - <unknown>
   3:     0x6432f931dd34 - <unknown>
   4:     0x6432f931f890 - <unknown>
   5:     0x6432f931f5af - <unknown>
   6:     0x6432f931fdae - <unknown>
   7:     0x6432f931fcb2 - <unknown>
   8:     0x6432f931e496 - <unknown>
   9:     0x6432f931fa20 - <unknown>
  10:     0x6432f841ae55 - <unknown>
  11:     0x6432f841b3a3 - <unknown>
  12:     0x6432f87699e9 - <unknown>
  13:     0x6432f8766e02 - <unknown>
  14:     0x6432f888582e - <unknown>
  15:     0x6432f871af55 - <unknown>
  16:     0x6432f86f9323 - <unknown>
  17:     0x6432f86f9343 - <unknown>
  18:     0x6432f930fb5a - <unknown>
  19:     0x6432f871e0b5 - <unknown>
  20:     0x760afb439c88 - <unknown>
  21:     0x760afb439d4c - __libc_start_main
  22:     0x6432f84bfa2e - <unknown>
  23:                0x0 - <unknown>

Apologies for the lackluster issue details I just started using the language yesterday. Annd.. jumped right into writing a platform so its fairly likely this is something dumb I did that just happended to trigger an ICE. still worth reporting though, if there's some way to catch the issue a little cleaner.

lukewilliamboswell commented 2 weeks ago

I think this may be because the roc cli os trying to rebuild your platform. If you compile the platform to a library first and then use roc build --prebuilt-platfrom ... that might help.

I have a C template which may be helpful

https://github.com/lukewilliamboswell/roc-platform-template-c

ishehadeh commented 2 weeks ago

Thank you that's exactly the issue :), I'll update the issue to be more relevant...