Skip to content

Conversation

@xuxin930
Copy link
Contributor

@xuxin930 xuxin930 commented Oct 10, 2024

Summary

  • MSYS2 + CMAKE + NINJA build is broken due a limit of 8192 characters for command line arguments on Windows.
  • Ninja generator in CMake needs to be disabled until a solution is found, use Makefile generator.
  • This is a quick fix for CI builds ending up with parameter list too long errors.

Impact

  • MSYS2 CI Build system: Makefile generator is used by CMake in place of Ninja (may result in slower builds).

Testing

@cederom
Copy link
Contributor

cederom commented Oct 10, 2024

Thanks @xuxin930 :-)

  • If the problem is on CI then developers on their local machines will have that problem too? Does that mean CMake + Ninja is broken on windoze?
  • Does this come from NTFS fileystem limitation in long file/dir names?
  • How does that change impacts build time? Ninja is known to provide faster builds..
  • Quick search of the problem over the web found two causes: file names/paths too long [1], or unused parameters provided to CMake [2].
  • Also I remember there were starange problems when working on windoze in unix emulated environment with files outside emulated ~/ (home) location. Mybe this is the case here too?

[1] https://discourse.slicer.org/t/long-path-using-ninja/1702
[2] msys2/MINGW-packages#835

@xuxin930
Copy link
Contributor Author

Thanks @xuxin930 :-)

  • If the problem is on CI then developers on their local machines will have that problem too? Does that mean CMake + Ninja is broken on windoze?
  • Does this come from NTFS fileystem limitation in long file/dir names?
  • How does that change impacts build time? Ninja is known to provide faster builds..
  • Quick search of the problem over the web found two causes: file names/paths too long [1], or unused parameters provided to CMake [2].
  • Also I remember there were starange problems when working on windoze in unix emulated environment with files outside emulated ~/ (home) location. Mybe this is the case here too?

[1] https://discourse.slicer.org/t/long-path-using-ninja/1702 [2] msys2/MINGW-packages#835

@cederom Yes, we actually split the AR process in CMake to avoid this.
But this seems to only work for the Makefile generator, and it is still an AR on the Ninja generator. I guess it is related to the generator.
There is no problem when using the CMake+Makefile generator on Msys.

refer:apache/nuttx#13971

CI in the msys2 environment, the CMake ninja generator
will have a problem with parameters being too long

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
@cederom
Copy link
Contributor

cederom commented Oct 10, 2024

Okay I filled in a new Issue to remember this needs a fix :-)

@cederom cederom requested a review from lupyuen October 10, 2024 03:04
Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @xuxin930 :-) This is a quick fix, please update when fix for Ninja on msys2 is found :-)

Copy link
Member

@lupyuen lupyuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @simbit18: Are you OK with this fix?

Hi @xuxin930: Let's wait for the confirmation. Usually we fix build.yml first in nuttx repo, then sync down to nuttx-apps, like this: #2653.

Once we get confirmation, please create the PR in nuttx repo. Then we will sync it to nuttx-apps. Thanks!

@simbit18
Copy link
Contributor

simbit18 commented Oct 10, 2024

Hi, before we disable -N on Msys2, let's try to solve the error.

I cannot help you now, I will be able to look for a solution on Thursday of next week.

I don't know if this way can help

CMake variable CMAKE_NINJA_FORCE_RESPONSE_FILE to ON.

https://cosylab.com/technology/a-compact-and-fast-build-system-fit-for-a-ninja/

https://gitlab.kitware.com/cmake/cmake/-/issues/21104

@xuxin930
Copy link
Contributor Author

Let's discuss it here apache/nuttx#14014

@xuxin930
Copy link
Contributor Author

Hi @simbit18: Are you OK with this fix?

Hi @xuxin930: Let's wait for the confirmation. Usually we fix build.yml first in nuttx repo, then sync down to nuttx-apps, like this: #2653.

Once we get confirmation, please create the PR in nuttx repo. Then we will sync it to nuttx-apps. Thanks!

thanks @lupyuen NuttX repo has been merged apache/nuttx#14014

@xiaoxiang781216 xiaoxiang781216 merged commit 131ff36 into apache:master Oct 12, 2024
@xiaoxiang781216
Copy link
Contributor

@simbit18 you can revert the change after fixing the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants