Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Build fails with Error: Unknown field target #8

Closed
JasonGross opened this issue Nov 19, 2023 · 7 comments
Closed

[BUG] Build fails with Error: Unknown field target #8

JasonGross opened this issue Nov 19, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@JasonGross
Copy link
Contributor

Describe the bug

$ opam install wasm_of_ocaml-compiler

<><> Synchronising pinned packages ><><><><><><><><><><><><><><><><><><><><><><>
[wasm_of_ocaml-compiler.5.3.0] synchronised (no changes)

The following actions will be performed:
  ∗ install dune                   3.11.1   [required by wasm_of_ocaml-compiler]
  ∗ install cmdliner               1.2.0    [required by wasm_of_ocaml-compiler]
  ∗ install seq                    base     [required by yojson]
  ∗ install stdlib-shims           0.3.0    [required by ppxlib]
  ∗ install sexplib0               v0.16.0  [required by ppxlib]
  ∗ install ppx_derivers           1.2.1    [required by ppxlib]
  ∗ install ocaml-compiler-libs    v0.12.4  [required by ppxlib]
  ∗ install menhirSdk              20230608 [required by wasm_of_ocaml-compiler]
  ∗ install menhirLib              20230608 [required by wasm_of_ocaml-compiler]
  ∗ install cppo                   1.6.9    [required by yojson]
  ∗ install gen                    1.1      [required by sedlex]
  ∗ install ppxlib                 0.31.0   [required by wasm_of_ocaml-compiler]
  ∗ install menhir                 20230608 [required by wasm_of_ocaml-compiler]
  ∗ install yojson                 2.1.1    [required by wasm_of_ocaml-compiler]
  ∗ install sedlex                 3.2      [required by wasm_of_ocaml-compiler]
  ∗ install js_of_ocaml-compiler   5.3.0*   [required by js_of_ocaml]
  ∗ install js_of_ocaml            5.3.0*   [required by wasm_of_ocaml-compiler]
  ∗ install wasm_of_ocaml-compiler 5.3.0*
