Skip to content

Commit

Permalink
GHA: Make sure the resulting opam binary is statically linked on MinG…
Browse files Browse the repository at this point in the history
…W and dynamically linked elsewhere on Windows
  • Loading branch information
kit-ty-kate committed Jan 2, 2024
1 parent 01010f6 commit 099d820
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ 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(true, EndsWith("matrix.host", "-w64-mingw32"))) "Test static binary" ["ldd ./opam.exe | grep -F libstdc++-6.dll ; test $? = 1"])
++ only_on Windows (run ~cond:(Predicate(false, EndsWith("matrix.host", "-w64-mingw32"))) "Test static binary" ["ldd ./opam.exe | grep -F libstdc++-6.dll"])
++ 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
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ 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 binary
if: endsWith(matrix.host, '-w64-mingw32')
run: ldd ./opam.exe | grep -F libstdc++-6.dll ; test $? = 1
- name: Test static binary
if: endsWith(matrix.host, '-w64-mingw32') == false
run: ldd ./opam.exe | grep -F libstdc++-6.dll
- name: Test (basic - Cygwin)
if: endsWith(matrix.host, '-pc-cygwin')
run: bash -exu .github/scripts/main/test.sh
Expand Down

0 comments on commit 099d820

Please sign in to comment.