From 5e44324b7985faaa849513d17c3d8076c92718ab Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Tue, 5 Jun 2018 10:38:48 -0600 Subject: [PATCH 1/5] make.bat: change the way the vs buildtools are detected. The recent change also used the buildtools instead of the regular compiler, you now have to explicitly state what you want to use : 2017 - the standard msvc compiler 2017pre - the msvc compiler from the preview installation 2017b - the msvc compiler from the buildtools installation --- build_files/windows/detect_msvc2017.cmd | 7 ++++++- build_files/windows/parse_arguments.cmd | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/build_files/windows/detect_msvc2017.cmd b/build_files/windows/detect_msvc2017.cmd index 90fad8744b5..060e9f88617 100644 --- a/build_files/windows/detect_msvc2017.cmd +++ b/build_files/windows/detect_msvc2017.cmd @@ -12,7 +12,12 @@ if not exist "%vs_where%" ( goto FAIL ) ) -for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -products * -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do ( + +if NOT "%verbose%" == "" ( + echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64` + ) + +for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do ( if /i "%%i"=="installationPath" set VS_InstallDir=%%j ) diff --git a/build_files/windows/parse_arguments.cmd b/build_files/windows/parse_arguments.cmd index 2cc0acfd243..8a6d743978d 100644 --- a/build_files/windows/parse_arguments.cmd +++ b/build_files/windows/parse_arguments.cmd @@ -53,6 +53,10 @@ if NOT "%1" == "" ( ) else if "%1" == "2017pre" ( set BUILD_VS_YEAR=2017 set VSWHERE_ARGS=-prerelease + set BUILD_VS_YEAR=2017 + ) else if "%1" == "2017b" ( + set BUILD_VS_YEAR=2017 + set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools ) else if "%1" == "2015" ( set BUILD_VS_YEAR=2015 ) else if "%1" == "2013" ( From cd58ce85c243e6520d796f66807a0caa8e078483 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Tue, 5 Jun 2018 10:39:39 -0600 Subject: [PATCH 2/5] make.bat : check for existence of ninja before using it. --- build_files/windows/configure_ninja.cmd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build_files/windows/configure_ninja.cmd b/build_files/windows/configure_ninja.cmd index d3b002e9a24..224d761adf6 100644 --- a/build_files/windows/configure_ninja.cmd +++ b/build_files/windows/configure_ninja.cmd @@ -1,3 +1,9 @@ +ninja --version 1>NUL 2>&1 +if %ERRORLEVEL% NEQ 0 ( + echo "Ninja not detected in the path" + exit /b 1 + ) + set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE% if "%WITH_CLANG%" == "1" ( From 983811607d153271844d6fba821f84ec44760bca Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Tue, 5 Jun 2018 10:40:14 -0600 Subject: [PATCH 3/5] make.bat : bring the help up to date with recent additions to the build script. --- build_files/windows/show_help.cmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build_files/windows/show_help.cmd b/build_files/windows/show_help.cmd index 0524e8a84fc..87672883f3d 100644 --- a/build_files/windows/show_help.cmd +++ b/build_files/windows/show_help.cmd @@ -20,10 +20,14 @@ echo - noge ^(disable building game enginge and player^) echo - debug ^(Build an unoptimized debuggable build^) echo - packagename [newname] ^(override default cpack package name^) echo - buildir [newdir] ^(override default build folder^) +echo - clang ^(enable building with clang^) +echo - asan ^(enable asan when building with clang^) +echo - ninja ^(enable building with ninja instead of msbuild^) echo - x86 ^(override host auto-detect and build 32 bit code^) echo - x64 ^(override host auto-detect and build 64 bit code^) echo - 2013 ^(build with visual studio 2013^) echo - 2015 ^(build with visual studio 2015^) [EXPERIMENTAL] echo - 2017 ^(build with visual studio 2017^) [EXPERIMENTAL] echo - 2017pre ^(build with visual studio 2017 pre-release^) [EXPERIMENTAL] +echo - 2017b ^(build with visual studio 2017 Build Tools^) [EXPERIMENTAL] echo. From 713027b83252aadb7e583353637aed9f8284acad Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Tue, 5 Jun 2018 11:29:03 -0600 Subject: [PATCH 4/5] make.bat : move all experimental options to their own section in the help. --- build_files/windows/show_help.cmd | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/build_files/windows/show_help.cmd b/build_files/windows/show_help.cmd index 87672883f3d..2b297120f4b 100644 --- a/build_files/windows/show_help.cmd +++ b/build_files/windows/show_help.cmd @@ -20,14 +20,16 @@ echo - noge ^(disable building game enginge and player^) echo - debug ^(Build an unoptimized debuggable build^) echo - packagename [newname] ^(override default cpack package name^) echo - buildir [newdir] ^(override default build folder^) -echo - clang ^(enable building with clang^) -echo - asan ^(enable asan when building with clang^) -echo - ninja ^(enable building with ninja instead of msbuild^) echo - x86 ^(override host auto-detect and build 32 bit code^) echo - x64 ^(override host auto-detect and build 64 bit code^) echo - 2013 ^(build with visual studio 2013^) -echo - 2015 ^(build with visual studio 2015^) [EXPERIMENTAL] -echo - 2017 ^(build with visual studio 2017^) [EXPERIMENTAL] -echo - 2017pre ^(build with visual studio 2017 pre-release^) [EXPERIMENTAL] -echo - 2017b ^(build with visual studio 2017 Build Tools^) [EXPERIMENTAL] +echo. +echo Experimental options +echo - 2015 ^(build with visual studio 2015^) +echo - 2017 ^(build with visual studio 2017^) +echo - 2017pre ^(build with visual studio 2017 pre-release^) +echo - 2017b ^(build with visual studio 2017 Build Tools^) +echo - clang ^(enable building with clang^) +echo - asan ^(enable asan when building with clang^) +echo - ninja ^(enable building with ninja instead of msbuild^) echo. From bfbd85e9d66be3793e51ef989f793bdd69214493 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 Jun 2018 09:36:50 +0200 Subject: [PATCH 5/5] Fix error using freed bmain Regression in 481cdb08ed6f3 --- source/blender/blenkernel/intern/blender_undo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c index c3306b16041..df2caba0208 100644 --- a/source/blender/blenkernel/intern/blender_undo.c +++ b/source/blender/blenkernel/intern/blender_undo.c @@ -82,13 +82,14 @@ bool BKE_memfile_undo_decode(MemFileUndoData *mfu, bContext *C) success = BKE_blendfile_read_from_memfile(C, &mfu->memfile, NULL, 0); } - /* restore */ - BLI_strncpy(bmain->name, mainstr, sizeof(bmain->name)); /* restore */ + /* Restore, bmain has been re-allocated. */ + bmain = CTX_data_main(C); + BLI_strncpy(bmain->name, mainstr, sizeof(bmain->name)); G.fileflags = fileflags; if (success) { /* important not to update time here, else non keyed tranforms are lost */ - DAG_on_visible_update(G.main, false); + DAG_on_visible_update(bmain, false); } return success;