Cosmos icon indicating copy to clipboard operation
Cosmos copied to clipboard

Build error building on macOS 14

Open stevewpalmer opened this issue 9 months ago • 12 comments

Have you checked Github Issues for similar errors? YES

Exception /Users/steve/.nuget/packages/cosmos.build/0.1.0-localbuild/build/Cosmos.Build.targets(185,9): error MSB4062: The "Cosmos.Build.Tasks.IL2CPU" task could not be loaded from the assembly /Users/steve/.nuget/packages/cosmos.build/0.1.0-localbuild/build/../tools/net48/Cosmos.Build.Tasks.dll. Could not load file or assembly 'Cosmos.Build.Tasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983'. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [/Users/steve/source/jos/jos.csproj]

Visual Studio Output Logs Post the entire output log given by Visual Studio for the build

How To Reproduce

  1. Git clone the Cosmos sources as per the instructions.
  2. Run make, sudo make install in the Cosmos folder.
  3. Run dotnet new --install ./source/templates/csharp/
  4. In a new folder, run dotnet new cosmosCSKernel -n jos
  5. Edit the Kernel.cs to enter a valid namespace (to replace the template string).
  6. Compile with dotnet build.

Screenshots If applicable, add screenshots to help explain your problem.

Context Before posting please confirm that the following are in order [X] Both Cosmos VS Extensions are installed [ ] In the NuGet Package Manager "Include prerelease" is selected [ ] The Cosmos NuGet package store is selected (NOT nuget.org) in 'Manage NuGet Packages' [X] The Cosmos NuGet packages are installed

I'm unclear why it is seemingly attempting to load the net48 version of Cosmos.Build.Tasks.dll despite the above. Have I missed a step?

stevewpalmer avatar Oct 24 '23 09:10 stevewpalmer

At which commit did you clone the repository? we recently changed versions to fix an issue similar to this

quajak avatar Oct 24 '23 15:10 quajak

It was the HEAD commit (2d59be2336692214abd3d7917294195fef0f8a89) as of this morning.

stevewpalmer avatar Oct 24 '23 16:10 stevewpalmer

Can you checkout commit e8029773c7f9374773c13975e2b66883f883b900 and see if it works?

quajak avatar Oct 24 '23 22:10 quajak

for mac os you need to edit the make file so it will build il2cpu for masos and not linux, other then that if you follow the linux install guide it should work

zarlo avatar Oct 24 '23 23:10 zarlo

Can you clarify what edits to the makefile you're referring. The only one I have made is:

@echo "Publishing IL2CPU"
$(DOTNET) publish $(IL2CPU_DIR)/source/IL2CPU -r osx-x64 --self-contained $(DOTNETFLAGS)

Is there something else?

stevewpalmer avatar Oct 25 '23 15:10 stevewpalmer

Can you checkout commit e802977 and see if it works?

I already have that according to the git log:

commit e8029773c7f9374773c13975e2b66883f883b900 Merge: 95a6434dc 16ae7a711 Author: Quajak [email protected] Date: Wed Oct 18 09:44:30 2023 -0400

stevewpalmer avatar Oct 25 '23 16:10 stevewpalmer

I meant checkout that commit if the recent changes after that commit were the issue.

quajak avatar Oct 26 '23 13:10 quajak

No luck. Same problem, sorry.

stevewpalmer avatar Oct 26 '23 14:10 stevewpalmer

The assembly /Users/steve/.nuget/packages/cosmos.build/0.1.0-localbuild/build/../tools/net48/Cosmos.Build.Tasks.dll is present at that path. Opening the assembly in VS's Object Browser shows that there is indeed a Cosmos.Build.Tasks.IL2CPU class. So in theory the referenced assembly ought to be fine and the issue is down to missing dependencies or this is the wrong assembly type for the build. I don't have enough information yet to tell for sure.

stevewpalmer avatar Oct 26 '23 17:10 stevewpalmer

I sadly have no experience with Mac and I can't reproduce the issue locally. Unless you have some idea of getting more information, I don't know how we can solve this issue.

quajak avatar Oct 29 '23 14:10 quajak

Understood. I'll continue to investigate and look for a resolution. @zarlo - can you please answer the question about what edits to the makefile you were referring here ? Possibly that may be germane to the issue.

stevewpalmer avatar Oct 29 '23 16:10 stevewpalmer

Can you clarify what edits to the makefile you're referring. The only one I have made is:

@echo "Publishing IL2CPU"
$(DOTNET) publish $(IL2CPU_DIR)/source/IL2CPU -r osx-x64 --self-contained $(DOTNETFLAGS)

Is there something else?

i think that is it

zarlo avatar Oct 29 '23 21:10 zarlo