Require exactly Zig 0.15.2 to build the native module#541
Merged
Conversation
A minimum_zig_version in build.zig.zon rejects older Zig before the build script compiles, and a comptime guard in build.zig rejects any version other than 0.15.2 with an explicit error, which also surfaces in ghostel-module-compile's compilation buffer and the auto-install build log. State the exact version requirement in the README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several users hit opaque Zig compiler errors when building the native module with a Zig version other than 0.15.2. Nothing enforced or clearly stated the exact-version requirement.
build.zig.zon: addminimum_zig_version = "0.15.2"so older Zig gets a clean official error before the build script even compiles.build.zig: add a file-scope comptime guard that fails any other version (including newer Zig) withghostel requires exactly Zig 0.15.2, found <version>. The message also surfaces inM-x ghostel-module-compile's*compilation*buffer and the auto-install*ghostel-build*log, since both just runzig build.ghostel.el: fix the commentary that said "Zig 0.15.2+".Verified:
make -j8 allpasses with Zig 0.15.2; pinning the guard to 0.15.3 reproduces the mismatch and shows the error in both the*compilation*buffer and the auto-install warning path in a live Emacs session.