Skip to content

Preview Zig's incremental linker state in interactive HTML

License

Notifications You must be signed in to change notification settings

kubkon/zig-snapshots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zig-snapshots

A tool allowing you to preview a series of snapshots of Zig's incremental linker.

Usage

You will need to build Zig's stage2/self-hosted compiler with -Dlink-snapshot flag on:

$ zig build -Dlink-snapshot

Then, you can run the compiler either in a fire-and-forget or watch-for-updates manner with --debug-link-snapshot flag on to generate a snapshot of the linker's state per incremental update, all saved in the same JSON output file:

$ zig build-exe hello.zig --watch --debug-link-snapshot
> update-and-run
> update-and-run
> exit

$ file snapshots.json
snapshots.json: JSON data

You should then feed the output JSON file to zig-snapshots which will generate an HTML file with the linker's state per each incremental update that you can interative with:

$ zig-out/bin/zig-snapshots snapshots.json
$ open snapshots.html

zig-snapshots demo

About

Preview Zig's incremental linker state in interactive HTML

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages