diff --git a/.github/workflows/find_openssl.bat b/.github/workflows/find_openssl.bat new file mode 100644 index 0000000000..a1cd86b835 --- /dev/null +++ b/.github/workflows/find_openssl.bat @@ -0,0 +1,10 @@ +@echo off +setlocal EnableDelayedExpansion +REM Find every openssl.exe reachable through PATH: +for /f "delims=" %%F in ('where openssl 2^>nul') do ( + set "OPENSSL_DIR=%%~dpF" + echo OpenSSL lives in: "!OPENSSL_DIR!" + goto :end +) +echo OpenSSL not found in: "!PATH!" +:end diff --git a/.github/workflows/windows_ci.yml b/.github/workflows/windows_ci.yml index 14b81470cf..4d7220d6f6 100644 --- a/.github/workflows/windows_ci.yml +++ b/.github/workflows/windows_ci.yml @@ -25,17 +25,35 @@ concurrency: jobs: gcc-windows: - runs-on: windows-2019 + runs-on: windows-2025 timeout-minutes: 90 env: VFLAGS: -cc gcc steps: - uses: actions/checkout@v4 - - name: Build + - name: Show tool versions run: | gcc --version + pkg-config --version + openssl version + echo "Flags for openssl:" + pkg-config openssl --cflags + echo "Flags for openssl libs:" + pkg-config openssl --libs + .github/workflows/find_openssl.bat + echo "OpenSSL files:" + where.exe /R "C:\Program Files\OpenSSL" *.* + echo "Include files for openssl:" + dir "c:/Program Files/OpenSSL/include" + echo "Lib Include files for openssl:" + dir "c:/Program Files/OpenSSL/lib/VC/x64/" + - name: Build + run: | .\make.bat -gcc .\v.exe symlink + .\v.exe -stats vlib/crypto/ecdsa/ecdsa_test.v + - name: Test v binaries + run: v -silent build-vbinaries - name: All code is formatted run: v -silent test-cleancode - name: Test new v.c @@ -64,8 +82,6 @@ jobs: run: v -autofree vlib/v/tests/options/option_test.c.v - name: Test v->js run: v -o hi.js examples/js_hello_world.v && node hi.js - - name: Test v binaries - run: v -silent build-vbinaries - name: Build examples run: v -silent build-examples - name: v2 self compilation diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index d93bb4b18d..34fe57f9bb 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -46,12 +46,16 @@ pub const is_node_present = os.execute('node --version').exit_code == 0 pub const is_go_present = os.execute('go version').exit_code == 0 pub const is_ruby_present = os.execute('ruby --version').exit_code == 0 + && os.execute('pkg-config ruby --libs').exit_code == 0 pub const is_python_present = os.execute('python --version').exit_code == 0 + && os.execute('pkg-config python3 --libs').exit_code == 0 pub const is_sqlite3_present = os.execute('sqlite3 --version').exit_code == 0 + && os.execute('pkg-config sqlite3 --libs').exit_code == 0 pub const is_openssl_present = os.execute('openssl --version').exit_code == 0 + && os.execute('pkg-config openssl --libs').exit_code == 0 pub const all_processes = get_all_processes() diff --git a/vlib/crypto/ecdsa/ecdsa.c.v b/vlib/crypto/ecdsa/ecdsa.c.v index 388508f58e..38a20a5ba3 100644 --- a/vlib/crypto/ecdsa/ecdsa.c.v +++ b/vlib/crypto/ecdsa/ecdsa.c.v @@ -15,6 +15,14 @@ module ecdsa #flag linux -I/usr/local/include/openssl #flag linux -L/usr/local/lib64/ +// Installed through choco: +#flag windows -IC:/Program Files/OpenSSL-Win64/include +#flag windows -LC:/Program Files/OpenSSL-Win64/lib/VC/x64/MD + +// Installed on the CI: +#flag windows -IC:/Program Files/OpenSSL/include +#flag windows -LC:/Program Files/OpenSSL/lib/VC/x64/MD + #flag -I/usr/include/openssl #flag -lcrypto diff --git a/vlib/net/openssl/openssl.c.v b/vlib/net/openssl/openssl.c.v index 8474390312..d70cda2793 100644 --- a/vlib/net/openssl/openssl.c.v +++ b/vlib/net/openssl/openssl.c.v @@ -14,11 +14,22 @@ module openssl // openssl. #flag freebsd -I/usr/local/include #flag freebsd -L/usr/local/lib + +// Installed through choco: +#flag windows -IC:/Program Files/OpenSSL-Win64/include +#flag windows -LC:/Program Files/OpenSSL-Win64/lib/VC/x64/MD + +// Installed on the CI: +#flag windows -IC:/Program Files/OpenSSL/include +#flag windows -LC:/Program Files/OpenSSL/lib/VC/x64/MD + $if $pkgconfig('openssl') { #pkgconfig --cflags --libs openssl } $else { #flag windows -l libssl -l libcrypto - #flag -lssl -lcrypto + $if !windows { + #flag -lssl -lcrypto + } #flag linux -ldl -lpthread // MacPorts #flag darwin -I/opt/local/include diff --git a/vlib/v/gen/native/tests/native_test.v b/vlib/v/gen/native/tests/native_test.v index 41905bf66f..6c2a4aa102 100644 --- a/vlib/v/gen/native/tests/native_test.v +++ b/vlib/v/gen/native/tests/native_test.v @@ -1,4 +1,4 @@ -// vtest build: (amd64 || arm64) && !self_sandboxed_packaging? +// vtest build: (amd64 || arm64) && !self_sandboxed_packaging? && !gcc-windows import os import time import benchmark