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

Fix build instructions #337

Closed
DiegoBM opened this issue Jan 22, 2019 · 16 comments
Closed

Fix build instructions #337

DiegoBM opened this issue Jan 22, 2019 · 16 comments
Labels
bug

Comments

@DiegoBM
Copy link

@DiegoBM DiegoBM commented Jan 22, 2019

At the moment, build instructions as they are in the master branch won't successfully build.
If you follow the instructions from a clean clone, when opening Xenko.sln it will start on "Xenko.GameStudio" as startup project, so if you just build as indicated in the README, it will fail for most projects. You actually need to change the startup project to "Xenko", build that one, and then you'll be able to successfully build "Xenko.GameStudio"

@DiegoBM DiegoBM added the bug label Jan 22, 2019
@Kryptos-FR

This comment has been minimized.

Copy link
Collaborator

@Kryptos-FR Kryptos-FR commented Jan 22, 2019

Not sure to get your point. If you follow the instructions, you will build the whole solution, so the startup project doesn't really matter.

Also, there is a good reason why the GameStudio is the default startup project: most other projects are libraries and therefore can't be the startup one.

@DiegoBM

This comment has been minimized.

Copy link
Author

@DiegoBM DiegoBM commented Jan 22, 2019

Please feel free to give it a try.
Clone the repository into a new folder, open build\Xenko.sln, and finally click Build -> Build Solution.

My results:
...
102>Done building project "Xenko.Samples.Tests.csproj" -- FAILED.
========== Build: 1 succeeded, 102 failed, 0 up-to-date, 0 skipped ==========

If I switch (as in the dropdown next to Solution Platforms) startup project to Xenko, and build that one, everything runs smoothly. Then I can build Xenko.GameStudio without any problem

@xen2

This comment has been minimized.

Copy link
Member

@xen2 xen2 commented Jan 22, 2019

Sounds like the issue is more about second build works better than first build (independent of startup project).
Can you please send us a log of the first (failing) build?

@DiegoBM

This comment has been minimized.

Copy link
Author

@DiegoBM DiegoBM commented Jan 22, 2019

Thank you @xen2, in my case it will fail regardless of how many consecutive times I click Build -> Build Solution as long as I don't change the startup project (or maybe there is another reason but changing it works for me). I'm sending you attached three consecutive build logs (I've diffed them and they are different but I presume it could be generation order or any other reason)

Note: The third attempt seems to have built many more projects but still 6 failures
build-log.txt
build-log-2.txt
build-log-3.txt

After the third attempt I switched to Xenko, built it, and then built GameStudio without any problem

@Kryptos-FR

This comment has been minimized.

Copy link
Collaborator

@Kryptos-FR Kryptos-FR commented Jan 22, 2019

@DiegoBM Changing the startup project doesn't affect the build if you then select to build a particular project. The step to change the startup project is not needed.

There seems to be an issue with project build order, though. Trying to get more logs to know why.

@xen2

This comment has been minimized.

Copy link
Member

@xen2 xen2 commented Jan 22, 2019

It looks like package are still restoring. Could be a timing issue, might need to wait a while until it works? (don't think I had that recently, VS was restoring package before trying to build).
Also those CL.exe/LINK.exe missing errors are really weird.

@DiegoBM

This comment has been minimized.

Copy link
Author

@DiegoBM DiegoBM commented Jan 22, 2019

You guys are correct in that it's not related to switching to Xenko, since I've just tried and switched immediately from a clean clone to Xenko, and building also triggers some errors. It must be a timing issue as you mentioned @xen2, is there any indicator that allows me to know that I can build? Since I wait until Visual Studio switches to "Ready" but that doesn't seem to be enough

@xen2

This comment has been minimized.

Copy link
Member

@xen2 xen2 commented Jan 22, 2019

Also, does building or running current project (which should be Game Studio) works rather than Build Solution?

@DiegoBM

This comment has been minimized.

Copy link
Author

@DiegoBM DiegoBM commented Jan 22, 2019

If you mean clicking the Green Play button immediately after Visual Studio switches to ready, it does also fail from a clean clone (I have several of them, running multiple tests here hehe)

@Kryptos-FR

This comment has been minimized.

Copy link
Collaborator

@Kryptos-FR Kryptos-FR commented Jan 22, 2019

I found the root issue: there is a resource contention to access the C++ linker (see error with link.exe in the log).

Possible workarounds:

  • change the settings in VS to only build one project at a time (make building slower)
  • build Xenko.Core first and only, then build the solution
  • spread the build of the few C++ projects far from each other in the build order (esp. Assimp vs Xenko.Core)
@xen2

This comment has been minimized.

Copy link
Member

@xen2 xen2 commented Jan 22, 2019

The likely culprit is Xenko.Native.targets calling another .sln (which doesn't work well when called multiple time at the same time, maybe writing same files or something).
I will investigate tomorrow.

@DiegoBM

This comment has been minimized.

Copy link
Author

@DiegoBM DiegoBM commented Jan 22, 2019

Thank you @Kryptos-FR, I've found that if after opening a new clone I wait for like 5 or 6 minutes (even though it says "Ready", it seems to be doing a background live code analysis and the package manager seems to be working in the background as well even though there is no visual indication of it), it will display a few nuget errors and finally it will display a finished message. After that I seem to be able to build the default project without issues (beyond few warnings)

Output from "Package Manager" section of the Output bar after 4-5 minutes (approx) of opening the project:

Error occurred while restoring NuGet packages: The operation failed as details for project Xenko.Samples.Templates could not be loaded.
Error occurred while restoring NuGet packages: The operation failed as details for project Xenko.Samples.Templates could not be loaded.
Error occurred while restoring NuGet packages: The operation failed as details for project Xenko.Samples.Templates could not be loaded.
Error occurred while restoring NuGet packages: The operation failed as details for project Xenko.Core.BuildEngine.Common could not be loaded.
Error occurred while restoring NuGet packages: The operation failed as details for project Xenko.Games.Testing could not be loaded.
Error occurred while restoring NuGet packages: The operation failed as details for project Xenko.Games.Testing could not be loaded.
Error occurred while restoring NuGet packages: The operation failed as details for project Xenko.Input could not be loaded.
Time Elapsed: 00:00:17.6495128
========== Finished ==========

In any case, since I can build, it's not a problem for me, I just want to save the frustration from other newcomers, since you have an amazing engine going on here and it would be sad to have people having wrong thoughts for small things like this, if that makes any sense. Thank you both for your help.

@xen2 xen2 closed this in 2982d61 Jan 23, 2019
@xen2

This comment has been minimized.

Copy link
Member

@xen2 xen2 commented Jan 23, 2019

Can you try again with latest master and reopen if you still have issues?
I fixed the missing link.exe/cl.exe, but you might still have issues with restore.
Don't think I can do much about the restore (but hopefully you won't need to wait 4-5 min for that one, just a few seconds)

@DiegoBM

This comment has been minimized.

Copy link
Author

@DiegoBM DiegoBM commented Jan 23, 2019

@xen2 I tried again with similar results, 22 success and 80 failures on first build (there is improvement though), after giving it some time (to fetch dependencies I presume) it will just build normally. In any case I'll leave it closed and leave it to your judgement to decide the extent of this and whether or not is worth mentioning it in the build steps (maybe it's me the only person going through this?)

@xen2

This comment has been minimized.

Copy link
Member

@xen2 xen2 commented Jan 23, 2019

Could you share the new log to see if the cl.exe/link.exe missing errors are gone at least?

@DiegoBM

This comment has been minimized.

Copy link
Author

@DiegoBM DiegoBM commented Jan 23, 2019

I sure can
build-log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.