Skip to content

Add macOS support to gfxstream build systems and CI#109

Open
ericcurtin wants to merge 1 commit intogoogle:mainfrom
ericcurtin:kosmickrisp
Open

Add macOS support to gfxstream build systems and CI#109
ericcurtin wants to merge 1 commit intogoogle:mainfrom
ericcurtin:kosmickrisp

Conversation

@ericcurtin
Copy link

@ericcurtin ericcurtin commented Mar 3, 2026

Fix CMake build for Apple Silicon (ASTC NEON ISA selection, XCB header
guards, duplicate VK platform define cleanup). Add Meson build parity
with ObjC/ObjC++ language support, darwin platform handling, macOS
framework dependencies, and platform-specific sources. Add macOS CI
jobs for CMake, Meson, and Bazel builds on Apple Silicon runners.
Include KosmicKrisp Vulkan ICD support on macOS.

@ericcurtin
Copy link
Author

@jmacnak @kocdemir could you kick off the builds and review please?

@ericcurtin ericcurtin changed the title Add KosmicKrisp Vulkan ICD support on macOS Add macOS support to gfxstream build systems and CI Mar 4, 2026
Fix CMake build for Apple Silicon (ASTC NEON ISA selection, XCB header
guards, duplicate VK platform define cleanup). Add Meson build parity
with ObjC/ObjC++ language support, darwin platform handling, macOS
framework dependencies, and platform-specific sources. Add macOS CI
jobs for CMake, Meson, and Bazel builds on Apple Silicon runners.
Include KosmicKrisp Vulkan ICD support on macOS.

Signed-off-by: Eric Curtin <eric.curtin@docker.com>
@gurchetansingh
Copy link
Collaborator

gurchetansingh commented Mar 19, 2026

Can you access the CI? It seems the meson and Bazel builds are broken:

In file included from ../host/renderer_impl.h:23:
In file included from ../host/render_window.h:24:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[166/221] Compiling C++ object host/vulkan/liblib_vulkan_server.a.p/vulkan_boxed_handles.cpp.o
[167/221] Compiling C++ object host/libgfxstream_backend.a.p/hwc2.cpp.o
[168/221] Compiling C++ object host/libgfxstream_backend.a.p/buffer.cpp.o
[169/221] Compiling C++ object host/libgfxstream_backend.a.p/color_buffer.cpp.o
In file included from ../host/color_buffer.cpp:20:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[170/221] Compiling C++ object host/libgfxstream_backend.a.p/read_buffer.cpp.o
[171/221] Compiling C++ object host/libgfxstream_backend.a.p/render_api.cpp.o
In file included from ../host/render_api.cpp:16:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[172/221] Compiling C++ object host/libgfxstream_backend.a.p/render_channel_impl.cpp.o
In file included from ../host/render_channel_impl.cpp:14:
In file included from ../host/render_channel_impl.h:18:
In file included from ../host/renderer_impl.h:23:
In file included from ../host/render_window.h:24:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[173/221] Compiling C++ object host/libgfxstream_backend.a.p/post_worker.cpp.o
In file included from ../host/post_worker.cpp:23:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[174/221] Compiling C++ object host/libgfxstream_backend.a.p/renderer_impl.cpp.o
In file included from ../host/renderer_impl.cpp:14:
In file included from ../host/renderer_impl.h:23:
In file included from ../host/render_window.h:24:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[175/221] Compiling C++ object host/libgfxstream_backend.a.p/render_lib_impl.cpp.o
In file included from ../host/render_lib_impl.cpp:16:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[176/221] Compiling C++ object host/libgfxstream_backend.a.p/render_thread_info.cpp.o
In file included from ../host/render_thread_info.cpp:20:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[177/221] Compiling C++ object host/libgfxstream_backend.a.p/render_window.cpp.o
In file included from ../host/render_window.cpp:15:
In file included from ../host/render_window.h:24:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[178/221] Compiling C++ object host/libgfxstream_backend.a.p/render_thread.cpp.o
In file included from ../host/render_thread.cpp:26:
In file included from ../host/channel_stream.h:17:
In file included from ../host/render_channel_impl.h:18:
In file included from ../host/renderer_impl.h:23:
In file included from ../host/render_window.h:24:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[179/221] Compiling C++ object host/libgfxstream_backend.a.p/ring_stream.cpp.o
[180/221] Compiling C++ object host/vulkan/liblib_vulkan_server.a.p/vk_decoder_global_state.cpp.o
[181/221] Compiling C++ object host/libgfxstream_backend.a.p/virtio_gpu_context.cpp.o
[182/221] Compiling C++ object host/libgfxstream_backend.a.p/frame_buffer.cpp.o
In file included from ../host/frame_buffer.cpp:17:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[183/221] Compiling C++ object host/libgfxstream_backend.a.p/virtio_gpu_pipe.cpp.o
[184/221] Compiling C++ object host/libgfxstream_backend.a.p/sync_thread.cpp.o
[185/221] Compiling C++ object host/libgfxstream_backend.a.p/virtio_gpu_ring_blob.cpp.o
In file included from ../host/virtio_gpu_ring_blob.cpp:15:
../host/virtio_gpu_ring_blob.h:78:20: warning: private field 'mId' is not used [-Wunused-private-field]
    const uint64_t mId;
                   ^
