NovelRT icon indicating copy to clipboard operation
NovelRT copied to clipboard

CMake: Potential Out of Order building causing errors depending on Generator/OS/etc

Open capnkenny opened this issue 2 years ago • 6 comments

Self-titled - essentially, depending on a number of different factors (which are hard to isolate), there is a potential for CMake to try and build things out of order even though there are dependencies listed, causing numerous errors, such as:

  • 0xc0000135 on Windows (due to not copying the DLLs at the right time)
  • Linking errors (missing linker files due to the dependencies themselves not being linked yet)

It seems that the more threads a device has to build with, the less likely this is actually going to happen - it's prominent to happen on CI for Windows 2019/2022, but locally and in Ubuntu/macOS it's not reproducible at this time. We may want to revamp our CMakeLists soon to get everything in order and to stop this from occurring.

capnkenny avatar Jul 12 '22 13:07 capnkenny

Is this CI only? Is it going to affect our release?

RubyNova avatar Jul 12 '22 14:07 RubyNova

There's a potential. At the moment it's CI only though

capnkenny avatar Jul 12 '22 14:07 capnkenny

What happens if we force single-threaded?

RubyNova avatar Jul 12 '22 15:07 RubyNova

I'm not sure - to be clear, the main issue is how CMake is choosing the order to build the items, which is something internal to CMake and not really controlled by us. If CMake decides to do copy_build_products_to_* before Engine, for example, then effectively nothing will get DLLs because it thinks it has copied everything already.

Since this is more of a CI concern (it hasn't really been reported locally yet), I don't think we need to do something prior to release, but its something to certainly visit afterwards for sure.

capnkenny avatar Jul 12 '22 15:07 capnkenny

I'm just worried this is going to suddenly break on us. It shouldn't be doing this.

RubyNova avatar Jul 12 '22 15:07 RubyNova

I don't think you have to worry that this should suddenly break - however I will say that if we continue to further add dependencies the way we are currently doing so, it's going to become more difficult to manage and this may show itself more without additional changes.

capnkenny avatar Jul 12 '22 17:07 capnkenny