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

feat!: support multiple Zig SDK versions #258

Merged
merged 16 commits into from
Apr 13, 2024
Merged

feat!: support multiple Zig SDK versions #258

merged 16 commits into from
Apr 13, 2024

Conversation

aherrmann
Copy link
Owner

Part of #257

Support the registration and selection between multiple different Zig SDK versions.

Users can register multiple Zig SDK versions using the zig module extension or zig_register_toolchains repository rule. Toolchains will be defined and registered for all specified versions. A specific toolchain version can be selected using the --@zig_toolchains//:version build flag.

  • Add a development version of Zig 0.11 for testing
  • TMP Select the development version
  • feat!: Remove name attribute to zig_toolchain tag
  • Simplify toolchain registration
  • Import multiple Zig SDK versions
  • Register multiple Zig SDK versions
  • Use toolchain collection repository to register
  • deduplicate version name sanitizing
  • Update the WORKSPACE
  • Accept both zig_version and zig_versions
  • chore: rename zig_repositories -> zig_repository
  • feat: Add Zig SDK version build & config settings
  • Ensure toolchain order
  • Update generated files
  • Revert "TMP Select the development version"
  • Revert "Add a development version of Zig 0.11 for testing"

BREAKING CHANGE: The zig module extension no longer accepts a name attr.

Toolchains are selected via toolchain resolution. The name of the
repository is irrelevant in this context. A better approach is to
support registering multiple versions and using constraints to let the
user pick between different versions.

BREAKING CHANGE: The zig module extension no longer accepts a name attr.
The name attribute is no longer used
For backward compatibility
This allows a user to select among multiple different Zig SDK versions
via build flags or transitions and to select based on the Zig SDK
version or configure target compatibility with a specific version.
Toolchain resolution proceeds in the order in which toolchains are
registered. When toolchains are registered through a wildcard label,
such as `:all`, then their order is determined by lexicographical order.

Add numerical prefixes to ensure that the user defined order is
respected.
@aherrmann aherrmann enabled auto-merge April 13, 2024 13:40
@aherrmann aherrmann merged commit 6197278 into main Apr 13, 2024
21 checks passed
@aherrmann aherrmann deleted the extra-versions branch April 13, 2024 13:55
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