diff --git a/.github/workflows/do_build.yml b/.github/workflows/do_build.yml index e9ab254..4fb2b20 100644 --- a/.github/workflows/do_build.yml +++ b/.github/workflows/do_build.yml @@ -111,10 +111,6 @@ jobs: key: gnulib-bare enableCrossOsArchive: true - - name: MSBuild Setup - uses: microsoft/setup-msbuild@v1.1.3 - if: matrix.platform == 'windows' - - name: Move Bad DEFAULT MSYS shell: powershell run: Rename-Item c:/msys64 c:/trashmsys @@ -144,10 +140,17 @@ jobs: - name: Unpack / Move Artifacts if: ${{ inputs.RequiredDeps != '' && inputs.BuildPkg != 'script' }} run: ${{env.WLB_SCRIPT_FOLDER}}/.github/move_dl_artifacts.ps1 + - name: VSLatest Build Tools Install if: ${{ inputs.InstallLatestVSTools }} - run: ${{env.WLB_SCRIPT_FOLDER}}/vs_buildtools_installer.ps1 + run: ${{env.WLB_SCRIPT_FOLDER}}/vs_buildtools_installer.ps1 -install_path d:/vstools + - name: MSBuild Setup + uses: microsoft/setup-msbuild@v1.1.3 + if: matrix.platform == 'windows' + with: + vs-prerelease: true + msbuild-architecture: x64 - name: Build Package if: ${{ inputs.BuildPkg != 'script' }} diff --git a/build/f_gnutls_build.sh b/build/f_gnutls_build.sh index 0c379e7..bee08cf 100644 --- a/build/f_gnutls_build.sh +++ b/build/f_gnutls_build.sh @@ -11,7 +11,7 @@ BLD_CONFIG_BUILD_ADDL_CFLAGS=( "-I../gl/" ) BLD_CONFIG_BUILD_ADDL_CFLAGS_STATIC=("-DASN1_STATIC") BLD_CONFIG_OUR_LIB_DEPS=("libtasn1" "p11-kit" "zlib") BLD_CONFIG_OUR_LIB_BINS_PATH=("libtasn1") -BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" ) +BLD_CONFIG_BUILD_MSVC_IGNORE_WARNINGS=( "4068" "4061" "4820" "5045" "4668" "4996" ) # BLD_CONFIG_BUILD_FOLDER_NAME="myapp2"; #if you want it compiling in a diff folder # BLD_CONFIG_BUILD_DEBUG=1 @@ -29,6 +29,13 @@ fi if [[ -z $SKIP_STEP || $SKIP_STEP == "our_patch" ]]; then apply_our_repo_patch; # Applies from patches folder repo_BUILD_NAME.patch to the sources + P11_FILE="cligen/cligen/code.py" + if [[ -e "${P11_FILE}" ]]; then + if grep -q "^struct {struct_name} {global_name};" "${P11_FILE}"; then + ex sed -i -E 's/^struct \{struct_name\} \{global_name\};/struct {struct_name} {global_name} ;\n#undef write/' "${P11_FILE}" # fix issue where write is refined to _write but then .write on a struct has problems + echo "Fixed ${P11_FILE} for _write bug" + fi + fi fi if [[ $BLD_CONFIG_GNU_LIBS_USED -eq "1" ]]; then @@ -72,13 +79,7 @@ fi else setup_build_env; fi - P11_FILE="src/p11tool-options.c" - if [[ -e "${P11_FILE}" ]]; then - if grep -Fq " p11tool_options;" "${P11_FILE}"; then - sed -i -E 's/ p11tool_options;/ p11tool_options ;\n#undef write/' "${P11_FILE}" # fix issue where write is refined to _write but then .write on a struct has problems - echo "Fixed ${P11_FILE} for _write bug" - fi - fi + run_make make_install diff --git a/vs_buildtools_installer.ps1 b/vs_buildtools_installer.ps1 index 265066b..54fd3df 100644 --- a/vs_buildtools_installer.ps1 +++ b/vs_buildtools_installer.ps1 @@ -1,6 +1,9 @@ +param ( + [string] $install_path="c:/Program Files/vs_buildtools" +) + Set-StrictMode -version latest; $ErrorActionPreference = "Stop"; -param ($install_path="c:/Program Files/vs_buildtools") $installer=Get-ChildItem ([IO.Path]::GetTempFileName()) | Rename-Item -NewName { [IO.Path]::ChangeExtension($_, ".exe") } -PassThru Invoke-WebRequest 'https://aka.ms/vs/17/pre/vs_buildtools.exe' -OutFile $installer $startInfo = New-Object System.Diagnostics.ProcessStartInfo diff --git a/vs_msys_shell_launch.ps1 b/vs_msys_shell_launch.ps1 index 53c8b9f..33b2395 100644 --- a/vs_msys_shell_launch.ps1 +++ b/vs_msys_shell_launch.ps1 @@ -6,13 +6,14 @@ if (! $env:VS_ENV_INITIALIZED) { $instances=Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs; $VS_INSTANCE = $instances[0] foreach ($instance in $instances) { - if ( [System.Version]$VS_INSTANCE.Version -gt [System.Version]$instance.Version ) { + if ( [System.Version]$VS_INSTANCE.Version -lt [System.Version]$instance.Version ) { $VS_INSTANCE=$instance; } } $VS_DEV_SHELL_PATH="$($VS_INSTANCE.InstallLocation)/Common7/Tools/Microsoft.VisualStudio.DevShell.dll"; $VS_INSTANCE_ID=$VS_INSTANCE.IdentifyingNumber; $env:VS_ENV_INITIALIZED=1; + Write-Host "Starting msys shell with VS tools from: $($VS_INSTANCE.ProductLocation)" Import-Module $VS_DEV_SHELL_PATH; Enter-VsDevShell $VS_INSTANCE_ID -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64"; }