Skip to content

Commit a7b5792

Browse files
committed
Merge remote-tracking branch 'origin/main' into codex/fix-msbuild-project-specification-error-5h26ws
# Conflicts: # .github/workflows/ci.yml # MLXSharp.slnx # README.md # src/MLXSharp.Native/README.md # src/MLXSharp/MLXSharp.csproj
2 parents 42099ce + 821b67c commit a7b5792

File tree

9 files changed

+11
-50
lines changed

9 files changed

+11
-50
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
run: dotnet --info
2424

2525
- name: Restore dependencies
26-
run: dotnet restore MLXSharp.slnx
26+
run: dotnet restore
2727

2828
- name: Build C# projects (initial validation)
29-
run: dotnet build MLXSharp.slnx --configuration Release --no-restore
29+
run: dotnet build --configuration Release --no-restore
3030

3131
- name: Install CMake
3232
run: brew install cmake
@@ -41,7 +41,7 @@ jobs:
4141
ls -la src/MLXSharp.Native/runtimes/osx-arm64/native/
4242
4343
- name: Rebuild solution with native libraries
44-
run: dotnet build MLXSharp.slnx --configuration Release --no-restore
44+
run: dotnet build --configuration Release --no-restore
4545

4646
- name: Setup Python for HuggingFace
4747
uses: actions/setup-python@v5
@@ -66,7 +66,7 @@ jobs:
6666
ls -la "$TEST_OUTPUT/runtimes/osx-arm64/native/"
6767
6868
- name: Run tests
69-
run: dotnet test MLXSharp.slnx --configuration Release --no-build --logger "trx;LogFileName=TestResults.trx" --results-directory artifacts/test-results
69+
run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=TestResults.trx" --results-directory artifacts/test-results
7070
env:
7171
MLXSHARP_MODEL_PATH: ${{ github.workspace }}/models/Qwen1.5-0.5B-Chat-4bit
7272

MLXSharp.slnx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<Solution>
2-
<Configurations>
3-
<Platform Name="Any CPU" />
4-
<Platform Name="x64" />
5-
<Platform Name="x86" />
6-
</Configurations>
72
<Folder Name="/src/">
8-
<Project Path="src/MLXSharp.Native/MLXSharp.Native.csproj" />
93
<Project Path="src/MLXSharp.SemanticKernel/MLXSharp.SemanticKernel.csproj" />
104
<Project Path="src/MLXSharp.Tests/MLXSharp.Tests.csproj" />
115
<Project Path="src/MLXSharp/MLXSharp.csproj" />

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ The design mirrors the packaging approach from projects such as [LLamaSharp](htt
1717
```
1818
├── extern/mlx # Git submodule with the official MLX sources
1919
├── native/ # Native wrapper scaffold (CMake project)
20-
├── src/MLXSharp/ # Managed library with Microsoft.Extensions.AI adapters
21-
├── src/MLXSharp.Native/ # Native runtime packaging project with stub binaries
20+
├── src/MLXSharp/ # Managed library with Microsoft.Extensions.AI adapters + packaged runtimes
2221
├── src/MLXSharp.SemanticKernel/ # Semantic Kernel integration (separate package)
2322
└── src/MLXSharp.Tests/ # Integration tests covering DI and Semantic Kernel
2423
```
@@ -100,7 +99,7 @@ This package depends on MLXSharp and adds Semantic Kernel chat completion servic
10099

101100
GitHub Actions automatically:
102101
1. Compiles native wrapper with MLX submodule
103-
2. Copies `libmlxsharp.dylib` to `src/MLXSharp.Native/runtimes/osx-arm64/native/`
102+
2. Copies `libmlxsharp.dylib` to `src/MLXSharp/runtimes/osx-arm64/native/`
104103
3. Packs managed + native together in NuGet package
105104

106105
At runtime `MlxNativeLibrary` automatically finds the right library:

TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dotnet test
1616
brew install cmake
1717
cmake -S native -B native/build -DCMAKE_BUILD_TYPE=Release
1818
cmake --build native/build --target mlxsharp
19-
cp native/build/libmlxsharp.dylib src/MLXSharp.Native/runtimes/osx-arm64/native/
19+
cp native/build/libmlxsharp.dylib src/MLXSharp/runtimes/osx-arm64/native/
2020
```
2121

2222
Stub версія лінкується з MLX але повертає тестові дані замість реальних результатів моделі.

src/MLXSharp.Native/MLXSharp.Native.csproj

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/MLXSharp.Native/README.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/MLXSharp/MLXSharp.csproj

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,9 @@
77
<PackageReference Include="Microsoft.Extensions.AI" Version="9.9.1" />
88
</ItemGroup>
99

10-
<ItemGroup>
11-
<ProjectReference Include="..\MLXSharp.Native\MLXSharp.Native.csproj"
12-
ReferenceOutputAssembly="false"
13-
PrivateAssets="all"
14-
IncludeAssets="none" />
15-
</ItemGroup>
16-
1710
<PropertyGroup>
18-
<MLXSharpProjectDirectory>$(MSBuildThisFileDirectory)</MLXSharpProjectDirectory>
19-
<MLXSharpNativeRuntimeRoot>$(MLXSharpProjectDirectory)..\MLXSharp.Native\runtimes</MLXSharpNativeRuntimeRoot>
20-
<MLXSharpMacNativeBinary Condition="'$(MLXSharpMacNativeBinary)' == ''">$(MLXSharpProjectDirectory)..\..\native\build\libmlxsharp.dylib</MLXSharpMacNativeBinary>
21-
<MLXSharpMacNativeDestination>$(MLXSharpNativeRuntimeRoot)\osx-arm64\native\libmlxsharp.dylib</MLXSharpMacNativeDestination>
22-
<MLXSharpMacNativeDestinationDir>$([System.IO.Path]::GetDirectoryName('$(MLXSharpMacNativeDestination)'))</MLXSharpMacNativeDestinationDir>
11+
<MLXSharpMacNativeBinary Condition="'$(MLXSharpMacNativeBinary)' == ''">$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)','..','..','native','build','libmlxsharp.dylib'))</MLXSharpMacNativeBinary>
12+
<MLXSharpMacNativeDestination>$([System.IO.Path]::Combine('$(MSBuildProjectDirectory)','runtimes','osx-arm64','native','libmlxsharp.dylib'))</MLXSharpMacNativeDestination>
2313
<MLXSharpSkipMacNativeValidation Condition="'$(MLXSharpSkipMacNativeValidation)' == ''">false</MLXSharpSkipMacNativeValidation>
2414
</PropertyGroup>
2515

@@ -53,9 +43,9 @@
5343
Text="libmlxsharp.dylib is missing. Build the native library or supply MLXSharpMacNativeBinary before packing." />
5444
</Target>
5545

56-
<!-- Include native binaries from MLXSharp.Native project into this package -->
46+
<!-- Include native binaries embedded in this project -->
5747
<ItemGroup>
58-
<None Include="..\MLXSharp.Native\runtimes\**\*.*"
48+
<None Include="runtimes\**\*.*"
5949
Pack="true"
6050
PackagePath="runtimes/%(RecursiveDir)%(Filename)%(Extension)"
6151
CopyToOutputDirectory="PreserveNewest"

0 commit comments

Comments
 (0)