在 GitHub Actions 上的 Windows 上安装 Coq 在一个存储库上成功,但在另一个存储库上失败

问题描述 投票:0回答:1

我尝试在 Windows 上的 GitHub Actions 上安装 Coq,但看到了奇怪的结果。

我尝试了以下脚本,但由于缺少

gmp.h
错误而无法安装 Coq。

name: CI

on:
  push:
    branches:
      - master

  pull_request:
    branches:
      - master

jobs:
  test:
    runs-on: "windows-latest"

    steps:
      # See https://github.com/ocaml-opam/opam-repository-mingw#updates for `opam-repositories`.
      - name: Install OCaml
        uses: ocaml/[email protected]
        with:
          ocaml-compiler: "4.14.1"
          opam-repositories: |
            opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
            default: https://github.com/ocaml/opam-repository.git
          dune-cache: true

      - name: Install Coq
        run: opam install coq.8.19.0

这是我的错误日志

Run opam install coq.8.19.0
  
The following actions will be performed:
  - install ocamlfind     1.9.5  [required by coq-core]
  - install conf-gmp      4      [required by zarith]
  - install zarith        1.13   [required by coq-core]
  - install coq-core      8.19.0 [required by coq]
  - install coqide-server 8.19.0 [required by coq]
  - install coq-stdlib    8.19.0 [required by coq]
  - install coq           8.19.0
===== 7 to install =====
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[coq-core.8.19.0] downloaded from https://github.com/coq/coq/releases/download/V8.19.0/coq-8.19.0.tar.gz
[coq-stdlib.8.19.0] downloaded from https://github.com/coq/coq/releases/download/V8.19.0/coq-8.19.0.tar.gz
[coq.8.19.0] downloaded from https://github.com/coq/coq/releases/download/V8.19.0/coq-8.19.0.tar.gz
[coqide-server.8.19.0] found in cache
[ocamlfind.1.9.5] downloaded from http://download.camlcity.org/download/findlib-1.9.5.tar.gz
[zarith.1.13] downloaded from https://github.com/ocaml/Zarith/archive/release-1.13.tar.gz
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of conf-gmp failed at "D:\\cygwin\\bin\\sh.exe -exc $(ocamlc -config | awk -F '[\t\r ]+' '/^bytecomp_c_compiler/ {for(i=2;i<=NF;i++) printf \"%s \", $i}') -c $CFLAGS test.c".
-> installed ocamlfind.1.9.5
#=== ERROR while compiling conf-gmp.4 =========================================#
# context     2.0.10 | win32/x86_64 | ocaml-variants.4.14.1+mingw64c | git+https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
# path        D:/a/test-github-actions/test-github-actions/_opam/.opam-switch/build/conf-gmp.4
# command     D:\cygwin\bin\sh.exe -exc $(ocamlc -config | awk -F '[    
 ]+' '/^bytecomp_c_compiler/ {for(i=2;i<=NF;i++) printf "%s ", $i}') -c $CFLAGS test.c
# exit-code   1
# env-file    D:/.opam/log/conf-gmp-1660-d6d332.env
# output-file D:/.opam/log/conf-gmp-1660-d6d332.out
### output ###
# ++ ocamlc -config
# ++ awk -F '[  
 ]+' '/^bytecomp_c_compiler/ {for(i=2;i<=NF;i++) printf "%s ", $i}'
# + x86_64-w64-mingw32-gcc -O2 -fno-strict-aliasing -fwrapv -mms-bitfields -c test.c
# test.c:1:10: fatal error: gmp.h: No such file or directory
#     1 | #include <gmp.h>
#       |          ^~~~~~~
# compilation terminated.
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build conf-gmp 4
+- 
+- The following changes have been performed (the rest was aborted)
| - install ocamlfind 1.9.5
+- 
The packages you requested declare the following system dependencies. Please make sure they are installed before retrying:
    gmp
The former state can be restored with:
    opam.exe switch import "D:/a/test-github-actions/test-github-actions/_opam/.opam-switch/backup/state-20240423142828.export"
Error: Process completed with exit code 1.

奇怪的是,我可以在我的另一个存储库中安装Coq,而无需手动安装

gmp.h
。以下是存储库中脚本的豁免(顺便说一句,您可以查看我的dune-project)。在运行 CI 之前,我通过在该存储库上运行
gh cache delete --all
来确认缓存不会影响结果。

name: Test

