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

dune fails to build with dune cache enabled #4575

Closed
avsm opened this issue May 5, 2021 · 9 comments
Closed

dune fails to build with dune cache enabled #4575

avsm opened this issue May 5, 2021 · 9 comments

Comments

@avsm
Copy link
Member

avsm commented May 5, 2021

I just tried to build an opam local switch, and got:

$ opam switch create . 4.12.0 
opam-monorepo is now pinned to git+file:///Users/avsm/src/git/ocamllabs/opam-monorepo#412 (version 0.2.1)

<><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><>  🐫 
Switch invariant: ["ocaml-base-compiler" {= "4.12.0"} | "ocaml-system" {= "4.12.0"}]
The following actions will be performed:
  ∗ install base-unix          base        [required by bos]
  ∗ install conf-pkg-config    2           [required by bigstringaf]
  ∗ install base-bigarray      base        [required by opam-core]
  ∗ install base-threads       base        [required by logs]
  ∗ install ocaml-system       4.12.0
  ∗ install ocaml-config       2           [required by ocaml]
  ∗ install ocaml              4.12.0      [required by opam-monorepo]
  ∗ install seq                base        [required by fmt]
  ∗ install ocamlfind          1.9.1       [required by bos]
  ∗ install ocamlbuild         0.14.0      [required by bos]
  ∗ install dune               2.8.5       [required by opam-monorepo]
  ∗ install cmdliner           1.0.4       [required by opam-monorepo]
<snip>

[ERROR] The compilation of dune.2.8.5 failed at "./dune.exe build -p dune --profile dune-bootstrap -j 27".

#=== ERROR while compiling dune.2.8.5 =========================================#
# context     2.1.0~beta4 | macos/x86_64 | ocaml-system.4.12.0 | file:///Users/avsm/src/git/ocaml/opam-repository
# path        ~/src/git/ocamllabs/opam-monorepo/_opam/.opam-switch/build/dune.2.8.5
# command     ~/.opam/opam-init/hooks/sandbox.sh build ./dune.exe build -p dune --profile dune-bootstrap -j 27
# exit-code   1
# env-file    ~/.opam/log/dune-66022-4663c3.env
# output-file ~/.opam/log/dune-66022-4663c3.out
### output ###
# Error: too many retries (100): waiting for beacon file
# "/Users/avsm/.cache/dune/db/runtime/dune-cache-daemon/port" to be locked
# Error: empty output starting cache
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫 
┌─ The following actions failed
│ λ build dune 2.8.5
└─ 
┌─ The following changes have been performed (the rest was aborted)
│ ∗ install astring         0.8.5
│ ∗ install base-bigarray   base
│ ∗ install base-bytes      base
│ ∗ install base-threads    base
│ ∗ install base-unix       base
│ ∗ install cmdliner        1.0.4
│ ∗ install conf-pkg-config 2
│ ∗ install fpath           0.7.3
│ ∗ install num             1.4
│ ∗ install ocaml           4.12.0
│ ∗ install ocaml-config    2
│ ∗ install ocaml-system    4.12.0
│ ∗ install ocamlbuild      0.14.0
│ ∗ install ocamlfind       1.9.1
│ ∗ install seq             base
│ ∗ install topkg           1.0.3
└─ 
# Run eval $(opam env) to update the current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed) [Y/n] y

@rgrinberg
Copy link
Member

Could you check if main is working for you? We removed the daemon mode.

@voodoos
Copy link
Collaborator

voodoos commented May 19, 2021

@avsm did you find some time to test with main ?

@avsm
Copy link
Member Author

avsm commented May 20, 2021

unfortunately not -- do go ahead and close if there's not enough to repro or if its irrelevant in main

@rgrinberg
Copy link
Member

I'm closing as this is definitely fixed in main. Beacon files were removed along with the daemon mode.

@smorimoto
Copy link
Member

Indeed it's fixed in main (i.e. dune3), but it should definitely be fixed in 2 as well. It causes quite a few CI errors, mostly on macOS and Windows, which is pretty annoying. How do you feel about backporting them? (CC: @snowleopard @hhugo)

@snowleopard
Copy link
Collaborator

@smorimoto Removing the cache daemon required major changes in Dune: see PRs #4443, #4465, #4484, #4498 and #4576 (plus I might have missed some smaller PRs). Backporting these changes will be a lot of work. I would be happy to review a PR that does that but at the moment I can't commit to doing this work myself.

An alternative and more realistic approach would be to fix the daemon. This may turn out to be just a one-line change but will require some investigation. Again, I'm happy to help with this but I won't be able to lead, sorry.

@ejgallego
Copy link
Collaborator

Hi folks people is hitting this bug "in the wild" , so I wonder if we should recommend disabling the cache in 2.9 + OSX ?

Note the "Connect: operation not permitted", so it may be an easy fix the 2.9 series?

@tchajed
Copy link

tchajed commented Nov 8, 2021

Quick clarification: "Connect: operation not permitted" is a different error that you get with caching enabled and with the daemon manually started with dune cache start.

@snowleopard
Copy link
Collaborator

it may be an easy fix the 2.9 series?

I'm not so sure, since it involves the interaction between Dune and the cache daemon. One of the reasons we deleted the daemon in Dune 3.0 is to get rid of this logic.

I have no access to a Mac machine for testing, so it would be very hard for me to investigate. I'm happy to review a PR if someone finds a way to fix this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants