package build fails at r324504 or later on VS2017

Hello

llvm build fails at r324504 or later.
I used the attached file to build. (renamed to .txt)

example:
clang-build.bat ninja x86 update 324806

This is the tail of the failure log.

CPack: Create package using NSIS
CPack: Install projects
CPack: - Install project: LLVM
Creating llvm-ranlib.exe
Creating llvm-lib.exe
Creating llvm-dlltool.exe
Creating clang++.exe
Creating clang-cl.exe
Creating clang-cpp.exe
Creating …/msbuild-bin/cl.exe
Creating lld-link.exe
Creating ld.lld.exe
Creating ld64.lld.exe
Creating wasm-ld.exe
Creating llvm-readelf.exe
CPack: Create package
CPack Error: Problem running NSIS command: “C:/Program Files (x86)/NSIS/makensis.exe” “C:/Jenkins/workspace/llvm/build/_CPack_Packages/win32/NSIS/project.nsi”
Please check C:/Jenkins/workspace/llvm/build/_CPack_Packages/win32/NSIS/NSISOutput.log for errors
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: LLVM
FAILED: CMakeFiles/package.util
cmd.exe /C “cd /D C:\Jenkins\workspace\llvm\build && “C:\Program Files\CMake\bin\cpack.exe” --config ./CPackConfig.cmake”
ninja: build stopped: subcommand failed.

I confirmed that the build succeeded by reverting r324504 at r324806.

Index: cmake/modules/HandleLLVMOptions.cmake

clang-build.txt (4.05 KB)

+Zach for r324504

Hello

llvm build fails at r324504 or later.
I used the attached file to build. (renamed to .txt)

example:
   clang-build.bat ninja x86 update 324806

This is the tail of the failure log.

CPack: Create package using NSIS
CPack: Install projects
CPack: - Install project: LLVM
Creating llvm-ranlib.exe
Creating llvm-lib.exe
Creating llvm-dlltool.exe
Creating clang++.exe
Creating clang-cl.exe
Creating clang-cpp.exe
Creating ../msbuild-bin/cl.exe
Creating lld-link.exe
Creating ld.lld.exe
Creating ld64.lld.exe
Creating wasm-ld.exe
Creating llvm-readelf.exe
CPack: Create package
CPack Error: Problem running NSIS command: "C:/Program Files
(x86)/NSIS/makensis.exe"
"C:/Jenkins/workspace/llvm/build/_CPack_Packages/win32/NSIS/project.nsi"
Please check
C:/Jenkins/workspace/llvm/build/_CPack_Packages/win32/NSIS/NSISOutput.log
for errors

Is there any info about what went wrong in NSISOutput.log?

CPack Error: Problem compressing the directory
CPack Error: Error when generating package: LLVM
FAILED: CMakeFiles/package.util
cmd.exe /C "cd /D C:\Jenkins\workspace\llvm\build && "C:\Program
Files\CMake\bin\cpack.exe" --config ./CPackConfig.cmake"
ninja: build stopped: subcommand failed.

I confirmed that the build succeeded by reverting r324504 at r324806.

Index: cmake/modules/HandleLLVMOptions.cmake

--- cmake/modules/HandleLLVMOptions.cmake (revision 324806)
+++ cmake/modules/HandleLLVMOptions.cmake (working copy)
@@ -353,12 +353,6 @@

   append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

- # Generate PDB even in release for profiling.
- if (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
- append("/Zi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
- append("/DEBUG" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)
- endif (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE")
-

This is surprising. I wouldn't expect the PDB files to end up in the
package or otherwise affect it. In fact, I tried building a package
with the script in utils/release/build_llvm_package.bat at r324504 and
it worked fine for me. And I verified there were no pdbs in the
package.

Maybe you want to add -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON to your build,
though I'm not sure that should make any difference to the pdb files.

Hi,

Is there any info about what went wrong in NSISOutput.log?

I attach the log.

This is the last part of the log.

  File: "clangStaticAnalyzerCheckers.lib"

  Internal compiler error #12345: error mmapping file (2106828838, 33554432)
is out of range.
  Note: you may have one or two (large) stale temporary file(s) left in your
temporary directory (Generally this only happens on Windows 9x).

I'm using Win10 Pro Japanese and VS2017 Community Japanese.
The version of NSIS is 3.02.1.

Maybe you want to add -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON to your build,
though I'm not sure that should make any difference to the pdb files.

If I added the option, the build succeeded.

Is that a solution to your problem?

Is that a solution to your problem?

No.
It could be a workaround, but not a solution.
I think we need to know the reason why the commit and the option affect the result at least.

It didn’t happen at r325456.
Did you fix it?

Regards.

No, I didn't change anything here and I don't think Zach did either.

It seems the change of the commit was disabled by default at r325296.

Regards.

Ah, great.

Reid, seems like you fixed this user's issue.

But it failed with -DLLVM_ENABLE_PDB=ON option .

The error message is

File: “lldELF.lib”
Internal compiler error #12345: error mmapping datablock to 21869285.

Note: you may have one or two (large) stale temporary file(s) left in your temporary directory (Generally this only happens on Windows 9x).

NSISOutput.zip (23.4 KB)

I'm guessing this is a problem with NSIS failing to handle large files
though, and I'm not sure there's much we can do about it.

The official snapshots and releases still only include the toolchain,
by passing -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON.