diff --git a/build/vsts-ci.yml b/build/vsts-ci.yml index 03880b39b1..18fea3c457 100644 --- a/build/vsts-ci.yml +++ b/build/vsts-ci.yml @@ -56,6 +56,8 @@ extends: enabled: true tsa: enabled: true + settings: + networkIsolationPolicy: Permissive,CFSClean pool: name: $(DncEngInternalBuildPool) image: $(WindowsImage) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 88d083e0b0..29872ef907 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -7,38 +7,38 @@ - + https://github.com/dotnet/arcade - e19df003785d0b81e2e3e1bf6e588bf8d913e95e + bac4c2c4add004bbce35ff5d17bc295dd4ebcd57 - + https://github.com/dotnet/arcade - e19df003785d0b81e2e3e1bf6e588bf8d913e95e + bac4c2c4add004bbce35ff5d17bc295dd4ebcd57 - + https://github.com/dotnet/arcade - e19df003785d0b81e2e3e1bf6e588bf8d913e95e + bac4c2c4add004bbce35ff5d17bc295dd4ebcd57 - + https://github.com/dotnet/arcade - e19df003785d0b81e2e3e1bf6e588bf8d913e95e + bac4c2c4add004bbce35ff5d17bc295dd4ebcd57 - + https://github.com/dotnet/arcade - e19df003785d0b81e2e3e1bf6e588bf8d913e95e + bac4c2c4add004bbce35ff5d17bc295dd4ebcd57 - + https://github.com/dotnet/arcade - e19df003785d0b81e2e3e1bf6e588bf8d913e95e + bac4c2c4add004bbce35ff5d17bc295dd4ebcd57 - + https://github.com/dotnet/arcade - e19df003785d0b81e2e3e1bf6e588bf8d913e95e + bac4c2c4add004bbce35ff5d17bc295dd4ebcd57 diff --git a/eng/Versions.props b/eng/Versions.props index 6bbdb56729..0a47508180 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -98,7 +98,7 @@ 9.0.0-beta.24212.4 5.0.0-preview.5.20278.1 8.0.0-beta.24525.2 - 11.0.0-beta.25477.2 + 11.0.0-beta.25502.2 9.0.4 0.0.6-test 0.0.13-test diff --git a/eng/common/build.sh b/eng/common/build.sh index 9767bb411a..ec3e80d189 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -92,7 +92,7 @@ runtime_source_feed='' runtime_source_feed_key='' properties=() -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do opt="$(echo "${1/#--/-}" | tr "[:upper:]" "[:lower:]")" case "$opt" in -help|-h) diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index e889f439b8..9f5ad6b763 100755 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -5,7 +5,7 @@ darcVersion='' versionEndpoint='https://maestro.dot.net/api/assets/darc-version?api-version=2020-02-20' verbosity='minimal' -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case "$opt" in --darcversion) diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh index 7b9d97e3bd..61f302bb67 100755 --- a/eng/common/dotnet-install.sh +++ b/eng/common/dotnet-install.sh @@ -18,7 +18,7 @@ architecture='' runtime='dotnet' runtimeSourceFeed='' runtimeSourceFeedKey='' -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case "$opt" in -version|-v) diff --git a/eng/common/dotnet.sh b/eng/common/dotnet.sh index 2ef6823567..f6d24871c1 100644 --- a/eng/common/dotnet.sh +++ b/eng/common/dotnet.sh @@ -19,7 +19,7 @@ source $scriptroot/tools.sh InitializeDotNetCli true # install # Invoke acquired SDK with args if they are provided -if [[ $# > 0 ]]; then +if [[ $# -gt 0 ]]; then __dotnetDir=${_InitializeDotNetCli} dotnetPath=${__dotnetDir}/dotnet ${dotnetPath} "$@" diff --git a/eng/common/internal-feed-operations.sh b/eng/common/internal-feed-operations.sh index 9378223ba0..6299e7effd 100755 --- a/eng/common/internal-feed-operations.sh +++ b/eng/common/internal-feed-operations.sh @@ -100,7 +100,7 @@ operation='' authToken='' repoName='' -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do opt="$(echo "$1" | tr "[:upper:]" "[:lower:]")" case "$opt" in --operation) diff --git a/eng/common/internal/Tools.csproj b/eng/common/internal/Tools.csproj index 41f88ae7dc..feaa6d2081 100644 --- a/eng/common/internal/Tools.csproj +++ b/eng/common/internal/Tools.csproj @@ -9,11 +9,11 @@ - - - - - + + + + + diff --git a/eng/common/post-build/nuget-verification.ps1 b/eng/common/post-build/nuget-verification.ps1 index a365194a93..ac5c69ffca 100644 --- a/eng/common/post-build/nuget-verification.ps1 +++ b/eng/common/post-build/nuget-verification.ps1 @@ -30,7 +30,7 @@ [CmdletBinding(PositionalBinding = $false)] param( [string]$NuGetExePath, - [string]$PackageSource = "https://api.nuget.org/v3/index.json", + [string]$PackageSource = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json", [string]$DownloadPath, [Parameter(ValueFromRemainingArguments = $true)] [string[]]$args diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index b62e132d32..4655af7a2d 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -68,7 +68,7 @@ try { $GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty } if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) { - $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.13.0" -MemberType NoteProperty + $GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.14.16" -MemberType NoteProperty } if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") { $xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 06b44de787..4bc50bd568 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -394,8 +394,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = # If the version of msbuild is going to be xcopied, # use this version. Version matches a package here: - # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.13.0 - $defaultXCopyMSBuildVersion = '17.13.0' + # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.14.16 + $defaultXCopyMSBuildVersion = '17.14.16' if (!$vsRequirements) { if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') { diff --git a/global.json b/global.json index e03ed91015..e33d6600dc 100644 --- a/global.json +++ b/global.json @@ -13,8 +13,8 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25477.2", - "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.25477.2", + "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.25502.2", + "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.25502.2", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.2.0" } diff --git a/src/Native/CMakeLists.txt b/src/Native/CMakeLists.txt index 50e94feef6..0082d0dcd5 100644 --- a/src/Native/CMakeLists.txt +++ b/src/Native/CMakeLists.txt @@ -13,6 +13,9 @@ set(RESOURCES) # Include 'bin/obj' dir since it contains _version.h include_directories("$ENV{__IntermediatesDir}") +# Define path to native source link file +set(NATIVE_SOURCELINK_FILE_PATH "$ENV{__IntermediatesDir}/native.sourcelink.json") + if(WIN32) add_definitions(-DWIN32) add_definitions(-D_WIN32=1) @@ -22,11 +25,9 @@ if(WIN32) endif() add_compile_options($<$:-DDEBUG>) add_compile_options($<$:-DNDEBUG>) - add_compile_options($<$:-DNDEBUG>) add_compile_options($<$:/Od>) add_compile_options($<$:/MTd>) # /MT will static link the VC runtime library, so it doesn't need to be installed on the target machine add_compile_options($<$:/MT>) - add_compile_options($<$:/MT>) add_compile_options(/guard:cf) add_compile_options(/Zo) # make optimized builds debugging easier. /Zo is the newer documented flag. add_compile_options(/nologo) # Suppress Startup Banner @@ -41,6 +42,11 @@ if(WIN32) add_compile_options(/Zc:inline) add_compile_options(/fp:precise) add_compile_options(/EHsc) + add_compile_options(/Brepro) + add_compile_options(/d1nodatetime) + add_compile_options(/experimental:deterministic) + add_compile_options(/GL) + add_compile_options(/d2CastGuardFailureMode:fastfail) # From here below are warnings required to be explicitly enabled. add_compile_options(/w34242) @@ -62,8 +68,14 @@ if(WIN32) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /PDBCOMPRESS") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf /Brepro") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf /Brepro") + + # Enable native source link if the source link file exists + if(EXISTS ${NATIVE_SOURCELINK_FILE_PATH}) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /sourcelink:${NATIVE_SOURCELINK_FILE_PATH}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /sourcelink:${NATIVE_SOURCELINK_FILE_PATH}") + endif(EXISTS ${NATIVE_SOURCELINK_FILE_PATH}) # Debug build specific flags set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NOVCFEATURE") @@ -71,18 +83,12 @@ if(WIN32) set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:vcompd.lib /DEFAULTLIB:vcomp.lib") # Release build specific flags - set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") - set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF") + set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF /LTCG") + set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF /LTCG") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF /LTCG") set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib") - # RelWithDebInfo specific flags - set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF") - set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF") - set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF") - set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib") - set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib") list(APPEND RESOURCES $ENV{__IntermediatesDir}/NativeVersion.rc) else() add_compile_options(-Wno-unused-local-typedef) diff --git a/src/Native/Native.proj b/src/Native/Native.proj index 232e1047af..02a95495bf 100644 --- a/src/Native/Native.proj +++ b/src/Native/Native.proj @@ -48,6 +48,7 @@ true $(IntermediateOutputPath)_version.h + $(IntermediateOutputPath)native.sourcelink.json @@ -120,7 +121,7 @@ + DependsOnTargets="GenerateNativeVersionFile;GenerateNativeSourcelinkFile"> $(Configuration) $(TargetArchitecture) --mkllibpath $(NuGetPackageRoot)mlnetmkldeps\$(MlNetMklDepsVersion)\runtimes\$(PackageRid)\native @@ -248,6 +249,15 @@ + + + + + diff --git a/src/Native/build.cmd b/src/Native/build.cmd index af85898bac..8876c6ff2a 100644 --- a/src/Native/build.cmd +++ b/src/Native/build.cmd @@ -3,10 +3,12 @@ setlocal :: Store current script directory before %~dp0 gets affected by another process later. set __currentScriptDir=%~dp0 +set "__currentScriptDir=%__currentScriptDir:~0,-1%" + :SetupArgs :: Initialize the args that will be passed to cmake -set __rootDir=%__currentScriptDir%..\.. +set __rootDir=%__currentScriptDir%\..\.. set __artifactsDir=%__rootDir%\artifacts set __binDir=%__artifactsDir%\bin set __objDir=%__artifactsDir%\obj @@ -51,7 +53,9 @@ set "VSCMD_START_DIR=%__currentScriptDir%" call "%_VSCOMNTOOLS%\VsDevCmd.bat" :RunVCVars -if "%VisualStudioVersion%"=="17.0" ( +if "%VisualStudioVersion%"=="18.0" ( + goto :VS2026 +) else if "%VisualStudioVersion%"=="17.0" ( goto :VS2022 ) else if "%VisualStudioVersion%"=="16.0" ( goto :VS2019 @@ -67,6 +71,14 @@ echo Error: Visual Studio 2015, 2017, 2019, or 2022 required echo Please see https://github.com/dotnet/machinelearning/tree/main/Documentation for build instructions. exit /b 1 +:VS2026 +:: Setup vars for VS2026 +set __PlatformToolset=v145 +set __VSVersion=18 2026 +:: Set the environment for the native build +call "%VS180COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch% +goto :SetupDirs + :VS2022 :: Setup vars for VS2022 set __PlatformToolset=v143 diff --git a/src/Native/gen-buildsys-win.bat b/src/Native/gen-buildsys-win.bat index 4d4248200b..38c3c31434 100644 --- a/src/Native/gen-buildsys-win.bat +++ b/src/Native/gen-buildsys-win.bat @@ -30,6 +30,7 @@ if /i "%3" == "x64" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A x64) if /i "%3" == "x86" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A Win32) if /i "%3" == "arm64" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A arm64) if /i "%3" == "arm" (set __ExtraCmakeParams=%__ExtraCmakeParams% -A arm) +echo "%CMakePath%" "-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%" "-DCMAKE_INSTALL_PREFIX=%__CMakeBinDir%" "-DMKL_LIB_PATH=%MKL_LIB_PATH%" "-DONEDAL_DEVEL_PATH=%ONEDAL_DEVEL_PATH%" "-DONETBB_DEVEL_PATH=%ONETBB_DEVEL_PATH%" "-DARCHITECTURE=%3" -G "Visual Studio %__VSString%" %__ExtraCmakeParams% -B. -H%1 "%CMakePath%" "-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%" "-DCMAKE_INSTALL_PREFIX=%__CMakeBinDir%" "-DMKL_LIB_PATH=%MKL_LIB_PATH%" "-DONEDAL_DEVEL_PATH=%ONEDAL_DEVEL_PATH%" "-DONETBB_DEVEL_PATH=%ONETBB_DEVEL_PATH%" "-DARCHITECTURE=%3" -G "Visual Studio %__VSString%" %__ExtraCmakeParams% -B. -H%1 endlocal GOTO :DONE