../host/virtio_gpu_ring_blob.h:80:20: warning: private field 'mAlignment' is not used [-Wunused-private-field]
    const uint64_t mAlignment;
                   ^
2 warnings generated.
[186/221] Compiling C++ object host/libgfxstream_backend.a.p/virtio_gpu_gfxstream_renderer.cpp.o
In file included from ../host/virtio_gpu_gfxstream_renderer.cpp:24:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[187/221] Compiling C++ object host/libgfxstream_backend.a.p/virtio_gpu_resource.cpp.o
In file included from ../host/virtio_gpu_resource.cpp:19:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[188/221] Compiling C++ object host/libgfxstream_backend.a.p/virtio_gpu_timelines.cpp.o
[189/221] Compiling C++ object host/libgfxstream_backend.a.p/vsync_thread.cpp.o
[190/221] Compiling C++ object host/libgfxstream_backend.a.p/virtio_gpu_frontend.cpp.o
In file included from ../host/virtio_gpu_frontend.cpp:28:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[191/221] Compiling Objective-C++ object host/libgfxstream_backend.a.p/native_sub_window_cocoa.mm.o
../host/native_sub_window_cocoa.mm:105:13: warning: 'setWantsBestResolutionOpenGLSurface:' is deprecated: first deprecated in macOS 10.14 - Use NSOpenGLView instead. [-Wdeprecated-declarations]
    [glView setWantsBestResolutionOpenGLSurface:YES];
            ^
/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLView.h:47:16: note: property 'wantsBestResolutionOpenGLSurface' is declared deprecated here
@property BOOL wantsBestResolutionOpenGLSurface API_DEPRECATED("Use NSOpenGLView instead.", macos(10.7,10.14));
               ^
/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSOpenGLView.h:47:16: note: 'setWantsBestResolutionOpenGLSurface:' has been explicitly marked deprecated here
1 warning generated.
[192/221] Linking static target common/logging/liblib_common_logging.a
[193/221] Linking static target common/etc/libetc.a
[194/221] Linking static target common/testenv/liblib_common_testenv.a
[195/221] Compiling C++ object host/libgfxstream_backend.a.p/post_worker_gl.cpp.o
In file included from ../host/post_worker_gl.cpp:18:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
[196/221] Linking static target host/iostream/libhost_iostream.a
FAILED: [code=1] host/iostream/libhost_iostream.a 
rm -f host/iostream/libhost_iostream.a && ar csr host/iostream/libhost_iostream.a  && ranlib -c host/iostream/libhost_iostream.a
ar: no archive members specified
usage:  ar -d [-TLsv] archive file ...
	ar -m [-TLsv] archive file ...
	ar -m [-abiTLsv] position archive file ...
	ar -p [-TLsv] archive [file ...]
	ar -q [-cTLsv] archive file ...
	ar -r [-cuTLsv] archive file ...
	ar -r [-abciuTLsv] position archive file ...
	ar -t [-TLsv] archive [file ...]
	ar -x [-ouTLsv] archive [file ...]
[197/221] Linking static target common/utils/libcommon_utils.a
[198/221] Linking static target host/features/libhost_features.a
[199/221] Linking static target common/base/libcommon_base.a
[200/221] Compiling C++ object host/libgfxstream_backend.a.p/render_control.cpp.o
In file included from ../host/render_control.cpp:26:
In file included from ../host/frame_buffer.h:47:
../host/include/render-utils/render_api.h:41:1: warning: 'initLibrary' has C-linkage specified, but returns incomplete type 'gfxstream::RenderLibPtr' (aka 'unique_ptr<RenderLib>') which could be incompatible with C [-Wreturn-type-c-linkage]
LIST_RENDER_API_FUNCTIONS(RENDER_API_DECLARE)
^
../host/include/render-utils/render_api_functions.h:23:65: note: expanded from macro 'LIST_RENDER_API_FUNCTIONS'
#define LIST_RENDER_API_FUNCTIONS(X) X(gfxstream::RenderLibPtr, initLibrary, (), ())
                                                                ^
1 warning generated.
ninja: build stopped: subcommand failed.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /opt/homebrew/bin/ninja -C /Users/runner/work/gfxstream/gfxstream/build

Analyzing: 141 targets (189 packages loaded, 3092 targets configured)
[1 / 1] no actions running
ERROR: /Users/runner/Library/Caches/bazel/_bazel_runner/e0e6960e66cfc413e5afd0189feb84fa/external/+git_repository+angle/BUILD.bazel:194:11: configurable attribute "srcs" in @@+git_repository+angle//:angle_glslang doesn't match this configuration. Would a default condition help?

Conditions checked:
@@platforms//os:linux
@@platforms//os:windows

To see a condition's definition, run: bazel query --output=build .

This instance of @@+git_repository+angle//:angle_glslang has configuration identifier e5b2512. To inspect its configuration, run: bazel config e5b2512.

For more help, see https://bazel.build/docs/configurable-attributes#faq-select-choose-condition.

ERROR: Analysis of target '//common/testenv:graphics_test_environment_drivers' failed; build aborted: Analysis failed
INFO: Elapsed time: 32.833s, Critical Path: 0.03s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:
Error: Process completed with exit code 1.

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.

3 participants