Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS X ARM64 #402

Merged
merged 89 commits into from
Aug 10, 2023
Merged

OS X ARM64 #402

merged 89 commits into from
Aug 10, 2023

Conversation

wasabii
Copy link
Contributor

@wasabii wasabii commented Jul 29, 2023

Based on net6 branch. Added OSX-ARM64 output.

Deprecated NET Core 3.1 tools and images.

Tools now using NET 6 to build NET Core 3.1 libraries.

wasabii added 30 commits April 13, 2023 12:52
Signed-off-by: Jerome Haltom <[email protected]>
Backport change to OS X version.

Signed-off-by: Jerome Haltom <[email protected]>
Try to set +x on OS X too.

Signed-off-by: Jerome Haltom <[email protected]>
Signed-off-by: Jerome Haltom <[email protected]>
Try to set mcast options for OS X. Stole these from in.h from some Apple web site. Unsure of accuracy.

Signed-off-by: Jerome Haltom <[email protected]>
AF_INET6 change.

Signed-off-by: Jerome Haltom <[email protected]>
Another.

Signed-off-by: Jerome Haltom <[email protected]>
Add MacOSX preferences.

Signed-off-by: Jerome Haltom <[email protected]>
Do not enable WSL on non-windows.

Signed-off-by: Jerome Haltom <[email protected]>
Set X on OSX

Signed-off-by: Jerome Haltom <[email protected]>
Signed-off-by: Jerome Haltom <[email protected]>
Fix major version.

Signed-off-by: Jerome Haltom <[email protected]>
@wasabii
Copy link
Contributor Author

wasabii commented Aug 8, 2023

Also I have no idea how we're going to handle code signing.

@paulirwin
Copy link

I am making progress getting it to build, but it doesn't like the JDK 17 javac I have installed. Having trouble currently getting a JDK 8 build installed via Homebrew for use under Rosetta. I'll keep digging and see if I can get one working.

@wasabii
Copy link
Contributor Author

wasabii commented Aug 8, 2023

I do not know exactly what luck you will have building the whole thing on OS X ARM64. The osxarm64 branch still has Core 3.1 building enabled, which probably isn't going to work.

@paulirwin
Copy link

Gotcha, hm. I am not sure if I will be able to easily run the unit tests then locally if I can't build locally. I guess theoretically it's possible to build the binaries on one machine and then copy them over and see if Rider accepts that as a built artifact... I'll have to try that later.

Given that .NET Core 3.1 is no longer supported, is it a possibility to just drop that target altogether? Although it would still encounter a problem building for .NET FX of course. It would be great if there is a way to set a flag or use a separate msbuildproj or something that excludes .NET FX (or older Core 3.1) from the build on this platform. But I have zero idea how complicated that would be (I'm assuming the answer is "very").

wasabii added 2 commits August 8, 2023 16:11
… signing the OS X binaries. Integrate into CLang and .NET processes. Install the Rust crate in CI/CD.

This is required on ARM64. But we'll sign on X64 too.
We do an ad-hoc signature. Which should allow it to run on developer machines. Unknown how we'll approach actual release drops, or whether we even will.
@wasabii
Copy link
Contributor Author

wasabii commented Aug 9, 2023

The plan is to drop Core 3.1, yes. But that's on another branch, which will go in after OSX ARM64. So, that's unfortunate for you.

It's possible I'll have a osx-arm64 build by the end of day today. Looks like I've got almost all of the test cases excluded.

And I just pushed support for doing ad-hoc codesigning of the executables and shared libraries. Yuck.

So... soon. Maybe.

@wasabii wasabii merged commit b6815c7 into develop Aug 10, 2023
@wasabii wasabii deleted the osxarm64 branch August 10, 2023 14:46
@wasabii
Copy link
Contributor Author

wasabii commented Aug 11, 2023

@paulirwin

Develop branch has OSX-ARM64 merged in. And has built and generated a package in the GitHub private repository.

Would you be interested in testing?

Most of the unit tests ran on CI/CD, on OSX-X64. And I got the signing in place. And I signed up for a quick Scaleway M1 instance for 30 minutes to run the OpenJDK test suite. It mostly all ran on ARM64.

I haven't attempted to run the SDK (msbuild, ikvmreference, mavenreference, etc) stuff on ARM64, because the Mac instance I fired up was super slow and hard to get things on.

So, yeah, I've never directly tried all of this on OSX-ARM64. So it might not work. But it also might work.

Give it a go!

Package version is 8.7.0-dev.268

@wasabii
Copy link
Contributor Author

wasabii commented Aug 11, 2023

@BiologyTools You too.

@wasabii
Copy link
Contributor Author

wasabii commented Aug 11, 2023

Eh. Already found a bug. Bad path in the MSBuild files for the SDK tools. So, IkvmReference will fail.

Fixed. New thing pushed. Another 8 hours until build done. Heh.

In the meantime you can probably plop this into your project file at the bottom to fix it:

    <ItemGroup>
        <IkvmCompilerToolPath Include="$(NuGetPackageRoot)\ikvm.msbuild.tools.runtime.osx-arm64\8.7.0-dev.268\ikvmc\net472\osx-arm64\" TargetFramework="net472" RuntimeIdentifier="osx-arm64" />
        <IkvmCompilerToolPath Include="$(NuGetPackageRoot)\ikvm.msbuild.tools.runtime.osx-arm64\8.7.0-dev.268\ikvmc\net6.0\osx-arm64\" TargetFramework="net6.0" RuntimeIdentifier="osx-arm64" />
        <IkvmExporterToolPath Include="$(NuGetPackageRoot)\ikvm.msbuild.tools.runtime.osx-arm64\8.7.0-dev.268\ikvmstub\net472\osx-arm64\" TargetFramework="net472" RuntimeIdentifier="osx-arm64" />
        <IkvmExporterToolPath Include="$(NuGetPackageRoot)\ikvm.msbuild.tools.runtime.osx-arm64\8.7.0-dev.268\ikvmstub\net6.0\osx-arm64\" TargetFramework="net6.0" RuntimeIdentifier="osx-arm64" />
    </ItemGroup>
    ```

@wasabii
Copy link
Contributor Author

wasabii commented Aug 11, 2023

That last build thing is fixed in .269

@paulirwin
Copy link

Will do, thanks! What is the best way to try this out? Download the nuget artifact from the build (I'll probably wait until .269 is complete) and install locally into my project?

@BiologyTools
Copy link

@BiologyTools You too.

Unfortunately I don't have an arm64 Mac to test things on. I only have a x64 mac. But thanks for the mention and the great work you are doing. I bet many biologists will download the bioformats library in NET6 once IKVM 8.7.0 is released. I could try and ask for help with testing on the bioformats image.sc forum.

@wasabii
Copy link
Contributor Author

wasabii commented Aug 11, 2023

@paulirwin Add the Github private repo as a nuget source.

@paulirwin
Copy link

Ah gotcha, my mind was thinking "Git repo" when you said that and I was assuming you meant the build artifacts. Will do!

@paulirwin
Copy link

I'm not sure what the problem is but I can't seem to install from the GitHub NuGet feed. I created a new PAT with the read:packages permission, and added what I think is the right source url (https://nuget.pkg.github.com/ikvmnet/index.json) because it shows the 8.7.0 prerelease package successfully in Rider, but when I try to install/restore from either Rider or the dotnet CLI I get a 401 error, saying my token isn't valid.

Is that because I'm not a contributor to the repo or something? Let me know if you have any guidance; this is the first time I've tried this with a public GitHub project that I'm not a member of. Thanks!

@paulirwin
Copy link

My apologies for the delay on this, but I saw that the prerelease packages were published, and I was able to update my JavaToCSharp project to use these in a branch, and it works great on macOS Arm64. I can even now run the Avalonia GUI directly without having to cross-compile from an x64 machine. I'm extremely grateful for this effort! Branch: https://github.com/paulirwin/JavaToCSharp/tree/feature/ikvm-8.7

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