Skip to content

[Build][Android] Ninja fails with wildcard error "glsl/*" on macOS (Darwin Kernel 26) / NDK 29 #16354

@Peddinti-Sriram-Bharadwaj

Description

Cross-compiling ExecuTorch Runner for Android arm64 fails during the Ninja build phase with a wildcard dependency error in the Vulkan backend. The CMake configuration for vulkan_compute_shaders passes an unexpanded wildcard pattern (backends/vulkan/runtime/graph/ops/glsl/*) to Ninja, which treats the asterisk as a literal filename character and fails.

Error Message

ninja: error: '/Users/username/executorch/backends/vulkan/runtime/graph/ops/glsl/*', needed by 'vulkan_compute_shaders/spv.cpp', missing and no known rule to make it

Environment

  • Host OS: macOS Sequoia (Darwin Kernel Version 26.0.0)
  • Host Architecture: Apple M3
  • Target Platform: Android arm64-v8a, API Level 35
  • NDK Version: 29.0.14206865
  • CMake Version: 3.x (Homebrew)
  • Ninja Version: 1.13.2
  • Python: 3.10 (Conda environment)
  • ExecuTorch Branch: main (December 2025)

Steps to Reproduce

  1. Set up environment:
conda create -n executorch_build python=3.10
conda activate executorch_build
git clone https://github.com/pytorch/executorch.git
cd executorch
  1. Verify shader files exist:
ls backends/vulkan/runtime/graph/ops/glsl/*.glsl
# Confirms multiple .glsl files are present
  1. Configure with CMake:
export NDK_ROOT=/Users/username/Library/Android/sdk/ndk/29.0.14206865

cmake . -B cmake-out-android \
  -DCMAKE_TOOLCHAIN_FILE=$NDK_ROOT/build/cmake/android.toolchain.cmake \
  -DANDROID_ABI=arm64-v8a \
  -DANDROID_PLATFORM=android-35 \
  -DEXECUTORCH_BUILD_VULKAN=ON \
  -G Ninja
  1. Build:
cmake --build cmake-out-android -j8

Expected Behavior

CMake should expand the wildcard pattern glsl/* during configuration and pass the complete list of .glsl files to Ninja. The build should proceed to compile the Vulkan shaders.

Actual Behavior

The build fails immediately during Ninja execution because the wildcard * is passed literally to Ninja instead of being expanded to the actual .glsl filenames. Ninja cannot find a file literally named * and exits with an error.

Root Cause

The issue appears to be in the CMake configuration for Vulkan shader compilation (likely in backends/vulkan/runtime/graph/CMakeLists.txt). On this specific combination of macOS Sequoia + NDK 29 + CMake/Ninja versions, glob patterns are not being expanded at configure time.

Inspecting cmake-out-android/build.ninja shows the literal wildcard string rather than expanded filenames.

Additional Context

  • The .glsl source files are confirmed present on disk
  • This may be specific to macOS Darwin 26 kernel with NDK 29
  • The issue is purely in the build system configuration, not missing sources
  • Similar cross-compilation builds may be affected on recent macOS versions

Minimal Example

# Clone and setup
git clone https://github.com/pytorch/executorch.git
cd executorch

# Configure for Android with Vulkan
cmake . -B build-android \
  -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
  -DANDROID_ABI=arm64-v8a \
  -DEXECUTORCH_BUILD_VULKAN=ON \
  -G Ninja

# Attempt build - fails with wildcard error
cmake --build build-android

System Information

$ cmake --version
cmake version 3.30.x

$ ninja --version  
1.13.2

$ sw_vers
ProductName:        macOS
ProductVersion:     15.1
BuildVersion:       24B83

Versions

PyTorch Environment

  • PyTorch version: 2.10.0.dev20251120
  • Debug build: False
  • CUDA (build): None
  • ROCM (build): N/A

Operating System

  • OS: macOS 26.3 (arm64)
  • GCC version: Could not collect
  • Clang version: 17.0.0 (clang-1700.0.13.5)
  • CMake version: 3.31.10
  • Libc version: N/A

Python Environment

  • Python version: 3.10.19 (packaged by conda-forge)
  • Compiler: Clang 19.1.7
  • Runtime: 64-bit
  • Platform: macOS-26.3-arm64-arm-64bit

GPU/Accelerator Status

  • CUDA available: False
  • CUDA runtime: No CUDA
  • CUDA_MODULE_LOADING: N/A
  • GPU models: No CUDA
  • Nvidia driver: No CUDA
  • cuDNN: No CUDA
  • XPU available: False
  • HIP runtime: N/A
  • MIOpen runtime: N/A
  • XNNPACK available: True

CPU

Apple M3

Installed Libraries

pip3 packages

  • executorch: 1.1.0a0+227ff2e
  • numpy: 2.2.6
  • pytorch_tokenizers: 1.0.1
  • torch: 2.10.0.dev20251120
  • torchao: 0.16.0+git08e5e203f
  • torchaudio: 2.10.0.dev20251220
  • torchvision: 0.25.0.dev20251220

conda packages

  • executorch: 1.1.0a0+227ff2e (pypi_0, pypi)
  • numpy: 2.2.6 (pypi_0, pypi)
  • pytorch-tokenizers: 1.0.1 (pypi_0, pypi)
  • torch: 2.10.0.dev20251120 (pypi_0, pypi)
  • torchao: 0.16.0+git08e5e203f (pypi_0, pypi)
  • torchaudio: 2.10.0.dev20251220 (pypi_0, pypi)
  • torchvision: 0.25.0.dev20251220 (pypi_0, pypi)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions