From ab082108d5ecc05ae51acdcc78bba7707d550677 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 10 Aug 2025 15:50:45 +0000 Subject: [PATCH 1/6] Redirect werl to erl.exe on windows ps templates Since OTP-26, which is now our earlier major version supported, werl.exe just no longer really exists and we use erl.exe instead. The other windows template file does dynamic matching but ps stuff is a bit more complex and I no longer have a windows computer to test this on, so I'm going for the safest fix at the time. Addresses https://github.com/erlware/relx/issues/955 --- priv/templates/extended_bin_windows_ps | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/priv/templates/extended_bin_windows_ps b/priv/templates/extended_bin_windows_ps index 7f37dd8ca..8008bb95a 100644 --- a/priv/templates/extended_bin_windows_ps +++ b/priv/templates/extended_bin_windows_ps @@ -62,7 +62,8 @@ $service_name = "${rel_name}_${rel_vsn}" $nodetool = "$rootdir\bin\nodetool" $bindir = "$erts_dir\bin" -$werl = "$bindir\werl.exe" +# since OTP-26, werl.exe is just erl.exe, so link it directly +$werl = "$bindir\erl.exe" $erl = "$bindir\erl.exe" $erlsrv = "$bindir\erlsrv.exe" $escript = "$bindir\escript.exe" From c87f9b814d2b77e313f6521ffac6c9a5bb7f989a Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 10 Aug 2025 15:54:04 +0000 Subject: [PATCH 2/6] bump CI env --- .github/workflows/main.yml | 4 ++-- .github/workflows/shelltest.yml | 2 +- .github/workflows/wintest.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b786d4a38..857a8e1c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,8 @@ jobs: strategy: matrix: - otp_version: [23, 24, 26] - os: [ubuntu-20.04] # latest only runs >= 24.2 + otp_version: [26, 27, 28] + os: [ubuntu-latest] # latest only runs >= 24.2 container: image: erlang:${{ matrix.otp_version }} diff --git a/.github/workflows/shelltest.yml b/.github/workflows/shelltest.yml index 759460e9b..aaeeb6d16 100644 --- a/.github/workflows/shelltest.yml +++ b/.github/workflows/shelltest.yml @@ -17,7 +17,7 @@ jobs: matrix: # TODO: make a batch of tests that runs on nodetool rather # than the new connectivity mechanism - otp_version: [25, 26] + otp_version: [26, 27, 28] os: [ubuntu-latest] # latest only runs >= 24.2 steps: diff --git a/.github/workflows/wintest.yml b/.github/workflows/wintest.yml index dcc0259df..4451a2b3b 100644 --- a/.github/workflows/wintest.yml +++ b/.github/workflows/wintest.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - otp_version: [24, 25, 26] + otp_version: [26, 27, 28] os: [windows-latest] steps: From f4f24eeac6b59fac861e214869b9ca4e2b67fdf3 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 10 Aug 2025 16:00:29 +0000 Subject: [PATCH 3/6] fix bad escaping --- priv/templates/psutil | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/priv/templates/psutil b/priv/templates/psutil index 5c54a6915..da172ed24 100644 --- a/priv/templates/psutil +++ b/priv/templates/psutil @@ -17,13 +17,13 @@ function Find-ERTS() # Get the ERTS dir from erl $erl = (Get-Command erl).source - $erl_root = & $erl -boot no_dot_erlang -noshell -eval 'io:format(\"~s\", [filename:nativename(code:root_dir())]), halt().' + $erl_root = & $erl -boot no_dot_erlang -noshell -eval 'io:format("~s", [filename:nativename(code:root_dir())]), halt().' if (Test-Path "$erl_root\erts-$Vsn") { return @($erl_root, "$erl_root\erts-$Vsn") } # Expected $vsn but not found, get ERTS version installed - $erts_vsn = & $erl -boot no_dot_erlang -noshell -eval 'io:format(\"~s\", [erlang:system_info(version)]), halt().' + $erts_vsn = & $erl -boot no_dot_erlang -noshell -eval 'io:format("~s", [erlang:system_info(version)]), halt().' if (!(Test-Path "$erl_root\erts-$erts_vsn")) { Write-Error "Can not run the release. There is no ERTS bundled with the release or found on the system." # Terminates here due to $ErrorActionPreference = "Stop" @@ -172,4 +172,4 @@ function Get-Cookie() } return $cookie -} \ No newline at end of file +} From 83c9f234fee789b6402db2f70802ac5492e47593 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 10 Aug 2025 16:58:46 +0000 Subject: [PATCH 4/6] Silence some dialyzer warnings --- src/relx.erl | 4 ++++ src/rlx_relup.erl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/relx.erl b/src/relx.erl index ab3ca332c..593c6bb9b 100644 --- a/src/relx.erl +++ b/src/relx.erl @@ -127,6 +127,10 @@ build_tar(RelName, Apps, State) when is_atom(RelName) -> build_tar_(RealizedRelease, State), {ok, RealizedRelease}. +%% Ignore Dialyzer warnings on this, `no_warn_sasl` is a valid option +%% but the `systools:make_relup/4` spec is outdated and this causes +%% warning as late as OTP-28, and all calls in the chain fail analysis in turn. +-dialyzer({nowarn_function, [build_relup/4]}). -spec build_relup(rlx_release:name(), rlx_release:vsn(), rlx_release:vsn(), rlx_config:t() | rlx_state:t()) -> {ok, rlx_state:t()} | {error, term()}. build_relup(RelName, ToVsn, UpFromVsn, Config) when is_list(Config) -> diff --git a/src/rlx_relup.erl b/src/rlx_relup.erl index 0a1e0ce5d..a5b341004 100644 --- a/src/rlx_relup.erl +++ b/src/rlx_relup.erl @@ -6,6 +6,10 @@ -include("relx.hrl"). -include("rlx_log.hrl"). +%% Ignore Dialyzer warnings on this, `no_warn_sasl` is a valid option +%% but the `systools:make_relup/4` spec is outdated and this causes +%% warning as late as OTP-28, and all calls in the chain fail analysis in turn. +-dialyzer({nowarn_function, [do/4, make_upfrom_script/4]}). -spec do(atom(), string(), string() | undefined, rlx_state:t()) -> {ok, rlx_state:t()} | relx:error(). do(RelName, ToVsn, undefined, State) -> OutputDir = rlx_state:base_output_dir(State), From fa2b92ed20c7f2f5bd80545fbb2db56631631e06 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 10 Aug 2025 17:16:51 +0000 Subject: [PATCH 5/6] attempt vendor-awareness in windows shelltest --- shelltests/wintest.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shelltests/wintest.ps1 b/shelltests/wintest.ps1 index 82fd33c56..7761f5f27 100644 --- a/shelltests/wintest.ps1 +++ b/shelltests/wintest.ps1 @@ -24,9 +24,11 @@ mkdir $rebar3_dir | Out-Null # Clone latest rebar3 and build with relx as a checkout Push-Location $rebar3_dir & git clone "https://github.com/erlang/rebar3" . -mkdir _checkouts | Out-Null -New-Item -ItemType SymbolicLink -Path "_checkouts\relx" -Target "$PSScriptRoot\..\..\relx" | Out-Null -(Get-Content rebar.config) -replace 'relx(.*)build/default/lib/', 'relx$1checkouts' | Set-Content rebar.config -Encoding ASCII +Remove-Item -Path "vendor\relx\*" -Recurse -Force +Copy-Item -Path "$PSScriptRoot\..\..\relx\*" -Destination "vendor\relx" -Recurse -Exclude ".git" #| Out-Null +#mkdir _checkouts | Out-Null +#New-Item -ItemType SymbolicLink -Path "_checkouts\relx" -Target "$PSScriptRoot\..\..\relx" | Out-Null +#(Get-Content rebar.config) -replace 'relx(.*)build/default/lib/', 'relx$1checkouts' | Set-Content rebar.config -Encoding ASCII cmd /c bootstrap.bat Pop-Location "" From fceda1d5aa9b368305725a21055ed31b3a982124 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 10 Aug 2025 20:03:07 +0000 Subject: [PATCH 6/6] trying a thing again --- shelltests/wintest.ps1 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/shelltests/wintest.ps1 b/shelltests/wintest.ps1 index 7761f5f27..d0b2f317e 100644 --- a/shelltests/wintest.ps1 +++ b/shelltests/wintest.ps1 @@ -24,11 +24,12 @@ mkdir $rebar3_dir | Out-Null # Clone latest rebar3 and build with relx as a checkout Push-Location $rebar3_dir & git clone "https://github.com/erlang/rebar3" . -Remove-Item -Path "vendor\relx\*" -Recurse -Force -Copy-Item -Path "$PSScriptRoot\..\..\relx\*" -Destination "vendor\relx" -Recurse -Exclude ".git" #| Out-Null -#mkdir _checkouts | Out-Null -#New-Item -ItemType SymbolicLink -Path "_checkouts\relx" -Target "$PSScriptRoot\..\..\relx" | Out-Null -#(Get-Content rebar.config) -replace 'relx(.*)build/default/lib/', 'relx$1checkouts' | Set-Content rebar.config -Encoding ASCII +Remove-Item -Path "vendor\relx\src\*" -Recurse -Force +Remove-Item -Path "vendor\relx\priv\*" -Recurse -Force +Remove-Item -Path "vendor\relx\rebar*" -Force +Copy-Item -Path "$PSScriptRoot\..\..\relx\src\*" -Destination "vendor\relx\src" -Recurse | Out-Null +Copy-Item -Path "$PSScriptRoot\..\..\relx\priv\*" -Destination "vendor\relx\priv" -Recurse | Out-Null +Copy-Item -Path "$PSScriptRoot\..\..\relx\rebar*" -Destination "vendor\relx" -Recurse #| Out-Null cmd /c bootstrap.bat Pop-Location "" @@ -63,6 +64,9 @@ if ($LASTEXITCODE -ne 0) { } "" +Get-Process | Out-String -Stream +Get-Service -Name powershell_release_0.1.0 | Out-String -Stream + "*** Start service" & ".\$release.ps1" start if ($LASTEXITCODE -ne 0) { @@ -70,6 +74,9 @@ if ($LASTEXITCODE -ne 0) { } "" +Get-Process | Out-String -Stream +Get-Service -Name powershell_release_0.1.0 | Out-String -Stream + "*** Ping service" & ".\$release.ps1" ping if ($LASTEXITCODE -ne 0) {