rems-project / sail

Sail architecture definition language
Other
624 stars 116 forks source link

Dockerfile.nightly fails to build on default branch ("Missing dependency: sail_lean_backend") #733

Closed Trolldemorted closed 1 month ago

Trolldemorted commented 1 month ago

To reproduce:

The build fails and you get the following output. The error message says:

#10 [6/6] RUN opam pin -y add sail $PWD
#10 sha256:6033cfa6ee6ee07b152d74f65185f6d6dc8699e564d21c5bbcece04322d54404
#10 0.494 [WARNING] Running as root is not recommended
#10 2.379 [sail.0.18] synchronised (file:///sail-src)
#10 2.381 sail is now pinned to file:///sail-src (version 0.18)
#10 2.381 
#10 10.65 [ERROR] Package conflict!
#10 10.66   * Missing dependency:
#10 10.66     - sail_lean_backend
#10 10.66     unknown package
#10 10.66 
#10 10.66 [NOTE] Pinning command successful, but your installed packages may be out of sync.
#10 ERROR: executor failed running [/bin/sh -c opam pin -y add sail $PWD]: exit code: 20

Your on-push CI does not try to build the Dockerfile, so it is green.

Alasdair commented 1 month ago

I don't use Docker, so I can't test it, but I think the issue is the opam pin command is wrong. I think it should be something like opam install . to install all the packages. I guess it's trying to search the online repository for metadata and failing.

Trolldemorted commented 1 month ago

Replacing opam pin -y add sail $PWD with opam install . produces the following error message:

 => ERROR [6/6] RUN opam install .                                                                                                                                                                                         1.9s 
------
 > [6/6] RUN opam install .:
#10 0.420 [WARNING] Running as root is not recommended
#10 1.883 sail_sv_backend is now pinned to file:///sail-src (version 0.18)
#10 1.894 sail_smt_backend is now pinned to file:///sail-src (version 0.18)
#10 1.896 sail_output is now pinned to file:///sail-src (version 0.18)
#10 1.899 sail_ocaml_backend is now pinned to file:///sail-src (version 0.18)
#10 1.902 sail_manifest is now pinned to file:///sail-src (version 0.18)
#10 1.904 sail_lem_backend is now pinned to file:///sail-src (version 0.18)
#10 1.907 Package sail_lean_backend does not exist, create as a NEW package? [Y/n] n
------
executor failed running [/bin/sh -c opam install .]: exit code: 10
Alasdair commented 1 month ago

Would be opam install --yes . then I think. You do want to create as a new package, as it doesn't exist in a released version of Sail yet.

Trolldemorted commented 1 month ago

That does make sense, and with RUN opam install --yes . it builds successfully and a subsequent docker run sail --help shows me the expected help output 🎉

Should I include the change in https://github.com/rems-project/sail/pull/734?

Alasdair commented 1 month ago

Yes, if you included it there that would be great!

Trolldemorted commented 1 month ago

done!

Thanks for the quick help, having the whole thing containerized reduces the barrier to entry significantly.