Skip to content

Make MacOS compile in the CI - #3600

Merged
IntegratedQuantum merged 8 commits into
PixelGuys:masterfrom
IntegratedQuantum:macos_CI
Oct 19, 2026
Merged

IntegratedQuantum merged 8 commits into
PixelGuys:masterfrom
IntegratedQuantum:macos_CI

Conversation

@IntegratedQuantum

Copy link
Copy Markdown
Member

Also updates Cubyz-libs after PixelGuys/Cubyz-libs#28 and PixelGuys/Cubyz-libs#27 to validate the CI-generated libraries

fixes #3541
fixes #3543

IntegratedQuantum added a commit to PixelGuys/Cubyz-libs that referenced this pull request Sep 14, 2026
@IntegratedQuantum

Copy link
Copy Markdown
Member Author

It appears to be more complicated than I thought it would be, I'm not sure how to work with extensions in MoltenVK, and I'm not going to remote-debug this. Someone who actually has a Mac will have to it when the time comes for #299.

@IntegratedQuantum
IntegratedQuantum marked this pull request as draft September 14, 2026 20:24
@blackedout01

Copy link
Copy Markdown
Contributor

@IntegratedQuantum Are you referring to vkCmdPushDescriptorSetKHR? This function got promoted to be part of Vulkan 1.4 and as MoltenVK implements this version, it can just be used as vkCmdPushDescriptorSet when compiling for macOS.
A quick fix would be the following:

if (builtin.target.os.tag == .macos) {
    c.vkCmdPushDescriptorSet(self.handle, @intFromEnum(bindPoint), pipeline.pipelineLayout, 0, @intCast(writeInfo.len), writeInfo.ptr);
} else {
    c.vkCmdPushDescriptorSetKHR(self.handle, @intFromEnum(bindPoint), pipeline.pipelineLayout, 0, @intCast(writeInfo.len), writeInfo.ptr);
}

But it's repetetive, could you suggest a prettier version?

@IntegratedQuantum

Copy link
Copy Markdown
Member Author

Yes, that's true for this extension, but in the future I would like to support other extensions as well, like VK_EXT_fragment_shader_interlock #817 which is not in any core version.
So I would like to do it properly for this extension, so that we have extension loading set up properly when the time comes for implementing #817.

@Vexo413

Vexo413 commented Oct 17, 2026 •

Copy link
Copy Markdown

I tested this on my machine and this is the error I got:

compile exe Cubyz ReleaseSafe native 1 errors
error: sub-compilation of libcxx failed
    compiler/zig/lib/libcxx/include/__random/clamp_to_integral.h:47:58: note: use of undeclared identifier 'INFINITY'
      if (__r >= ::nextafter(static_cast<_RealT>(__max_val), INFINITY)) {
                                                             ^
    compiler/zig/lib/libcxx/src/random.cpp:18:10: note: in file included from compiler/zig/lib/libcxx/src/random.cpp:18:
    #include <random>
             ^
    compiler/zig/lib/libcxx/include/random:1696:12: note: in file included from compiler/zig/lib/libcxx/include/random:1696:
    #  include <__random/geometric_distribution.h>
               ^
    compiler/zig/lib/libcxx/include/__random/geometric_distribution.h:14:10: note: in file included from compiler/zig/lib/libcxx/include/__random/geometric_distribution.h:14:
    #include <__random/negative_binomial_distribution.h>
             ^
    compiler/zig/lib/libcxx/include/__random/negative_binomial_distribution.h:17:10: note: in file included from compiler/zig/lib/libcxx/include/__random/negative_binomial_distribution.h:17:
    #include <__random/poisson_distribution.h>
             ^
    compiler/zig/lib/libcxx/include/__random/poisson_distribution.h:13:10: note: in file included from compiler/zig/lib/libcxx/include/__random/poisson_distribution.h:13:
    #include <__random/compile exe Cubyz ReleaseSafe native 1 errors
error: sub-compilation of libcxx failed
    compiler/zig/lib/libcxx/include/__random/clamp_to_integral.h:47:58: note: use of undeclared identifier 'INFINITY'
      if (__r >= ::nextafter(static_cast<_RealT>(__max_val), INFINITY)) {
                                                             ^
    compiler/zig/lib/libcxx/src/random.cpp:18:10: note: in file included from compiler/zig/lib/libcxx/src/random.cpp:18:
    #include <random>
             ^
    compiler/zig/lib/libcxx/include/random:1696:12: note: in file included from compiler/zig/lib/libcxx/include/random:1696:
    #  include <__random/geometric_distribution.h>

replacing that library file's INFINITY with std::numeric_limits<_RealT>::infinity() gives me this new error:

error: undefined symbol: _vkCmdPushDescriptorSetKHR
    note: referenced by /Users/vexo/Projects/clones/Cubyz/.zig-cache/o/55f7bbd8e1694b58dc7be9be1a25214a/Cubyz_zcu.o:_graphics.CommandBuffer.bindDescriptors
error: 1 compilation errors

@IntegratedQuantum
IntegratedQuantum marked this pull request as ready for review October 19, 2026 19:45
@IntegratedQuantum

Copy link
Copy Markdown
Member Author

@Vexo413 this PR is only about testing macos and compilation in the CI, so I'll merge it now.
Note that macos will still not actually run, due to missing OpenGL support. If you want you can test it again and make a new issue if you still get the same compilation error.

@IntegratedQuantum
IntegratedQuantum merged commit b8fcdba into PixelGuys:master Oct 19, 2026
4 checks passed
@IntegratedQuantum
IntegratedQuantum deleted the macos_CI branch October 19, 2026 19:58
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.

Check macos compilation in the CI The Game No Longer Compiles on MacOS

3 participants