Skip to content

build: compilation is wrong, library output of zig build has no symbols. #56

@inge4pres

Description

@inge4pres

Describe the current state

The output of zig build is a static library with no symbols.
This means that, somehow, the current build config is not picking up the right artifacts.
We should understand what's wrong with the build or the declaration of exported items in src/sdk.zig.

☁  opentelemetry-sdk [build-docs] ⚡  readelf -s zig-out/lib/libopentelemetry-sdk.a

File: zig-out/lib/libopentelemetry-sdk.a(/home/francesco/Projects/github.com/zig-o11y/opentelemetry-sdk/.zig-cache/o/30646a4f6800f6a22ccd5611a0fe1ac7/libopentelemetry-sdk.a.o)

Symbol table '.symtab' contains 12 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS opentelemetry-sdk
     2: 0000000000000000     8 OBJECT  LOCAL  DEFAULT    3 builtin.zig_backend
     3: 0000000000000000     0 SECTION LOCAL  DEFAULT    3 .rodata.cst8
     4: 0000000000000000     1 OBJECT  LOCAL  DEFAULT    4 start.simplified[...]
     5: 0000000000000000     0 SECTION LOCAL  DEFAULT    4 .rodata
     6: 0000000000000001     1 OBJECT  LOCAL  DEFAULT    4 builtin.output_mode
     7: 0000000000000002     1 OBJECT  LOCAL  DEFAULT    4 builtin.link_mode
     8: 0000000000000000     0 SECTION LOCAL  DEFAULT    5 .debug_abbrev
     9: 0000000000000000     0 SECTION LOCAL  DEFAULT    6 .debug_info
    10: 0000000000000000     0 SECTION LOCAL  DEFAULT    8 .debug_str
    11: 0000000000000000     0 SECTION LOCAL  DEFAULT   14 .debug_line

Originally posted by @inge4pres in #53 (comment)

Describe the desired state

The installed artifact exposes all the by-products of the existing SDK implementation: MeterProvider, LoggerProvider, etc...

These are intended to be consumed both by other Zig projects as well as C projects.

Additional context

#49 might be related to the same issue we're seeing here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Backlog

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions