{"id":34924724,"url":"https://github.com/calebq42/zig-squashfs","last_synced_at":"2026-03-01T06:10:05.859Z","repository":{"id":292684478,"uuid":"981625734","full_name":"CalebQ42/zig-squashfs","owner":"CalebQ42","description":"Learning zig via squashfs","archived":false,"fork":false,"pushed_at":"2026-02-12T12:55:23.000Z","size":187,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-12T14:10:37.823Z","etag":null,"topics":["zig","zig-lib","zig-library","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CalebQ42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-11T14:36:04.000Z","updated_at":"2026-02-12T12:55:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"59e8ba55-cafc-409b-bd10-31db84c654aa","html_url":"https://github.com/CalebQ42/zig-squashfs","commit_stats":null,"previous_names":["calebq42/zig-squashfs"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/CalebQ42/zig-squashfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalebQ42%2Fzig-squashfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalebQ42%2Fzig-squashfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalebQ42%2Fzig-squashfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalebQ42%2Fzig-squashfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CalebQ42","download_url":"https://codeload.github.com/CalebQ42/zig-squashfs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CalebQ42%2Fzig-squashfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29962004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T05:59:08.471Z","status":"ssl_error","status_checked_at":"2026-03-01T05:58:04.208Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["zig","zig-lib","zig-library","zig-package"],"created_at":"2025-12-26T14:21:01.192Z","updated_at":"2026-03-01T06:10:05.852Z","avatar_url":"https://github.com/CalebQ42.png","language":"Zig","readme":"# zig-squashfs\n\nThis is my experiments to learn Zig. Might amount to something. Might not.\n\nA library and application to decompress or view squashfs archives.\n\n## Current State\n\nOverall works, but currently is missing some features ([see below](#capabilities)) and has significantly slow performance compared to `unsquashfs` ([see below](#performance)).\n\n## Build options\n\n\u003e `-Duse_c_libs=true`\n\nInstead of using Zig's standard library for decompression, use the system's C libraries. Has the benefit of being much faster and enabling LZO and LZ4 decompression.\n\n\u003e `-Dallow_lzo=true`\n\nEnable compiling with LZO decompression support. The LZO library currently has some issues with Zig when imported so it's easier to just disable it by default. Only has an effect when using `-Duse_c_libs=true`.\n\n\u003e `-Dvalgrind=true`\n\nJust sets the valgrind build option.\n\n\u003e `-Dversion=0.0.0`\n\nSets the version of `unsquashfs` shown when `--version` is passed.\n\n## Capabilities\n\nMost features are present except for the following:\n\n* xattrs are not applied on extraction\n* When using Zig decompression libraries then lzo and lz4 compression types are unavailable. I don't _currently_ plan on spending the time to find and validate a library since neither is popular.\n* When using C decompression libraries, lzo is not supported by default due to [some issues](#build-considerations). If it's needed it's trivial to fix, but it's easiest to just leave it disabled.\n\n## Performance\n\nThis is some basic observation's I've made about this library's performance when compared to `unsquashfs`. Unless otherwise stated, most observations were made when extracting my test archive (which is fairly small and uses zstd compression) and with `--release=fast`.\n\n* Under ideal circumstances, my library is ~70% slower (.11s vs .18s)\n* Mutli-threading on small archives noticably increases extraction times (when using C libraries) (.18s vs .57s). This should theoretically reverse on larger archives with many inodes, but I haven't tested that yet.\n* Using Zig libraries *significantly* increases decompression time by ~600% under ideal circumstances.\n\nTimes:\n\n* *unsquashfs*: .11s\n* *C-libs, single-threaded*: .18s\n* *C-libs, multi-threaded*: .57s\n* *Zig-libs, single-threaded*: 5.87s\n* *Zig-libs, multi-threaded*: 1.10s\n\n## Build considerations\n\nCompilation without `use_c_libs` works completely fine, but Zig has issues with some symbols from the lzo library that needs to be manually fixed. In particular you need to fix the definitions for `lzo_bytep` and `lzo_voidp` to be `*u8` and `?*anyopaque` respectively. Due to this, you have to manually enable LZO decompression using `-Dallow_lzo=true` when building.\n\n```zig\npub const lzo_bytep = @compileError(\"unable to translate C expr: unexpected token ''\");\n// /usr/include/lzo/lzoconf.h:148:9\npub const lzo_charp = @compileError(\"unable to translate C expr: unexpected token ''\");\n// /usr/include/lzo/lzoconf.h:149:9\npub const lzo_voidp = @compileError(\"unable to translate C expr: unexpected token ''\");\n```\n\nto\n\n```zig\npub const lzo_bytep = *u8;\n// /usr/include/lzo/lzoconf.h:148:9\npub const lzo_charp = @compileError(\"unable to translate C expr: unexpected token ''\");\n// /usr/include/lzo/lzoconf.h:149:9\npub const lzo_voidp = ?*anyopaque;\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebq42%2Fzig-squashfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalebq42%2Fzig-squashfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebq42%2Fzig-squashfs/lists"}