Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to zig 0.14 #291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BestFriendChris
Copy link

@BestFriendChris BestFriendChris commented Mar 7, 2025

Zig 0.14 was recently released with some breaking changes to the build.zig.zon file.

Summary by CodeRabbit

  • Documentation
    • Updated instructions across multiple guides to require Zig version 0.14.
  • New Features
    • Added a new Docker configuration to support the updated Zig environment.
  • Chores
    • Standardized project configuration by updating version references and refining package metadata with a unique identifier for improved consistency and security.

Copy link

coderabbitai bot commented Mar 7, 2025

Walkthrough

The pull request updates the Zig programming language version requirements and associated configuration across multiple files. It raises the minimum version from 0.13 (or 0.11 in some cases) to 0.14 in READMEs, build files, configuration files, and Docker setup. Additionally, it changes package names from hardcoded strings to symbolic references and introduces a fingerprint field in build configuration files for package identity.

Changes

File(s) Change Summary
compiled_starters/zig/README.md, solutions/zig/01-jm1/code/README.md Updated Zig version requirement from 0.13+ to 0.14 in README files.
compiled_starters/zig/build.zig.zon, solutions/zig/01-jm1/code/build.zig.zon, starter_templates/zig/code/build.zig.zon Changed package name from "codecrafters-redis" to .codecrafters_redis, updated minimum Zig version from "0.11.0" to "0.14.0" (commented), and added a new .fingerprint field with a hexadecimal identifier.
compiled_starters/zig/codecrafters.yml, solutions/zig/01-jm1/code/codecrafters.yml Updated language_pack from zig-0.13 to zig-0.14.
dockerfiles/zig-0.14.Dockerfile Created a new Dockerfile for Zig 0.14, setting up an Alpine-based environment, installing dependencies, downloading and extracting the Zig tarball, and configuring the execution environment.
starter_templates/zig/config.yml Updated the required_executable version from zig (0.13+) to zig (0.14).

Poem

I'm a bunny with code in my heart,
Hopping to new Zig versions, a clever new start.
With changes in config and fingerprint flair,
Our packages now shine, beyond compare.
Through docker and builds, my leaps are so bright—
A rabbit's delight in every byte!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
starter_templates/zig/config.yml (1)

1-4: Modify Executable Requirement for Zig

The required_executable attribute has been updated from zig (0.13+) to zig (0.14). While this meets the new specification, consider whether a strict version or a minimum version would be more appropriate to allow users with later Zig releases.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b27bb8 and d6eac77.

📒 Files selected for processing (9)
  • compiled_starters/zig/README.md (1 hunks)
  • compiled_starters/zig/build.zig.zon (2 hunks)
  • compiled_starters/zig/codecrafters.yml (1 hunks)
  • dockerfiles/zig-0.14.Dockerfile (1 hunks)
  • solutions/zig/01-jm1/code/README.md (1 hunks)
  • solutions/zig/01-jm1/code/build.zig.zon (2 hunks)
  • solutions/zig/01-jm1/code/codecrafters.yml (1 hunks)
  • starter_templates/zig/code/build.zig.zon (2 hunks)
  • starter_templates/zig/config.yml (1 hunks)
🧰 Additional context used
🪛 Hadolint (2.12.0)
dockerfiles/zig-0.14.Dockerfile

[error] 20-20: invalid flag: --exclude

(DL1000)

⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: test_course_definition / test (typescript)
  • GitHub Check: test_course_definition / test (zig)
  • GitHub Check: test_course_definition / test (swift)
  • GitHub Check: test_course_definition / test (kotlin)
  • GitHub Check: test_course_definition / test (ocaml)
  • GitHub Check: test_course_definition / test (scala)
  • GitHub Check: test_course_definition / test (rust)
  • GitHub Check: test_course_definition / test (java)
  • GitHub Check: test_course_definition / test (haskell)
  • GitHub Check: test_course_definition / test (go)
  • GitHub Check: test_course_definition / test (c)
  • GitHub Check: test_course_definition / test (cpp)
  • GitHub Check: test_course_definition / test (clojure)
