Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,17 @@ jobs:

- name: Stage native libraries in project
run: |
set -euo pipefail

mkdir -p src/MLXSharp/runtimes/osx-arm64/native
cp artifacts/native/osx-arm64/libmlxsharp.dylib src/MLXSharp/runtimes/osx-arm64/native/
Copy link

Copilot AI Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding set -euo pipefail at line 175 makes the script more strict, but the existing cp command at line 178 will still fail if libmlxsharp.dylib is missing. Consider adding a similar conditional check for the required libmlxsharp.dylib file to maintain consistency with the optional mlx.metallib handling, or document why this file's absence should cause a hard failure while mlx.metallib's absence should not.

Suggested change
cp artifacts/native/osx-arm64/libmlxsharp.dylib src/MLXSharp/runtimes/osx-arm64/native/
if [ -f artifacts/native/osx-arm64/libmlxsharp.dylib ]; then
cp artifacts/native/osx-arm64/libmlxsharp.dylib src/MLXSharp/runtimes/osx-arm64/native/
else
echo "::error::libmlxsharp.dylib not found in macOS native artifact; cannot continue"
exit 1
fi

Copilot uses AI. Check for mistakes.
cp artifacts/native/osx-arm64/mlx.metallib src/MLXSharp/runtimes/osx-arm64/native/

if [ -f artifacts/native/osx-arm64/mlx.metallib ]; then
cp artifacts/native/osx-arm64/mlx.metallib src/MLXSharp/runtimes/osx-arm64/native/
else
echo "::warning::mlx.metallib not found in macOS native artifact; continuing without Metal shaders"
fi

mkdir -p src/MLXSharp/runtimes/linux-x64/native
cp artifacts/native/linux-x64/libmlxsharp.so src/MLXSharp/runtimes/linux-x64/native/

Expand All @@ -186,7 +194,12 @@ jobs:
TEST_OUTPUT="src/MLXSharp.Tests/bin/Release/net9.0"
mkdir -p "$TEST_OUTPUT/runtimes/osx-arm64/native"
cp src/MLXSharp/runtimes/osx-arm64/native/libmlxsharp.dylib "$TEST_OUTPUT/runtimes/osx-arm64/native/"
cp src/MLXSharp/runtimes/osx-arm64/native/mlx.metallib "$TEST_OUTPUT/runtimes/osx-arm64/native/"

if [ -f src/MLXSharp/runtimes/osx-arm64/native/mlx.metallib ]; then
cp src/MLXSharp/runtimes/osx-arm64/native/mlx.metallib "$TEST_OUTPUT/runtimes/osx-arm64/native/"
else
echo "::warning::mlx.metallib not staged; tests will continue without Metal shaders"
fi
ls -la "$TEST_OUTPUT/runtimes/osx-arm64/native/"

- name: Run tests
Expand Down
Loading