.emscripten file not found during HTML5 build

I’ve recently encountered a problem when building the UE4 project for HTML5. I’m currently building on Mac OSX 10.10.5 with the latest version of emscripten installed.
After executing the build command in terminal:

./Engine/Build/BatchFiles/Mac/Build.sh UE4Game HTML5 Development

I got the following error message:

Building UBT...
         0 Error(s)
Building UE4Game...
2016-02-17 17:11:59.770 defaults[19582:222313] 
The domain/default pair of (/Users/yunyunzai/Library/Preferences/com.apple.dt.Xcode, IDEBuildOperationMaxNumberOfConcurrentCompileTasks) does not exist
Running command : Engine/Binaries/DotNET/UnrealBuildTool.exe UE4Game HTML5 Development -deploy -nocreatestub
Setting Emscripten SDK 
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.35.0
clang version 3.7.0 (https://github.com/kripken/emscripten-fastcomp-clang dbe68fecd03d6f646bd075963c3cc0e7130e5767) (https://github.com/kripken/emscripten-fastcomp 4e83be90903250ec5142edc57971ed4c633c5e25)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
INFO:root:(Emscripten: Running sanity checks)
ERROR: System.IO.FileNotFoundException: Could not find file "/Users/yunyunzai/Desktop/UnrealEngine/Engine/Intermediate/Build/HTML5/.emscripten".
File name: '/Users/yunyunzai/Desktop/UnrealEngine/Engine/Intermediate/Build/HTML5/.emscripten'
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) <0x1a03aa0 + 0x006e4> in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, System.String msgPath, Boolean bFromProxy, Boolean useLongPath, Boole
an checkHost) <0x1a039d0 + 0x0004f> in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost) <0x18550d0 + 0x000df> in <filename unknown>:0 
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) <0x1855080 + 0x00042> in <filename unknown>:0 
  at System.IO.StreamReader..ctor (System.String path, Boolean detectEncodingFromByteOrderMarks) <0x1854f90 + 0x00046> in <filename unknown>:0 
  at System.IO.StreamReader..ctor (System.String path) <0x1854f50 + 0x0002c> in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
  at System.IO.File.ReadAllText (System.String path) <0x1a01970 + 0x0003b> in <filename unknown>:0 
  at UnrealBuildTool.HTML5SDKInfo.SetUpEmscriptenConfigFile () <0x2cc5a38 + 0x0034f> in <filename unknown>:0 
  at UnrealBuildTool.HTML5ToolChain.PreBuildSync () <0x2cc4820 + 0x0003b> in <filename unknown>:0 
  at UnrealBuildTool.UnrealBuildTool.RunUBT (System.String[] Arguments, UnrealBuildTool.FileReference ProjectFile) <0x2c96348 + 0x02983> in <filename unknown>:0 

Then I tried manually copying the ~/.emscripten file to the path it’s looking for, what I found was that the file I copied got wiped in the middle of executing the build command.

Next thing I tried was to copy the file to the path concurrently while executing the build command and I finally got the build going after several tries.

Can somebody look into this and confirm that the builder program is wiping the .emscripten file in the path it’s looking for?

This was confirmed as a bug and I just confirmed this is fixed in the newer version 4.11.0 preview 7 :slight_smile:

I’m having the same problem on 4.11.2, is it a regression ?

Check your home environment if there is a home environment variable on your computer. Delete it and restart the engine. The problem should go.