🔇 Additional comments (17)
compiled_starters/zig/README.md (1)

29-33: Update Zig Version Requirement in Instructions

The instruction now clearly specifies that users must have zig (0.14) installed locally. This aligns with the new PR objective and ensures consistency with configuration changes across the repository.

solutions/zig/01-jm1/code/README.md (1)

29-33: Refresh Zig Version in README Instructions

The updated line now instructs users to ensure they have zig (0.14) installed locally. This modification is consistent with the updates in other parts of the project and meets the PR objective.

solutions/zig/01-jm1/code/codecrafters.yml (1)

10-11: Update Language Pack Version in Configuration

The configuration now explicitly states language_pack: zig-0.14 and includes a comment indicating the available version. This change is straightforward and matches the new requirements for Zig.

compiled_starters/zig/codecrafters.yml (1)

10-11: Synchronize Language Pack Version

The header comment and the language_pack setting have been updated to zig-0.14, ensuring that the configuration aligns with the rest of the changes across the codebase.

starter_templates/zig/code/build.zig.zon (3)

2-2: Package name updated to symbolic reference format

The change from a string literal to a symbolic reference format (.codecrafters_redis) aligns with Zig 0.14's preferred syntax for package names.


11-11: Updated minimum Zig version

The commented minimum Zig version has been properly updated from 0.11.0 to 0.14.0 to match the target version of this PR.


13-25: Added fingerprint field with appropriate documentation

The addition of the fingerprint field along with comprehensive documentation is a good practice. This field serves as a unique package identifier in Zig 0.14 and helps with package identity verification.

compiled_starters/zig/build.zig.zon (3)

2-2: Package name updated to symbolic reference format

The change from a string literal to a symbolic reference format (.codecrafters_redis) aligns with Zig 0.14's preferred syntax for package names.


11-11: Updated minimum Zig version

The commented minimum Zig version has been properly updated from 0.11.0 to 0.14.0 to match the target version of this PR.


13-25: Added fingerprint field with appropriate documentation

The addition of the fingerprint field along with comprehensive documentation is a good practice. This field serves as a unique package identifier in Zig 0.14 and helps with package identity verification.

solutions/zig/01-jm1/code/build.zig.zon (3)

2-2: Package name updated to symbolic reference format

The change from a string literal to a symbolic reference format (.codecrafters_redis) aligns with Zig 0.14's preferred syntax for package names.


11-11: Updated minimum Zig version

The commented minimum Zig version has been properly updated from 0.11.0 to 0.14.0 to match the target version of this PR.


13-25: Added fingerprint field with appropriate documentation

The addition of the fingerprint field along with comprehensive documentation is a good practice. This field serves as a unique package identifier in Zig 0.14 and helps with package identity verification.

dockerfiles/zig-0.14.Dockerfile (4)

1-14: Well-structured Docker setup for Zig 0.14

The Dockerfile correctly sets up Zig 0.14.0 on Alpine 3.20 with appropriate version constraints for dependencies. The path configuration is properly set to make the Zig compiler available.


15-15: Dependency file paths environment variable

The CODECRAFTERS_DEPENDENCY_FILE_PATHS environment variable correctly specifies the build.zig and build.zig.zon files that are required for the build process.


19-20: Potential issue with COPY --exclude flag

The --exclude flag isn't part of standard Docker COPY instruction. While this may work with the specified Docker syntax version (1.7-labs), it might not be compatible with standard Docker implementations.

Consider using a .dockerignore file instead for better compatibility:

- COPY --exclude=.git --exclude=README.md . /app
+ # Add .dockerignore file with .git and README.md entries
+ COPY . /app
🧰 Tools
🪛 Hadolint (2.12.0)

[error] 20-20: invalid flag: --exclude

(DL1000)


22-27: Build and cache setup

The approach to run the build and cache the Zig build artifacts is well-implemented. The use of || true ensures the command doesn't fail if the directory doesn't exist.

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.

1 participant