on:
  push:
    branches:
      - main

  pull_request:

jobs:
  test:
    strategy:
      fail-fast: false

      matrix:
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest

    runs-on: ${{ matrix.os }}

    steps:
      # Without this, tests will fail on Windows because Coqfmt uses LF as a
      # newline while the cloned source code contains CRLF.
      - name: Modify the git setting not to convert LF to CRLF
        run: git config --global core.autocrlf input

      - uses: actions/[email protected]

      # See https://github.com/ocaml-opam/opam-repository-mingw#updates for `opam-repositories`.
      - uses: ocaml/[email protected]
        with:
          ocaml-compiler: "4.14.1"
          opam-repositories: |
            opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
            default: https://github.com/ocaml/opam-repository.git
          dune-cache: true

      - name: Install dependencies
        run: opam install --deps-only --with-test .

      # Without `opam exec -- `, these commands will fail due to "dune not found"
      # error.
      - name: Build
        run: opam exec -- dune build

      - name: Run tests with dune
        run: opam exec -- dune test

      - name: Run `Require` test
        run: ./test.sh
        working-directory: ./test/require-test

日志

Run opam install --deps-only --with-test .
[coqfmt.dev] no changes from git+file://D:/a/coqfmt/coqfmt#main
The following actions will be performed:
  - install cppo                1.6.9
  - install ppx_derivers        1.2.1
  - install ocamlbuild          0.14.2+win
  - install conf-bash           1
  - install dune-build-info     3.15.0
  - install num                 1.5
  - install cmdliner            1.2.0
  - install seq                 base
  - install ocaml-compiler-libs v0.12.4
  - install ocaml-syntax-shims  1.0.0
  - install stdlib-shims        0.3.0
  - install ocamlfind           1.9.5
  - install conf-gmp            4
  - install result              1.5
  - install csexp               1.5.2
  - install sexplib0            v0.16.0
  - install yojson              2.1.2
  - install re                  1.11.0
  - install topkg               1.0.7
  - install zarith              1.13
  - install dune-configurator   3.15.0
  - install ppxlib              0.32.0
  - install parsexp             v0.16.0
  - install uutf                1.0.3
  - install fmt                 0.9.0
  - install astring             0.8.5
  - install coq-core            8.19.0
  - install base                v0.16.3
  - install ppx_import          1.10.0
  - install ppx_deriving        5.2.1
  - install sexplib             v0.16.0
  - install alcotest            1.7.0
  - install coqide-server       8.19.0
  - install coq-stdlib          8.19.0
  - install ppx_sexp_conv       v0.16.0
  - install ppx_compare         v0.16.0
  - install ppx_deriving_yojson 3.7.0
  - install coq                 8.19.0
  - install ppx_hash            v0.16.0
  - install coq-serapi          8.19.0+0.19.2
