Search code examples
out-of-memoryansiblemingw32

ansible mingw32-make out of memory


I try to automate a build via ansible on window7 Virtual Machine. My build is base on cmake (version 3.7.1) and mingw32 (version 4.9.2) as compiler. If I do the build directly in the VM by enter manually all command in the powershell, everything work find.

git clone --recursive somedepot
cd somedepot
cmake.bat .
mingw32-make all

Note : cmake.bat is the following script :

@cmake.exe -G"MinGW Makefile" %*

But when I try to do the same by ansible I got "cc1plus.exe: out of memory allocating 176080 bytes\r\nmingw32-make[2]" at the execution of mingw32-make all. But not on all build failed, I test my script before in a simple build and work well. It's when I wanted to go to the "real build" (which is more bigger) that the problem append.

Here my playbook :

- name: Some Build
  hosts: win_build

  tasks :
    - name: Get src
      win_command: git clone --recursive --branch "{{ tag_src }}" "{{ url_src }}" "{{ path_cmake }}"

    - name: CMake
      win_command: cmake.bat .
      args:
        chdir: "{{ path_cmake }}"

    - name: Make
      win_command: mingw32-make all                        
      args:
        chdir: "{{ path_cmake }}"

Thanks in advance.


Solution

  • I found the problem. It was a bug in powershell3. I applied microsoft hotfix and everything work fine.