# CMake gets stuck during Build

**URL:** https://discourse.cmake.org/t/cmake-gets-stuck-during-build/5047
**Category:** Usage
**Tags:** os:macos
**Created:** [February 17, 2022, 8:00pm UTC](https://discourse.cmake.org/t/cmake-gets-stuck-during-build/5047 "2022-02-17T20:00:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mrmsdbdl](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mrmsdbdl/32/2686_2.png) [@mrmsdbdl](https://discourse.cmake.org/u/mrmsdbdl)
#### Post date: [February 17, 2022, 8:00pm UTC](https://discourse.cmake.org/t/cmake-gets-stuck-during-build/5047/1 "2022-02-17T20:00:35Z")

</div>

I’m dealing with this strange situation that I cannot really wrap my head around! 😫

So, I have a CMake scripts called Patch.cmake [here](https://github.com/amirmasoudabdol/jasp-desktop/blob/qt-6.2-cmake-cpp-17/Patch.cmake) that goes and modify some library paths of some of the libraries that I’m installing. I know that the script works correctly! I run it once during the configuration using the `execute_process` [here](https://github.com/amirmasoudabdol/jasp-desktop/blob/d3173827b83b31db490b3a98214d16f6bd226566/R.cmake#L149) and several time during the build (for complicated reasons) using the `add_custom_target`/`add_custom_command` [here](https://github.com/amirmasoudabdol/jasp-desktop/blob/d3173827b83b31db490b3a98214d16f6bd226566/Modules.cmake#L192). This is supposed to install some R packages and fix their paths, however when I try to run it on GitHub Action, the one that is running with `add_custom_target`/`add_custom_command` during the build gets stuck in the first run, at the signing [here](https://github.com/amirmasoudabdol/jasp-desktop/blob/d3173827b83b31db490b3a98214d16f6bd226566/Patch.cmake#L165).

I’m out of ideas! I cannot see why the signing works during the configuration but not during the build. I’m also not building in parallel to make sure that I’m causing any extra issues. I don’t think this is caused by `add_custom_target`/`add_custom_command` because I can see that the `Patch.cmake` gets executed correctly up until the signing process ([this line](https://github.com/amirmasoudabdol/jasp-desktop/blob/d3173827b83b31db490b3a98214d16f6bd226566/Patch.cmake#L165)) of the first library.

I’m starting to think that something is up with the GitHub Action. Once I have left the Log open on the background and it just worked! 🤯

---

<div class="post-metadata">

### Author: ![mrmsdbdl](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mrmsdbdl/32/2686_2.png) [@mrmsdbdl](https://discourse.cmake.org/u/mrmsdbdl)
#### Post date: [February 18, 2022, 8:10am UTC](https://discourse.cmake.org/t/cmake-gets-stuck-during-build/5047/2 "2022-02-18T08:10:34Z")

</div>

I have a guess on why this is happening. I think it might be that the code singing cannot communicate with Apple’s server, or maybe there is a limit. So, I’m thinking to put the singing part into a loop and give it a timeout.
