diff --git a/.github/workflows/do_build.yml b/.github/workflows/do_build.yml index d632ca4..1968b5b 100644 --- a/.github/workflows/do_build.yml +++ b/.github/workflows/do_build.yml @@ -37,6 +37,7 @@ env: MSYS2_PATH_TYPE: inherit WLB_BASE_FOLDER: "d:/WLB" MSYSTEM: UCRT64 + BLD_CONFIG_LOG_COPY_LOGS_TO_INFODIR: 1 #copy logs to the info dir in final build, only happens for debug builds MSYS_PATH: d:/msys64 jobs: diff --git a/default_config.ini b/default_config.ini index 7417bec..f3887f1 100644 --- a/default_config.ini +++ b/default_config.ini @@ -121,6 +121,7 @@ LOG_RAW_BUILD_FILE_POST_PROCESS=1 # This will call the dotnet bat_cleanup.csx sc LOG_EXPAND_VARS=0 #This is a safeish way to expand the variables in commands but it is pretty slow, also note expanding the command manually is not error proof, any bash vars declared local won't be avail, and if there is a global var with the same name it will appear instead. This is for the LOG_FILE file. LOG_FILE_AUTOTAIL=0 +LOG_COPY_LOGS_TO_INFODIR=0 #if we should copy the *-.log and bat files etc to the final/info dir. Off by default and only for debug builds LOG_IGNORE_REPEAT_LINES=1 STACKTRACE_ON_FAIL=1 EXPAND_FAILED_CMD_ON_STACKTRACE=1 #Note expanding the command manually is not error proof, any bash vars declared local won't be avail, and if there is a global var with the same name it will appear instead. diff --git a/helpers.sh b/helpers.sh index 663519a..dbb0210 100644 --- a/helpers.sh +++ b/helpers.sh @@ -258,8 +258,21 @@ function make_install(){ if [[ $BLD_CONFIG_BUILD_DEBUG -eq 1 ]]; then mkdir -p "${BLD_CONFIG_INSTALL_FOLDER}/bin" copy_pdbs + if [[ $BLD_CONFIG_LOG_COPY_LOGS_TO_INFODIR -eq 1 ]]; then + copy_infos + fi + fi } +function copy_infos(){ + mkdir -p "${BLD_CONFIG_INSTALL_FOLDER}/info" + declare -a POS_COPY=( "${BLD_CONFIG_LOG_FILE}" "${BLD_CONFIG_LOG_MAKE_CMD_FILE}" "${BLD_CONFIG_LOG_CONFIG_ENV_FILE}" "${BLD_CONFIG_LOG_CONFIGURE_FILE}" "${BLD_CONFIG_LOG_RAW_BUILD_FILE}" ) + for file in "${POS_COPY[@]}"; do + if [[ -f "$file" ]]; then + cp "$file" "${BLD_CONFIG_INSTALL_FOLDER}/info" + fi + done +} function copy_pdbs(){ ex find -name "*.pdb" | grep -v vc1 | xargs cp -t "${BLD_CONFIG_INSTALL_FOLDER}/bin" &>/dev/null || true } diff --git a/vs_msys_shell_launch.ps1 b/vs_msys_shell_launch.ps1 index b2b7c3a..f3dbbbc 100644 --- a/vs_msys_shell_launch.ps1 +++ b/vs_msys_shell_launch.ps1 @@ -19,7 +19,19 @@ if (! $env:VS_ENV_INITIALIZED) { Enter-VsDevShell $VS_INSTANCE_ID -SkipAutomaticLocation -DevCmdArguments "-arch=x64 -host_arch=x64"; if (! $env:WLB_NO_PATH_CLEAN ){ #this is similar to what msys2 does when -full-path is not used but we want to preserve the VS additions (plus any WLB_PATH_ADD The user might want) $path_after=$env:PATH; - $pathAdd="${env:SystemRoot};${env:SystemRoot}/system32;${env:SystemRoot}/Wbem;${env:SystemRoot};WindowsPowerShell/v1.0" + # pwsh powershell location attempt + + $pwshPath = "" + $versions = Get-ChildItem "HKLM:\SOFTWARE\Microsoft\PowerShellCore\InstalledVersions\" + foreach ($version in $versions) { + $installedDir = Get-ItemPropertyValue -Path $version.PSPath -Name "InstallDir" -ErrorAction SilentlyContinue + if ($installedDir -and (Test-Path "$installedDir\pwsh.exe")) { + $pwshPath = ";$installedDir" + break + } + } + + $pathAdd="${env:SystemRoot};${env:SystemRoot}/system32;${env:SystemRoot}/Wbem;${env:SystemRoot}/WindowsPowerShell/v1.0${pwshPath}" if ( $env:WLB_PATH_ADD ){ $pathAdd="$env:WLB_PATH_ADD;$pathAdd" }