Skip to content

Conversation

@agagniere
Copy link
Member

The following methods now apply to the module instead of the compile step:

  • addCSourceFiles
  • addIncludePath
  • linkLibrary

@agagniere agagniere self-assigned this Dec 27, 2025
# Initialize a `zig build` project if you haven't already
zig init
zig fetch --save git+https://github.com/allyourcodebase/zstd.git#1.5.7
zig fetch --save git+https://github.com/allyourcodebase/zstd.git#master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will tag a new release of this PR has been merged. This should be reverted.

Suggested change
zig fetch --save git+https://github.com/allyourcodebase/zstd.git#master
zig fetch --save git+https://github.com/allyourcodebase/zstd.git#1.5.7

Comment on lines +28 to +54

## Options

```
-Dlinkage=[enum] Link mode. Defaults to static
Supported Values:
static
dynamic
-Dstrip=[bool] Omit debug information
-Dpie=[bool] Produce Position Independent Code
-Dcompression=[bool] build compression module
-Ddecompression=[bool] build decompression module
-Ddictbuilder=[bool] build dictbuilder module
-Ddeprecated=[bool] build deprecated module
-Dminify=[bool] Configures a bunch of other options to space-optimized defaults
-Dlegacy-support=[int] makes it possible to decompress legacy zstd formats
-Dmulti-thread=[bool] Enable multi-threading
-Ddisable-assembly=[bool] Assembly support
-Dhuf-force-decompress-x1=[bool]
-Dhuf-force-decompress-x2=[bool]
-Dforce-decompress-sequences-short=[bool]
-Dforce-decompress-sequences-long=[bool]
-Dno-inline=[bool] Disable Inlining
-Dstrip-error-strings=[bool] removes the error messages that are otherwise returned by `ZSTD_getErrorName` (implied by `-Dminify`)
-Dexclude-compressors-dfast-and-up=[bool]
-Dexclude-compressors-greedy-and-up=[bool]
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can run zig build -h to get this output so there is no need to provide a copy in the readme that may eventually get outdated. Please remove it.

Comment on lines -37 to +44
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.strip = strip,
.pic = pic,
.link_libc = true,
}),
.root_module = module,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the diff unnecessarily complicated. Can you keep the b.createModule call inside the b.addLibrary call and then just replace zstd.addSomething with zstd.root_module.addSomething wherever needed.

Comment on lines -108 to +114
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
}),
.root_module = mod,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the diff unnecessarily complicated. Can you keep the b.createModule call inside the b.addExecutable call and then just replace exe.addSomething with exe.root_module.addSomething.

This is [zstd](https://github.com/facebook/zstd), packaged for [Zig](https://ziglang.org/).

Compatible with zig `0.14`-`0.16`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A statement like "Compatible with zig 0.16" is misleading because there is no 0.16.0 release (yet). You would have to mention the exact Zig version this has been tested with or say 0.16.0-dev. This can easily get outdated over time so I'd suggest to remove this statement entirely and let the user test whether it works with their Zig version instead.

Also, projects in allyourcodebase only need to guarantee support for the latest tagged release. Anything beyond that may change over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants