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

pkg: ocamlformat dev tool requires lockdir #11049

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gridbugs
Copy link
Collaborator

This is a workaround for an issue where dune needs to locate an ocaml toolchain in order to run dune fmt, and in the absence of a lockdir dune will look in PATH for ocaml tools, which may not be present. The consequence of this issue is that users of the developer preview can have an ocaml toolchain installed by dune (in their ~/.cache/dune/toolchains directory), and running dune fmt will complain about ocamlc not being found. Forcing the lockdir to exist means that dune will always take the toolchain implied by the lockdir, and there won't be a situation where the command fails due to ocamlc being missing.

More info in this issue:
#11038

This is a workaround for an issue where dune needs to locate an ocaml
toolchain in order to run `dune fmt`, and in the absence of a lockdir
dune will look in PATH for ocaml tools, which may not be present. The
consequence of this issue is that users of the developer preview can
have an ocaml toolchain installed by dune (in their
~/.cache/dune/toolchains directory), and running `dune fmt` will
complain about `ocamlc` not being found. Forcing the lockdir to exist
means that dune will always take the toolchain implied by the lockdir,
and there won't be a situation where the command fails due to `ocamlc`
being missing.

More info in this issue:
ocaml#11038

Signed-off-by: Stephen Sherratt <[email protected]>
@moyodiallo
Copy link
Collaborator

I was little bit surprise that ocamlformat doesn't depends on toolchains, in my mind all the dev-tools depends on toolchains.

Copy link
Collaborator

@moyodiallo moyodiallo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some typos. Would it be better to have a test case where ocaml doesn't exist inside the lock-dir ?

The project depends on ocaml, so provide a fake ocaml package:
$ make_ocaml_opam_pkg

The ocamlformat dev tool requires the project ot be locked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ocamlformat dev tool requires the project ot be locked:
The ocamlformat dev tool requires the project to be locked:

The project depends on ocaml, so provide a fake ocaml package:
$ make_ocaml_opam_pkg

The ocamlformat dev tool requires the project ot be locked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ocamlformat dev tool requires the project ot be locked:
The ocamlformat dev tool requires the project to be locked:

The project depends on ocaml, so provide a fake ocaml package:
$ make_ocaml_opam_pkg

The ocamlformat dev tool requires the project ot be locked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ocamlformat dev tool requires the project ot be locked:
The ocamlformat dev tool requires the project to be locked:

The project depends on ocaml, so provide a fake ocaml package:
$ make_ocaml_opam_pkg

The ocamlformat dev tool requires the project ot be locked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ocamlformat dev tool requires the project ot be locked:
The ocamlformat dev tool requires the project to be locked:

The project depends on ocaml, so provide a fake ocaml package:
$ make_ocaml_opam_pkg

The ocamlformat dev tool requires the project ot be locked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ocamlformat dev tool requires the project ot be locked:
The ocamlformat dev tool requires the project to be locked:

The project depends on ocaml, so provide a fake ocaml package:
$ make_ocaml_opam_pkg

The ocamlformat dev tool requires the project ot be locked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ocamlformat dev tool requires the project ot be locked:
The ocamlformat dev tool requires the project to be locked:

The project depends on ocaml, so provide a fake ocaml package:
$ make_ocaml_opam_pkg

The ocamlformat dev tool requires the project ot be locked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ocamlformat dev tool requires the project ot be locked:
The ocamlformat dev tool requires the project to be locked:

The project depends on ocaml, so provide a fake ocaml package:
$ make_ocaml_opam_pkg

The ocamlformat dev tool requires the project ot be locked:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ocamlformat dev tool requires the project ot be locked:
The ocamlformat dev tool requires the project to be locked:

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

Successfully merging this pull request may close these issues.

2 participants