Skip to content

Compiler Panic when linking object file that doesn't exist in zig build #12473

@Noodlez1232

Description

@Noodlez1232

Zig Version

0.10.0-dev.3597+79757f233

Steps to Reproduce

  • Link to an object file that doesn't exist using target.addObjectFile("file.o")
  • Observe the error

Expected Behavior

Some sort of better error than a panic

Actual Behavior

A panic due to unwrapping an error. The error message is as follows:

warning: FileNotFound: file.o
thread 263245 panic: attempt to unwrap error: FileNotFound

This error happens in stage1.zig:48:43 where stage2 is called. Stage1 expects no error to be thrown, so catch unreachable is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions