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

Other base operating systems #124

Closed
KuraiAndras opened this issue Aug 13, 2021 · 8 comments
Closed

Other base operating systems #124

KuraiAndras opened this issue Aug 13, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@KuraiAndras
Copy link

As stated by the documentation site, Windows and MacOS support is planned, but I could not find any open issue for it. Any word on the ongoing work, or what would need to be done to make it happen?

@davidmfinol
Copy link
Member

Windows support seems feasible but requires a lot more work. See game-ci/unity-builder#82 and the recently created #windows-images channel on the game-ci discord

MacOS support is currently less feasible and would require even more work. See #55, containerd/containerd#5525, and https://macoscontainers.org/

@davidmfinol davidmfinol added the question Further information is requested label Aug 13, 2021
@KuraiAndras
Copy link
Author

Okay, so I did some initial work to make this feasible.
Repo: https://dev.azure.com/kuraiAndras/_git/UnityWindowsContainer
Docker Hub: https://hub.docker.com/repository/docker/huszky/unity_windows_container/
The builds are created and pushed via manually running the Azure pipeline.

I will do some test builds tomorrow on one of my active projects, and then, I will set up a test project inside the repo.
Some details about the implementation:

  • Only tested with the android version, I'm not sure if the UWP workload needs additional installs
  • I'm quite new to docker, so if something seems odd, then it's because I don't know how to do it better
  • The images are big ~21-28 GB range
  • The base image is using the .NET 4.8 servercore image, because that seemed to work. It might worth a try with the barebones server core image
  • OpenJDK is installed, but it should not be (although it is only required if you are using this for SonarQube, maybe it should not be included by default)
  • Visual Studio with the ManagedGame workload is installed - this is needed by the Visual Studio plugin integration, is needed when you want to generate the solution files to be consumable by MSBuild
  • For the android workload I put the android NDK, SDK, and OpenJDK needed by unity in the repo, and the files are copied during the docker build. This only works with the current Unity version (2021.1.21, 2021.1.22). The Game-CI project already did the legwork to discover the different versions needed by each unity version, something similar could be done with this.
  • This installs Unity at the same folder in which the Hub would install them
  • The installs are handled by chocolatey - this might be better by doing a manual install suggested by this comment Unity builds for Windows with il2cpp support  unity-builder#82 (comment)

@webbertakken
Copy link
Member

Nice work so far!

The images are big ~21-28 GB range

The Linux images are usually between 1.5GB (latest unity, linux target platform) and 5GB (older version android target platform) in size. So that should probably be our approximate goal for Windows containers as well.

The base image is using the .NET 4.8 servercore image, because that seemed to work. It might worth a try with the barebones server core image

That's a great start at least!

Perhaps we could use mcr.microsoft.com/windows/servercore:1903 and install missing dependencies, using https://github.com/adamrehn/dll-diagnostics.

@webbertakken webbertakken added enhancement New feature or request and removed question Further information is requested labels Sep 30, 2021
@adamrehn
Copy link

adamrehn commented Oct 1, 2021

Visual Studio with the ManagedGame workload is installed - this is needed by the Visual Studio plugin integration, is needed when you want to generate the solution files to be consumable by MSBuild

@KuraiAndras if those container images include the Visual Studio C++ Build Tools then you'll need to set their visibility on Docker Hub to private, since public distribution of the Build Tools is forbidden by Microsoft: microsoft/Windows-Containers#102

If it's just the C# build tools then I think it's okay though? (The .NET Framework SDK image is public and includes the Build Tools for managed code, so surely that case must be allowed.)

@KuraiAndras
Copy link
Author

@adamrehn Thanks for that. I'll take a look at that.

@KuraiAndras
Copy link
Author

KuraiAndras commented Oct 1, 2021

Okay, so calling the unity exe fails, with exit the code -1073741515. This would indicate that some DLL is missing presumably Visual C++ 2010 redistributable.
@adamrehn I looked at the created image and it seems that the c++ build tools are present in . I suppose if I remove them the lincensing problem would go away?
The VC folder seems to contain the msvc tools

    Directory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        10/1/2021  10:11 AM                Common7
d-----        10/1/2021  10:11 AM                ImportProjects
d-----        10/1/2021  10:11 AM                Licenses
d-----        10/1/2021  10:11 AM                MSBuild
d-----        10/1/2021  10:11 AM                Team Tools
d-----        10/1/2021  10:11 AM                VB
d-----        10/1/2021  10:11 AM                VC
d-----        10/1/2021  10:11 AM                VC#
d-----        10/1/2021  10:11 AM                Xml

Also are the Visual C++ redistributables considered as build tools. Because if so it seems that it would be impossible to create a windows image for Unity?

Edit: also i deleted the pushed images, I don't want to get in trouble with them

@adamrehn
Copy link

adamrehn commented Oct 2, 2021

Yeah, I think if you remove the C++ build tools then everything should be fine from a licensing perspective (although I'm not a lawyer and it would be really helpful if Microsoft actually provided clear information about this.) I'm guessing that Unity's IL2CPP functionality depends on C++ compiler support though, so removing the build tools will probably break that?

No, the Visual C++ Redistributables aren't part of the Build Tools, and their licence explicitly allows people to distribute them with their applications, so they're pretty safe from a licensing perspective.

@davidmfinol
Copy link
Member

Now that Windows builds have been added, the remaining platform is mac.
Closing this issue, as we can use the other issue to track mac: #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants