llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[flang] Flang fails to build when building on different amount of cores than LLVM Buildbot

Open pawosm-arm opened this issue 1 year ago • 12 comments

After merging #161179 I'm observing this:

23:03:50  /workspace/src/flang/include/flang/Optimizer/Dialect/MIF/MIFDialect.h:26:10: fatal error: 'flang/Optimizer/Dialect/MIF/MIFDialect.h.inc' file not found
23:03:50     26 | #include "flang/Optimizer/Dialect/MIF/MIFDialect.h.inc"
23:03:50        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23:03:50  1 error generated.

Apparently, CMake doesn't generate MIFDialect.h.inc out of MIFDialect.td on time when it's needed.

This is a typical build parallelism issue that haunts flang from time to time. Likely some cmake is missing a dependency.

pawosm-arm avatar Oct 22 '25 14:10 pawosm-arm

@JDPailleux please could you have a look at this.

tblah avatar Oct 22 '25 16:10 tblah

Yes of course, I take a look !

JDPailleux avatar Oct 23 '25 05:10 JDPailleux

@pawosm-arm This PR #164309 doesn't resolve the error ?

JDPailleux avatar Oct 23 '25 07:10 JDPailleux

@JDPailleux possibly. Unfortunately, our CI (where the problem manifested itself) is all red today due to some other (unrelated) issue which hits the building process much earlier, so I won't be able to confirm it until I investigate the new problem.

pawosm-arm avatar Oct 23 '25 07:10 pawosm-arm

@JDPailleux bad news, the last build which failed from the issue signaled here, it already had #164309 merged. Apparently, it didn't help (seems it only helps standalone builds), but the new build time issue will only make harder to investigate it.

pawosm-arm avatar Oct 23 '25 07:10 pawosm-arm

@pawosm-arm Thanks for your feedback. I'll continue investigating.

JDPailleux avatar Oct 23 '25 07:10 JDPailleux

@JDPailleux I suspect what is missing here is a dependency from some other library on the MIFDialect library. #164309 worked the other way: adding missing dependencies from MIFDialect on other libraries.

tblah avatar Oct 23 '25 08:10 tblah

@pawosm-arm Do you have any further details about your CI or more trace or other ? Unfortunately, I am unable to reproduce any link errors on my CI. I also tried looking at each file individually to see what might be missing, but nothing obvious stands out.

JDPailleux avatar Oct 23 '25 12:10 JDPailleux

@JDPailleux it seems the key CMake setting that exposes the issue is:

-DBUILD_SHARED_LIBS=True

pawosm-arm avatar Oct 23 '25 12:10 pawosm-arm

Hum, I've this CMake key too. I'll keep looking, so I'll find it one day ;)

JDPailleux avatar Oct 23 '25 12:10 JDPailleux

@pawosm-arm I think I've found it, I'll confirm it and open the PR.

JDPailleux avatar Oct 23 '25 14:10 JDPailleux

This PR looks weird (removing things rather than adding to the CMakefile), but somehow it made our CI green. Note that I had to test for the other issue alongside, so it wasn't the recommended 'change one thing at a time' approach.

pawosm-arm avatar Oct 23 '25 20:10 pawosm-arm