===== ∗ 18 =====
Do you want to continue? [Y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved cmdliner.1.2.0  (cached)
⬇ retrieved cppo.1.6.9  (cached)
⬇ retrieved gen.1.1  (cached)
⬇ retrieved js_of_ocaml.5.3.0  (no changes)
⬇ retrieved dune.3.11.1  (https://opam.ocaml.org/cache)
⬇ retrieved js_of_ocaml-compiler.5.3.0  (no changes)
⬇ retrieved menhir.20230608  (cached)
⬇ retrieved menhirLib.20230608  (cached)
⬇ retrieved menhirSdk.20230608  (cached)
⬇ retrieved ocaml-compiler-libs.v0.12.4  (cached)
⬇ retrieved ppx_derivers.1.2.1  (cached)
∗ installed cmdliner.1.2.0
∗ installed seq.base
⬇ retrieved sedlex.3.2  (cached)
⬇ retrieved stdlib-shims.0.3.0  (cached)
⬇ retrieved ppxlib.0.31.0  (https://opam.ocaml.org/cache)
⬇ retrieved sexplib0.v0.16.0  (https://opam.ocaml.org/cache)
⬇ retrieved yojson.2.1.1  (https://opam.ocaml.org/cache)
⬇ retrieved wasm_of_ocaml-compiler.5.3.0  (no changes)
∗ installed dune.3.11.1
∗ installed ppx_derivers.1.2.1
∗ installed gen.1.1
∗ installed menhirLib.20230608
∗ installed menhirSdk.20230608
∗ installed cppo.1.6.9
∗ installed sexplib0.v0.16.0
∗ installed stdlib-shims.0.3.0
∗ installed ocaml-compiler-libs.v0.12.4
∗ installed yojson.2.1.1
∗ installed menhir.20230608
∗ installed ppxlib.0.31.0
∗ installed sedlex.3.2
[ERROR] The compilation of js_of_ocaml-compiler.5.3.0 failed at "dune build -p js_of_ocaml-compiler -j 7 @install".

#=== ERROR while compiling js_of_ocaml-compiler.5.3.0 =========================#
# context     2.1.5 | linux/x86_64 | ocaml-option-fp.1 ocaml-variants.4.14.1+options | pinned(git+file:///home/jgross/Documents/GitHub/wasm_of_ocaml#main#f517bbcafd81de486cf9951f401bd45a69ec4ae8)
# path        ~/.opam/4.14.1+fp+wasm/.opam-switch/build/js_of_ocaml-compiler.5.3.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p js_of_ocaml-compiler -j 7 @install
# exit-code   1
# env-file    ~/.opam/log/js_of_ocaml-compiler-17052-6567ab.env
# output-file ~/.opam/log/js_of_ocaml-compiler-17052-6567ab.out
### output ###
# File "dune", line 15, characters 4-10:
# 15 |    (target wasm)))
#          ^^^^^^
# Error: Unknown field target



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build js_of_ocaml-compiler 5.3.0
└─
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install cmdliner            1.2.0
│ ∗ install cppo                1.6.9
│ ∗ install dune                3.11.1
│ ∗ install gen                 1.1
│ ∗ install menhir              20230608
│ ∗ install menhirLib           20230608
│ ∗ install menhirSdk           20230608
│ ∗ install ocaml-compiler-libs v0.12.4
│ ∗ install ppx_derivers        1.2.1
│ ∗ install ppxlib              0.31.0
│ ∗ install sedlex              3.2
│ ∗ install seq                 base
│ ∗ install sexplib0            v0.16.0
│ ∗ install stdlib-shims        0.3.0
│ ∗ install yojson              2.1.1
└─

The former state can be restored with:
    /usr/local/bin/opam switch import "/home/jgross/.opam/4.14.1+fp+wasm/.opam-switch/backup/state-20231119060706.export"

Expected behavior
It should build

Versions
Version of packages used to reproduce the bug

$ ocamlc -v
The OCaml compiler, version 4.14.1
Standard library directory: /home/jgross/.opam/4.14.1+fp+wasm/lib/ocaml
@JasonGross JasonGross added the bug Something isn't working label Nov 19, 2023
@hhugo
Copy link
Contributor

hhugo commented Nov 19, 2023

You need a custom version of dune. See ocaml/dune#8278

@vouillon
Copy link
Collaborator

I have updated the README file to indicate that you have to pin a custom version of dune:

opam pin add dune.3.11 https://github.com/ocaml-wasm/dune.git

vouillon added a commit that referenced this issue Nov 23, 2023
@JasonGross
Copy link
Contributor Author

I have updated the README file to indicate that you have to pin a custom version of dune:

opam pin add dune.3.11 https://github.com/ocaml-wasm/dune.git

This actually isn't enough, since it pins dune but not, e.g., dune-configurator. I think it should be opam pin add https://github.com/ocaml-wasm/dune.git?

@JasonGross
Copy link
Contributor Author

Hm, but this doesn't work either because then js_of_ocaml-compiler fails with Error: Version 3.11 of the dune language is not supported.

@JasonGross
Copy link
Contributor Author

Maybe opam pin add 'https://github.com/ocaml-wasm/dune.git#wasm'?

@JasonGross
Copy link
Contributor Author

Maybe opam pin add 'https://github.com/ocaml-wasm/dune.git#wasm'?

Yep, this one works for me

@JasonGross
Copy link
Contributor Author

Hm, it worked locally, but on CI I'm getting

$ opam pin add -y 'https://github.com/ocaml-wasm/dune.git#wasm' # success
[ ...] 
$ opam pin add -y --debug-level=3 https://github.com/ocaml-wasm/wasm_of_ocaml.git
[...]
00:15.125  CLIENT                 conflict!
[ERROR] Package conflict!
00:15.125  CUDF                   Conflict reporting
  * Missing dependency:
    - js_of_ocaml < 1.2
    no matching version
[NOTE] Pinning command successful, but your installed packages may be out of sync.

Any idea what's generating the js_of_ocaml < 1.2 dependency?

JasonGross added a commit to mit-plv/fiat-crypto that referenced this issue Sep 18, 2024
JasonGross added a commit to mit-plv/fiat-crypto that referenced this issue Sep 20, 2024
* Attempt to fix wasm_of_ocaml

As per https://github.com/ocaml-wasm/wasm_of_ocaml?tab=readme-ov-file#installation, to deal with the CI failure in #1957 / https://github.com/mit-plv/fiat-crypto/actions/runs/10906100009/job/30271149044?pr=1957

* Update coq-docker.yml

* Update coq-docker.yml

Pin more than just dune as per ocaml-wasm/wasm_of_ocaml#8 (comment)

* Update coq-docker.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants