Skip to content

Commit

Permalink
GHA: Make sure the resulting opam binary is "statically" linked on MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate authored and rjbou committed Jan 3, 2024
1 parent 6ea2004 commit aadfed5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/scripts/cygwin.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ if not exist %CYGWIN_CACHE_DIR%\%CYGWIN_DISTRO%\cache.tar (
:: C:\Windows\system32 (overriding curl, bash, etc. in System32) but after Mercurial
:: and Git (so that they are not overridden).
set Path=C:\Program Files\Mercurial;C:\Program Files\Git\cmd;%CYGWIN_ROOT%\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\
if "%3" equ "i686-w64-mingw32" set Path=%CYGWIN_ROOT%\usr\%3\sys-root\mingw\bin;%Path%
if "%3" equ "x86_64-w64-mingw32" set Path=%CYGWIN_ROOT%\usr\%3\sys-root\mingw\bin;%Path%
if "%3" equ "x86_64-pc-cygwin" set Path=%CYGWIN_ROOT%\bin;%Path%

::echo %CYGWIN_ROOT%\bin>> %GITHUB_PATH%
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ let main_build_job ~analyse_job ~cygwin_job ?section runner start_version ~oc ~w
++ build_cache OCaml platform "${{ matrix.ocamlv }}" host
++ run "Build" ["bash -exu .github/scripts/main/main.sh " ^ host]
++ not_on Windows (run "Test (basic)" ["bash -exu .github/scripts/main/test.sh"])
++ only_on Windows (run ~cond:(Predicate(false, EndsWith("matrix.host", "-pc-cygwin"))) "Test \"static\" binaries on Windows" ["ldd ./opam.exe | test \"$(grep -v -F /cygdrive/c/Windows/)\" = ''"])
++ only_on Windows (run "Test (basic - Cygwin)" ~cond:(Predicate(true, EndsWith("matrix.host", "-pc-cygwin"))) ["bash -exu .github/scripts/main/test.sh"])
++ only_on Windows (run "Test (basic - native Windows)" ~env:[("OPAMROOT", {|D:\a\opam\opam\.opam|})] ~shell:"cmd" ~cond:(Predicate(false, EndsWith("matrix.host", "-pc-cygwin")))
({|set Path=D:\Cache\ocaml-local\bin;%Path%|} ::
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ jobs:
run: bash -exu .github/scripts/main/ocaml-cache.sh ${{ runner.os }} ${{ matrix.ocamlv }} ${{ matrix.host }}
- name: Build
run: bash -exu .github/scripts/main/main.sh ${{ matrix.host }}
- name: Test "static" binaries on Windows
if: endsWith(matrix.host, '-pc-cygwin') == false
run: ldd ./opam.exe | test "$(grep -v -F /cygdrive/c/Windows/)" = ''
- name: Test (basic - Cygwin)
if: endsWith(matrix.host, '-pc-cygwin')
run: bash -exu .github/scripts/main/test.sh
Expand Down

0 comments on commit aadfed5

Please sign in to comment.