===== 40 to install =====

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[alcotest.1.7.0] downloaded from https://github.com/mirage/alcotest/releases/download/1.7.0/alcotest-1.7.0.tbz
[astring.0.8.5] downloaded from https://erratique.ch/software/astring/releases/astring-0.8.5.tbz
[base.v0.16.3] downloaded from https://github.com/janestreet/base/archive/refs/tags/v0.16.3.tar.gz
[cmdliner.1.2.0] downloaded from https://erratique.ch/software/cmdliner/releases/cmdliner-1.2.0.tbz
[coq.8.19.0] downloaded from https://github.com/coq/coq/releases/download/V8.19.0/coq-8.19.0.tar.gz
[coq-core.8.19.0] downloaded from https://github.com/coq/coq/releases/download/V8.19.0/coq-8.19.0.tar.gz
[coq-serapi.8.19.0+0.19.2] downloaded from https://github.com/ejgallego/coq-serapi/releases/download/8.19.0%2B0.19.2/coq-serapi-8.19.0.0.19.2.tbz
[coq-stdlib.8.19.0] found in cache
[coqide-server.8.19.0] found in cache
[cppo.1.6.9] downloaded from https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz
[dune-build-info.3.15.0] found in cache
[csexp.1.5.2] downloaded from https://github.com/ocaml-dune/csexp/releases/download/1.5.2/csexp-1.5.2.tbz
[dune-configurator.3.15.0] found in cache
[fmt.0.9.0] downloaded from https://erratique.ch/software/fmt/releases/fmt-0.9.0.tbz
[num.1.5] downloaded from https://github.com/ocaml/num/archive/v1.5.tar.gz
[ocaml-compiler-libs.v0.12.4] downloaded from https://github.com/janestreet/ocaml-compiler-libs/releases/download/v0.12.4/ocaml-compiler-libs-v0.12.4.tbz
[ocaml-syntax-shims.1.0.0] downloaded from https://github.com/ocaml-ppx/ocaml-syntax-shims/releases/download/1.0.0/ocaml-syntax-shims-1.0.0.tbz
[ocamlbuild.0.14.2+win] downloaded from https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.2.tar.gz
[parsexp.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/parsexp-v0.16.0.tar.gz
[ocamlbuild.0.14.2+win/ocamlbuild-0.14.2.patch] downloaded from https://raw.githubusercontent.com/ocaml-opam/opam-repository-mingw/354a87b397856f2a70024c5c83fc5001074935b6/packages/ocamlbuild/ocamlbuild.0.14.2/files/ocamlbuild-0.14.2.patch
[ocamlfind.1.9.5] downloaded from http://download.camlcity.org/download/findlib-1.9.5.tar.gz
[ppx_compare.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/ppx_compare-v0.16.0.tar.gz
[ppx_derivers.1.2.1] downloaded from https://github.com/ocaml-ppx/ppx_derivers/archive/1.2.1.tar.gz
[ppx_deriving.5.2.1] downloaded from https://github.com/ocaml-ppx/ppx_deriving/releases/download/v5.2.1/ppx_deriving-v5.2.1.tbz
[ppx_hash.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/ppx_hash-v0.16.0.tar.gz
[ppx_deriving_yojson.3.7.0] downloaded from https://github.com/ocaml-ppx/ppx_deriving_yojson/releases/download/v3.7.0/ppx_deriving_yojson-3.7.0.tar.gz
[ppx_sexp_conv.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/ppx_sexp_conv-v0.16.0.tar.gz
[ppx_import.1.10.0] downloaded from https://github.com/ocaml-ppx/ppx_import/releases/download/1.10.0/ppx_import-1.10.0.tbz
[ppxlib.0.32.0] downloaded from https://github.com/ocaml-ppx/ppxlib/releases/download/0.32.0/ppxlib-0.32.0.tbz
[re.1.11.0] downloaded from https://github.com/ocaml/ocaml-re/releases/download/1.11.0/re-1.11.0.tbz
[result.1.5] downloaded from https://github.com/janestreet/result/releases/download/1.5/result-1.5.tbz
[sexplib.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/sexplib-v0.16.0.tar.gz
[sexplib0.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/sexplib0-v0.16.0.tar.gz
[stdlib-shims.0.3.0] downloaded from https://github.com/ocaml/stdlib-shims/releases/download/0.3.0/stdlib-shims-0.3.0.tbz
[uutf.1.0.3] downloaded from https://erratique.ch/software/uutf/releases/uutf-1.0.3.tbz
[topkg.1.0.7] downloaded from https://erratique.ch/software/topkg/releases/topkg-1.0.7.tbz
[yojson.2.1.2] downloaded from https://github.com/ocaml-community/yojson/releases/download/2.1.2/yojson-2.1.2.tbz
[zarith.1.13] downloaded from https://github.com/ocaml/Zarith/archive/release-1.13.tar.gz

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed cmdliner.1.2.0
-> installed conf-bash.1
-> installed conf-gmp.4
-> installed cppo.1.6.9
-> installed csexp.1.5.2
-> installed dune-build-info.3.15.0
-> installed num.1.5
-> installed ocaml-compiler-libs.v0.12.4
-> installed ocaml-syntax-shims.1.0.0
-> installed ppx_derivers.1.2.1
-> installed result.1.5
-> installed seq.base
-> installed ocamlbuild.0.14.2+win
-> installed ocamlfind.1.9.5
-> installed dune-configurator.3.15.0
-> installed sexplib0.v0.16.0
-> installed parsexp.v0.16.0
-> installed re.1.11.0
-> installed stdlib-shims.0.3.0
-> installed topkg.1.0.7
-> installed astring.0.8.5
-> installed sexplib.v0.16.0
-> installed uutf.1.0.3
-> installed yojson.2.1.2
-> installed zarith.1.13
-> installed fmt.0.9.0
-> installed base.v0.16.3
-> installed alcotest.1.7.0
-> installed ppxlib.0.32.0
-> installed ppx_compare.v0.16.0
-> installed ppx_import.1.10.0
-> installed ppx_deriving.5.2.1
-> installed ppx_deriving_yojson.3.7.0
-> installed ppx_sexp_conv.v0.16.0
-> installed ppx_hash.v0.16.0
-> installed coq-core.8.19.0
-> installed coqide-server.8.19.0
-> installed coq-stdlib.8.19.0
-> installed coq.8.19.0
-> installed coq-serapi.8.19.0+0.19.2
Done.

更奇怪的是,在另一个存储库中克隆成功的项目并运行

opam install
确实引发了丢失的
gmp.h
错误。

name: CI

on:
  push:
    branches:
      - master

  pull_request:
    branches:
      - master

jobs:
  test:
    runs-on: "windows-latest"

    steps:
      # See https://github.com/ocaml-opam/opam-repository-mingw#updates for `opam-repositories`.
      - name: Install OCaml
        uses: ocaml/[email protected]
        with:
          ocaml-compiler: "4.14.1"
          opam-repositories: |
            opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
            default: https://github.com/ocaml/opam-repository.git
          dune-cache: true

      - name: Clone
        run: git clone https://github.com/toku-sa-n/coqfmt.git

      - name: Install dependencies
        run: cd coqfmt && opam install --deps-only --with-test .

日志

Run cd coqfmt && opam install --deps-only --with-test .
  
The following actions will be performed:
  - install cppo                1.6.9
  - install ppx_derivers        1.2.1
  - install ocamlbuild          0.14.2+win
  - install conf-bash           1
  - install dune-build-info     3.15.0
  - install num                 1.5
  - install cmdliner            1.2.0
  - install seq                 base
  - install ocaml-compiler-libs v0.12.4
  - install ocaml-syntax-shims  1.0.0
  - install stdlib-shims        0.3.0
  - install ocamlfind           1.9.5
  - install conf-gmp            4
  - install result              1.5
  - install csexp               1.5.2
  - install sexplib0            v0.16.0
  - install yojson              2.1.2
  - install re                  1.11.0
  - install topkg               1.0.7
  - install zarith              1.13
  - install dune-configurator   3.15.0
  - install ppxlib              0.32.0
  - install parsexp             v0.16.0
  - install uutf                1.0.3
  - install fmt                 0.9.0
  - install astring             0.8.5
  - install coq-core            8.19.0
  - install base                v0.16.3
  - install ppx_import          1.10.0
  - install ppx_deriving        5.2.1
  - install sexplib             v0.16.0
  - install alcotest            1.7.0
  - install coqide-server       8.19.0
  - install coq-stdlib          8.19.0
  - install ppx_sexp_conv       v0.16.0
  - install ppx_compare         v0.16.0
  - install ppx_deriving_yojson 3.7.0
  - install coq                 8.19.0
  - install ppx_hash            v0.16.0
  - install coq-serapi          8.19.0+0.19.2
===== 40 to install =====
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[base.v0.16.3] downloaded from https://github.com/janestreet/base/archive/refs/tags/v0.16.3.tar.gz
[alcotest.1.7.0] downloaded from https://github.com/mirage/alcotest/releases/download/1.7.0/alcotest-1.7.0.tbz
[astring.0.8.5] downloaded from https://erratique.ch/software/astring/releases/astring-0.8.5.tbz
[cmdliner.1.2.0] downloaded from https://erratique.ch/software/cmdliner/releases/cmdliner-1.2.0.tbz
[coq.8.19.0] downloaded from https://github.com/coq/coq/releases/download/V8.19.0/coq-8.19.0.tar.gz
[coq-core.8.19.0] downloaded from https://github.com/coq/coq/releases/download/V8.19.0/coq-8.19.0.tar.gz
[coq-serapi.8.19.0+0.19.2] downloaded from https://github.com/ejgallego/coq-serapi/releases/download/8.19.0%2B0.19.2/coq-serapi-8.19.0.0.19.2.tbz
[coq-stdlib.8.19.0] found in cache
[coqide-server.8.19.0] found in cache
[cppo.1.6.9] downloaded from https://github.com/ocaml-community/cppo/archive/v1.6.9.tar.gz
[dune-build-info.3.15.0] found in cache
[csexp.1.5.2] downloaded from https://github.com/ocaml-dune/csexp/releases/download/1.5.2/csexp-1.5.2.tbz
[dune-configurator.3.15.0] found in cache
[fmt.0.9.0] downloaded from https://erratique.ch/software/fmt/releases/fmt-0.9.0.tbz
[num.1.5] downloaded from https://github.com/ocaml/num/archive/v1.5.tar.gz
[ocaml-compiler-libs.v0.12.4] downloaded from https://github.com/janestreet/ocaml-compiler-libs/releases/download/v0.12.4/ocaml-compiler-libs-v0.12.4.tbz
[ocaml-syntax-shims.1.0.0] downloaded from https://github.com/ocaml-ppx/ocaml-syntax-shims/releases/download/1.0.0/ocaml-syntax-shims-1.0.0.tbz
[ocamlbuild.0.14.2+win] downloaded from https://github.com/ocaml/ocamlbuild/archive/refs/tags/0.14.2.tar.gz
[parsexp.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/parsexp-v0.16.0.tar.gz
[ocamlbuild.0.14.2+win/ocamlbuild-0.14.2.patch] downloaded from https://raw.githubusercontent.com/ocaml-opam/opam-repository-mingw/354a87b397856f2a70024c5c83fc5001074935b6/packages/ocamlbuild/ocamlbuild.0.14.2/files/ocamlbuild-0.14.2.patch
[ppx_compare.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/ppx_compare-v0.16.0.tar.gz
[ocamlfind.1.9.5] downloaded from http://download.camlcity.org/download/findlib-1.9.5.tar.gz
[ppx_derivers.1.2.1] downloaded from https://github.com/ocaml-ppx/ppx_derivers/archive/1.2.1.tar.gz
[ppx_deriving.5.2.1] downloaded from https://github.com/ocaml-ppx/ppx_deriving/releases/download/v5.2.1/ppx_deriving-v5.2.1.tbz
[ppx_hash.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/ppx_hash-v0.16.0.tar.gz
[ppx_deriving_yojson.3.7.0] downloaded from https://github.com/ocaml-ppx/ppx_deriving_yojson/releases/download/v3.7.0/ppx_deriving_yojson-3.7.0.tar.gz
[ppx_sexp_conv.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/ppx_sexp_conv-v0.16.0.tar.gz
[ppx_import.1.10.0] downloaded from https://github.com/ocaml-ppx/ppx_import/releases/download/1.10.0/ppx_import-1.10.0.tbz
[ppxlib.0.32.0] downloaded from https://github.com/ocaml-ppx/ppxlib/releases/download/0.32.0/ppxlib-0.32.0.tbz
[re.1.11.0] downloaded from https://github.com/ocaml/ocaml-re/releases/download/1.11.0/re-1.11.0.tbz
[result.1.5] downloaded from https://github.com/janestreet/result/releases/download/1.5/result-1.5.tbz
[sexplib.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/sexplib-v0.16.0.tar.gz
[sexplib0.v0.16.0] downloaded from https://ocaml.janestreet.com/ocaml-core/v0.16/files/sexplib0-v0.16.0.tar.gz
[stdlib-shims.0.3.0] downloaded from https://github.com/ocaml/stdlib-shims/releases/download/0.3.0/stdlib-shims-0.3.0.tbz
[topkg.1.0.7] downloaded from https://erratique.ch/software/topkg/releases/topkg-1.0.7.tbz
[uutf.1.0.3] downloaded from https://erratique.ch/software/uutf/releases/uutf-1.0.3.tbz
[yojson.2.1.2] downloaded from https://github.com/ocaml-community/yojson/releases/download/2.1.2/yojson-2.1.2.tbz
[zarith.1.13] downloaded from https://github.com/ocaml/Zarith/archive/release-1.13.tar.gz
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of conf-gmp failed at "D:\\cygwin\\bin\\sh.exe -exc $(ocamlc -config | awk -F '[\t\r ]+' '/^bytecomp_c_compiler/ {for(i=2;i<=NF;i++) printf \"%s \", $i}') -c $CFLAGS test.c".
-> installed cmdliner.1.2.0
-> installed conf-bash.1
-> installed cppo.1.6.9
-> installed csexp.1.5.2
-> installed dune-build-info.3.15.0
-> installed num.1.5
-> installed ocaml-compiler-libs.v0.12.4
-> installed ocaml-syntax-shims.1.0.0
-> installed ppx_derivers.1.2.1
-> installed result.1.5
-> installed seq.base
-> installed ocamlbuild.0.14.2+win
-> installed ocamlfind.1.9.5
-> installed dune-configurator.3.15.0
-> installed sexplib0.v0.16.0
-> installed re.1.11.0
-> installed stdlib-shims.0.3.0
-> installed topkg.1.0.7
-> installed astring.0.8.5
-> installed fmt.0.9.0
-> installed parsexp.v0.16.0
-> installed uutf.1.0.3
-> installed sexplib.v0.16.0
-> installed yojson.2.1.2
-> installed alcotest.1.7.0
-> installed base.v0.16.3
-> installed ppxlib.0.32.0
-> installed ppx_compare.v0.16.0
-> installed ppx_import.1.10.0
-> installed ppx_sexp_conv.v0.16.0
-> installed ppx_deriving.5.2.1
-> installed ppx_hash.v0.16.0
-> installed ppx_deriving_yojson.3.7.0
#=== ERROR while compiling conf-gmp.4 =========================================#
# context     2.0.10 | win32/x86_64 | ocaml-variants.4.14.1+mingw64c | git+https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
# path        D:/a/test-github-actions/test-github-actions/_opam/.opam-switch/build/conf-gmp.4
# command     D:\cygwin\bin\sh.exe -exc $(ocamlc -config | awk -F '[    
 ]+' '/^bytecomp_c_compiler/ {for(i=2;i<=NF;i++) printf "%s ", $i}') -c $CFLAGS test.c
# exit-code   1
# env-file    D:/.opam/log/conf-gmp-5152-499329.env
# output-file D:/.opam/log/conf-gmp-5152-499329.out
### output ###
# ++ ocamlc -config
# ++ awk -F '[  
 ]+' '/^bytecomp_c_compiler/ {for(i=2;i<=NF;i++) printf "%s ", $i}'
# + x86_64-w64-mingw32-gcc -O2 -fno-strict-aliasing -fwrapv -mms-bitfields -c test.c
# test.c:1:10: fatal error: gmp.h: No such file or directory
#     1 | #include <gmp.h>
#       |          ^~~~~~~
# compilation terminated.
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build conf-gmp 4
+- 
+- The following changes have been performed (the rest was aborted)
| - install alcotest            1.7.0
| - install astring             0.8.5
| - install base                v0.16.3
| - install cmdliner            1.2.0
| - install conf-bash           1
| - install cppo                1.6.9
| - install csexp               1.5.2
| - install dune-build-info     3.15.0
| - install dune-configurator   3.15.0
| - install fmt                 0.9.0
| - install num                 1.5
| - install ocaml-compiler-libs v0.12.4
| - install ocaml-syntax-shims  1.0.0
| - install ocamlbuild          0.14.2+win
| - install ocamlfind           1.9.5
| - install parsexp             v0.16.0
| - install ppx_compare         v0.16.0
| - install ppx_derivers        1.2.1
| - install ppx_deriving        5.2.1
| - install ppx_deriving_yojson 3.7.0
| - install ppx_hash            v0.16.0
| - install ppx_import          1.10.0
| - install ppx_sexp_conv       v0.16.0
| - install ppxlib              0.32.0
| - install re                  1.11.0
| - install result              1.5
| - install seq                 base
| - install sexplib             v0.16.0
| - install sexplib0            v0.16.0
| - install stdlib-shims        0.3.0
| - install topkg               1.0.7
| - install uutf                1.0.3
| - install yojson              2.1.2
+- 
The former state can be restored with:
    opam.exe switch import "D:/a/test-github-actions/test-github-actions/_opam/.opam-switch/backup/state-20240423144540.export"
The packages you requested declare the following system dependencies. Please make sure they are installed before retrying:
    gmp

我错过了什么吗?我应该如何在 GitHub Actions 上在 Windows 上安装 Coq?我需要手动安装

gmp.h
吗?

github-actions coq
1个回答
0
投票

是的,您需要手动安装gmp(而不仅仅是标头)。在 Windows 上,opam 通常不知道如何安装依赖项 - 它只是检查它们是否存在。 Windows 上有多种 opam 变体可以安装依赖项,例如cygwin MinGW cross opam 可以使用 cygwin 安装 MinGW GMP 库(这就是 Coq Platform 所做的)。

为什么有时会有 GMP 很难说 - 我想说这一定是某种缓存效应。你绝对不能依赖这个。为什么要在新的虚拟机上安装 GMP?

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.