diff --git a/.circleci/config.yml b/.circleci/config.yml index 8f34d4c9e3..dd8c8671fa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -261,7 +261,8 @@ commands: New-Item -Path $bashEnvScript -ItemType File -Force | Out-Null } $bashPath = $goBin.Replace('\', '/').Replace('C:', '/c') - 'export PATH="' + $bashPath + ':$PATH"' | Out-File -FilePath $bashEnvScript -Append -Encoding UTF8 + $bashLine = 'export PATH="' + $bashPath + ':$PATH"' + [System.IO.File]::AppendAllText($bashEnvScript, $bashLine + "`n", (New-Object System.Text.UTF8Encoding $false)) install-deps-windows-native-build: steps: @@ -276,7 +277,7 @@ commands: - restore_cache: name: Restoring Windows tools cache keys: - - windows-tools-cache-v4-{{ arch }}-{{ checksum ".nvmrc" }} + - windows-tools-cache-v5-{{ arch }}-{{ checksum ".nvmrc" }} - run: name: Install Node.js (native) shell: powershell @@ -315,7 +316,7 @@ commands: .\scripts\windows\ensure-python-uv.ps1 - save_cache: name: Saving Windows tools cache - key: windows-tools-cache-v4-{{ arch }}-{{ checksum ".nvmrc" }} + key: windows-tools-cache-v5-{{ arch }}-{{ checksum ".nvmrc" }} paths: - << pipeline.parameters.windows_cache_dir >> - C:\ProgramData\nvm diff --git a/Makefile b/Makefile index 010300b4f1..117477e9c1 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,11 @@ SHASUM_CMD = shasum GOHOSTOS = $(shell go env GOHOSTOS) export PYTHON = python -PYTHON_VERSION = $(shell python3 --version) -ifneq (, $(PYTHON_VERSION)) - PYTHON = python3 +ifneq ($(GOHOSTOS), windows) + PYTHON_VERSION = $(shell python3 --version 2>/dev/null) + ifneq (, $(PYTHON_VERSION)) + PYTHON = python3 + endif endif ifeq ($(GOHOSTOS), windows) diff --git a/cliv2/Makefile b/cliv2/Makefile index 5f4cca958e..b15fdd5f0f 100644 --- a/cliv2/Makefile +++ b/cliv2/Makefile @@ -36,7 +36,7 @@ CACHE_DIR = $(WORKING_DIR)/_cache LS_PROTOCOL_VERSION_FILE = $(CACHE_DIR)/ls-protocol-version LS_COMMIT_HASH_FILE = $(CACHE_DIR)/ls-commit-hash LS_COMMIT_HASH = $(if $(wildcard $(LS_COMMIT_HASH_FILE)),$(shell cat $(LS_COMMIT_HASH_FILE)),determined during LS metadata generation) -SRCS = $(shell find $(WORKING_DIR) -type f -name '*.go') +SRCS = $(shell $(GOCMD) list -f '{{range .GoFiles}}{{$$.Dir}}/{{.}} {{end}}' ./...) # load cached variables if available -include $(CACHE_DIR)/variables.mk diff --git a/scripts/windows/install-dotnet-sdk.ps1 b/scripts/windows/install-dotnet-sdk.ps1 index 58dc2cc7ae..5fc1b3f66c 100644 --- a/scripts/windows/install-dotnet-sdk.ps1 +++ b/scripts/windows/install-dotnet-sdk.ps1 @@ -87,7 +87,7 @@ try { $bashUpdateLine = 'export PATH="' + $bashPath + ':$PATH"' $bashExisting = Get-Content -Path $bashEnvScript -ErrorAction SilentlyContinue if (-not $bashExisting -or -not ($bashExisting -contains $bashUpdateLine)) { - $bashUpdateLine | Out-File -FilePath $bashEnvScript -Append -Encoding UTF8 + [System.IO.File]::AppendAllText($bashEnvScript, $bashUpdateLine + "`n", (New-Object System.Text.UTF8Encoding $false)) } } catch { diff --git a/scripts/windows/install-gradle.ps1 b/scripts/windows/install-gradle.ps1 index cd5d29dea3..a84c46998a 100644 --- a/scripts/windows/install-gradle.ps1 +++ b/scripts/windows/install-gradle.ps1 @@ -101,7 +101,7 @@ try { $bashUpdateLine = 'export PATH="' + $bashPath + ':$PATH"' $bashExisting = Get-Content -Path $bashEnvScript -ErrorAction SilentlyContinue if (-not $bashExisting -or -not ($bashExisting -contains $bashUpdateLine)) { - $bashUpdateLine | Out-File -FilePath $bashEnvScript -Append -Encoding UTF8 + [System.IO.File]::AppendAllText($bashEnvScript, $bashUpdateLine + "`n", (New-Object System.Text.UTF8Encoding $false)) } } catch { diff --git a/scripts/windows/install-make.ps1 b/scripts/windows/install-make.ps1 index 0beb4c19a6..4f12b5ddde 100644 --- a/scripts/windows/install-make.ps1 +++ b/scripts/windows/install-make.ps1 @@ -131,7 +131,7 @@ try { $bashUpdateLine = 'export PATH="' + $bashPath + ':$PATH"' $bashExisting = Get-Content -Path $bashEnvScript -ErrorAction SilentlyContinue if (-not $bashExisting -or -not ($bashExisting -contains $bashUpdateLine)) { - $bashUpdateLine | Out-File -FilePath $bashEnvScript -Append -Encoding UTF8 + [System.IO.File]::AppendAllText($bashEnvScript, $bashUpdateLine + "`n", (New-Object System.Text.UTF8Encoding $false)) } } catch { diff --git a/scripts/windows/install-maven.ps1 b/scripts/windows/install-maven.ps1 index e98f134116..1ab6cabab5 100644 --- a/scripts/windows/install-maven.ps1 +++ b/scripts/windows/install-maven.ps1 @@ -102,7 +102,7 @@ try { $bashUpdateLine = 'export PATH="' + $bashPath + ':$PATH"' $bashExisting = Get-Content -Path $bashEnvScript -ErrorAction SilentlyContinue if (-not $bashExisting -or -not ($bashExisting -contains $bashUpdateLine)) { - $bashUpdateLine | Out-File -FilePath $bashEnvScript -Append -Encoding UTF8 + [System.IO.File]::AppendAllText($bashEnvScript, $bashUpdateLine + "`n", (New-Object System.Text.UTF8Encoding $false)) } } catch { diff --git a/scripts/windows/install-python3.ps1 b/scripts/windows/install-python3.ps1 index 677056db7d..f21d103e0f 100644 --- a/scripts/windows/install-python3.ps1 +++ b/scripts/windows/install-python3.ps1 @@ -86,14 +86,14 @@ try { $bashDir = $selectedDir.Replace('\', '/').Replace('C:', '/c') $bashLineBase = 'export PATH="' + $bashDir + ':$PATH"' if (-not $bashExisting -or -not ($bashExisting -contains $bashLineBase)) { - $bashLineBase | Out-File -FilePath $bashEnvScript -Append -Encoding UTF8 + [System.IO.File]::AppendAllText($bashEnvScript, $bashLineBase + "`n", (New-Object System.Text.UTF8Encoding $false)) } if (Test-Path $scriptsDir) { $bashScriptsDir = $scriptsDir.Replace('\', '/').Replace('C:', '/c') $bashLineScripts = 'export PATH="' + $bashScriptsDir + ':$PATH"' if (-not $bashExisting -or -not ($bashExisting -contains $bashLineScripts)) { - $bashLineScripts | Out-File -FilePath $bashEnvScript -Append -Encoding UTF8 + [System.IO.File]::AppendAllText($bashEnvScript, $bashLineScripts + "`n", (New-Object System.Text.UTF8Encoding $false)) } } }