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

all: nominate Zig 2024.10.0-mach #1276

Closed
42 of 43 tasks
slimsag opened this issue Oct 4, 2024 · 6 comments
Closed
42 of 43 tasks

all: nominate Zig 2024.10.0-mach #1276

slimsag opened this issue Oct 4, 2024 · 6 comments
Assignees

Comments

@slimsag
Copy link
Member

slimsag commented Oct 4, 2024

Periodically we nominate a new Zig nightly version to be the version that Mach targets, and begin the meticulous process of updating every Mach project to use that new version.

This is the tracking issue to do that for the next scheduled nomination (see the date in the issue title.)

You may have been linked to this issue because you sent a pull request to update a Mach project to use a new Zig API - if that is the case we do appreciate the PR and will look at merging it once this process begins. In the meantime, your PR may stay open for a while. You can either use a fork of the project, or use the version of Zig that Mach currently supports.

Update process

  • It is time to begin (see date in issue title, we aim to begin this checklist between the 1st-4th of that month.)
  • In machengine.org repository static/zig folder, wrench script nominate-zig-index-update nominate 2024.1.0-mach-wip has been ran and the index.json has been updated.
  • #wrench automation (!wrench schedule-now update-zig-version) has created new pull requests to update the Zig version used in CI of all our projects, and it matches index.json.
  • The Nomination history has a new section for the latest nightly Zig version which Wrench used in its PRs, with a warning at the top **IN-PROGRESS:** This version is currently being nominated, see [the tracking issue](https://github.com/hexops/mach/issues/1135) for details. Once everything looks good, the new Zig version is confirmed to be working with Mach, we will declare success, close the issue, and remove this in-progress warning..
  • #contributing Discord message: Beginning the process of nominating a new Zig version; $GITHUB_ISSUE
  • #wrench automation (!wrench script-all install-zig) has updated the Zig version used by self-hosted GitHub actions runners.
  • "First-order projects" below (which have zero build.zig.zon dependencies) have been updated, their CI is passing/green using the new version.
  • "Second-order projects" below (which have build.zig.zon dependencies) have been updated, their CI is passing/green using the new version.
  • The .zigversion file https://github.com/hexops/mach/blob/main/.zigversion has been updated.
  • The mach build.zig version check has been updated: https://github.com/hexops/mach/blob/main/build.zig#L187-L192
  • https://machengine.org/about/zig-version has been updated
  • In machengine.org repository static/zig folder, wrench script nominate-zig-index-update finalize 2024.1.0-mach-wip has been ran and the index.json has had -wip removed and the mach-latest entry has been updated.
  • The **IN-PROGRESS** warning in the Nomination history has been removed.
  • A new issue has been filed for the next nomination.
  • A #progress announcement has been made:

We've just finalized nominating and updating to Zig 2024.1.0-mach. We encourage you to update your projects to that Zig version now. :)

First-order projects

These projects have zero build.zig.zon dependencies, we update them first - and in any order.

Second-order projects

These projects have dependencies on other projects. We update them in the exact order below, top-to-bottom.

  • spirv-tools, which depends on:
  • opusenc, which depends on:
    • opus
  • freetype, which depends on:
    • brotli
  • opusfile, which depends on:
    • opus
    • ogg
  • harfbuzz, which depends on:
    • freetype
    • brotli
  • mach-dxcompiler, which depends on:
  • mach-objc, which depends on:
    • xcode-frameworks
  • mach-freetype, which depends on:
    • freetype
    • harfbuzz
    • font-assets
  • mach-flac, which depends on:
    • flac
    • mach-sysaudio
    • linux-audio-headers
  • mach-opus, which depends on:
    • opusfile
    • opusenc
    • mach-sysaudio
    • linux-audio-headers
  • mach, which depends on:
    • .zigversion
    • build.zig version check
    • mach-freetype
    • font-assets
    • mach-objc
    • mach-example-assets
    • spirv-cross
    • spirv-tools
    • xcode-frameworks
    • vulkan-zig-generated
    • direct3d-headers
    • opengl-headers
    • x11-headers
    • linux-audio-headers
    • wayland-headers
@slimsag slimsag self-assigned this Oct 4, 2024
@slimsag slimsag mentioned this issue Oct 4, 2024
49 tasks
slimsag added a commit to hexops/machengine.org that referenced this issue Oct 4, 2024
@slimsag
Copy link
Member Author

slimsag commented Oct 4, 2024

What's new in this Zig version?

This version includes Zig 0.13 (and some Zig 0.14) changes; so you may be interested in reading https://ziglang.org/download/0.13.0/release-notes.html

Notable mentions:

Tips on upgrading your code

Simple renames

  • std.rand -> std.Random
  • std.unicode.utf16leToUtf8AllocZ -> std.unicode.utf16LeToUtf8AllocZ
  • std.unicode.utf8ToUtf16LeWithNull -> std.unicode.utf8ToUtf16LeAllocZ
  • @typeInfo quoted versions (same applies in @Type(.{}) constructors):
    • @typeInfo(T).Struct -> @typeInfo(T).@"struct"
    • @typeInfo(T).Fn -> @typeInfo(T).@"fn"
    • @typeInfo(T).Enum -> @typeInfo(T).@"enum"
    • @typeInfo(T).Union -> @typeInfo(T).@"union"
  • @typeInfo lowercased (same applies in @Type(.{}) constructors):
    • @typeInfo(T).Type -> @typeInfo(T).type
    • @typeInfo(T).Void -> @typeInfo(T).void
    • @typeInfo(T).Bool -> @typeInfo(T).bool
    • @typeInfo(T).Optional -> @typeInfo(T).optional
    • @typeInfo(T).Pointer -> @typeInfo(T).pointer
    • @typeInfo(T).EnumLiteral -> @typeInfo(T).enum_literal
    • @typeInfo(T).Array -> @typeInfo(T).array

Name conflicts

Fields, function names, and global variables/constants in a struct can no longer share the same name.

error: unable to open source directory '': FileNotFound

You are probably passing an empty string to b.path("") and you now need to pass b.path(".") instead.

cmake 'unable to substitute variable'

error: /Volumes/data 1/hexops/flac/config.cmake.h.in:149: unable to substitute variable: error: MissingValue
error: HeaderConfigFailed

You have a b.addConfigHeader invocation somewhere which now requires that you specify all variables declared in the cmake.h.in file you are configuring. Open the file, find the variable it mentions, and declare it in your b.addConfigHeader invocation.

no field named 'kfreebsd' in enum 'Target.Os.Tag'

/Volumes/data 1/hexops/spirv-tools/build.zig:28:24: error: no field named 'kfreebsd' in enum 'Target.Os.Tag'
    } else if (tag == .kfreebsd) {
                      ~^~~~~~~~

This tag is deliberately omitted from Zig now; consider using .freebsd instead?

slimsag added a commit to hexops/machengine.org that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/machengine.org that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/fastfilter that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/fastfilter that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/spirv-cross that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/fastfilter that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/spirv-cross that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/flac that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/flac that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/spirv-tools that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/opusenc that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/freetype that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/opusenc that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/opusfile that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/spirv-tools that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/harfbuzz that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/opusfile that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/harfbuzz that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/mach-objc that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/mach-freetype that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/mach-freetype that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/mach-flac that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/mach-opus that referenced this issue Oct 4, 2024
slimsag added a commit to hexops/mach-freetype that referenced this issue Oct 4, 2024
slimsag added a commit that referenced this issue Oct 5, 2024
@slimsag
Copy link
Member Author

slimsag commented Oct 8, 2024

Nominating this version is currently blocked on a regression in the Zig linker which prevents builds on macOS from succeeding: ziglang/zig#21598

@slimsag
Copy link
Member Author

slimsag commented Oct 8, 2024

Looks like we also have a linker failure on Windows.

e564c65

image

slimsag added a commit to hexops/vulkan-zig-generated that referenced this issue Oct 8, 2024
slimsag added a commit that referenced this issue Oct 8, 2024
slimsag added a commit that referenced this issue Oct 8, 2024
fautore pushed a commit to fautore/mach that referenced this issue Oct 11, 2024
fautore pushed a commit to fautore/mach that referenced this issue Oct 11, 2024
fautore pushed a commit to fautore/mach that referenced this issue Oct 11, 2024
@slimsag
Copy link
Member Author

slimsag commented Oct 15, 2024

Re-rolling as 0.14.0-dev.1911+3bf89f55c to integrate fixes for ziglang/zig#21598

slimsag added a commit to hexops/machengine.org that referenced this issue Oct 15, 2024
slimsag added a commit to hexops/opusenc that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/freetype that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/opusenc that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/opusfile that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/freetype that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/harfbuzz that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/opusfile that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/harfbuzz that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/mach-freetype that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/mach-flac that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/mach-freetype that referenced this issue Oct 16, 2024
slimsag added a commit to hexops/mach-flac that referenced this issue Oct 16, 2024
slimsag added a commit that referenced this issue Oct 16, 2024
Signed-off-by: Stephen Gutekanst <[email protected]>
slimsag added a commit to hexops/machengine.org that referenced this issue Oct 16, 2024
@slimsag
Copy link
Member Author

slimsag commented Oct 16, 2024

We've just finalized nominating and updating to Zig 2024.10.0-mach. :wrench~1:

If you are using the 0.4 branch of Mach (as e.g. real games/apps like #lordofzero and Pixi are using currently) then you'll have to stay on the older Zig version until main is stable enough for you again - which will hopefully be soon :slight_smile:

As always, you can find which Zig version to use for a given Mach version here: https://machengine.org/docs/zig-version/

@slimsag slimsag closed this as completed Oct 16, 2024
@mlugg
Copy link
Contributor

mlugg commented Oct 21, 2024

Note that also new in this version is labeled switch! See ziglang/zig#8220.

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

No branches or pull requests

2 participants