Stream: coqbot devs & users

Topic: build errors


view this post on Zulip Jason Gross (Apr 20 2021 at 18:01):

How do I solve

$ dune build
File "bot-components/dune", line 13, characters 0-251:
13 | (rule
14 |  (targets schema.json)
15 |  (deps .github-token (universe))
16 |  (action
17 |   (with-stdout-to
18 |    %{targets}
19 |    (run get-graphql-schema --json --header
20 |      "Authorization=Bearer %{read:.github-token}"
21 |      https://api.github.com/graphql)))
22 |  (mode promote))
Error: No rule found for bot-components/.github-token

?

view this post on Zulip Jason Gross (Apr 20 2021 at 18:03):

If I touch bot-components/.github-token, now I get

$ dune build
File "bot-components/dune", line 19, characters 8-26:
19 |    (run get-graphql-schema --json --header
             ^^^^^^^^^^^^^^^^^^
Error: Program get-graphql-schema not found in the tree or in PATH
 (context: default)

How do I install this program?

view this post on Zulip Jason Gross (Apr 20 2021 at 18:04):

I guess maybe I want dune build --ignore-promoted-rules?

view this post on Zulip Jason Gross (Apr 20 2021 at 18:05):

Then I get

$ dune build --ignore-promoted-rules
File "src/config.mli", line 1, characters 29-44:
1 | val toml_of_file : string -> TomlTypes.table
                                 ^^^^^^^^^^^^^^^
Error: Unbound module TomlTypes

view this post on Zulip Enrico Tassi (Apr 20 2021 at 18:07):

Are you looking at the .github/CONTRIBUTING doc?

view this post on Zulip Enrico Tassi (Apr 20 2021 at 18:07):

(it contains build instructions)

view this post on Zulip Jason Gross (Apr 20 2021 at 18:08):

Yes, that's where I looked to find dune build --ignore-promoted-rules (sorry for posting here before looking there). But it doesn't say anything about TomlTypes, I think

view this post on Zulip Jason Gross (Apr 20 2021 at 18:09):

$ opam install toml
[NOTE] Package toml is already installed (current version is 7.0.0).

view this post on Zulip Enrico Tassi (Apr 20 2021 at 18:09):

It suggests to use nix

view this post on Zulip Jason Gross (Apr 20 2021 at 18:10):

It looks like my version of toml is too new, according to dune-project. I thought dune was supposed to catch errors like this?

view this post on Zulip Jason Gross (Apr 20 2021 at 18:14):

After doing opam install --deps-only ., I get

$ dune build --ignore-promoted-rules
File "src/config.ml", lines 88-98, characters 2-32:
88 | ..match
89 |     let private_k = Sys.getenv_exn "GITHUB_PRIVATE_KEY" in
90 |     Stdio.printf "Found private key: %s\n" private_k ;
91 |     private_k |> Cstruct.of_string |> X509.Private_key.decode_pem
92 |   with
...
95 |         (Mirage_crypto_pk.Rsa.priv_bits priv) ;
96 |       priv
97 |   | Error (`Msg e) ->
98 |       raise (Failure (f "%s" e))
Error (warning 8): this pattern-matching is not exhaustive.
Here is an example of a case that is not matched:
Ok (`P256 _|`P521 _|`P384 _|`P224 _|`ED25519 _)

view this post on Zulip Jason Gross (Apr 20 2021 at 18:17):

Maybe there's a missing upper-bound version constraint?

view this post on Zulip Théo Zimmermann (Apr 20 2021 at 19:22):

Maybe there's a missing upper-bound version constraint?

Yes, that's possible. I only catch missing upper bound constraints when they make the deploy build fail. But the deploy build uses dune build -p so builds without warnings.

view this post on Zulip Emilio Jesús Gallego Arias (Apr 20 2021 at 20:08):

Indeed maybe the contributing guide could be updated to distinguish between "local release build" and "local dev build"


Last updated: Jan 31 2023 at 09:01 UTC