-
Notifications
You must be signed in to change notification settings - Fork 404
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -27,9 +27,18 @@ Add a fake executable in the PATH | |||||
$ which ocamlformat | ||||||
$TESTCASE_ROOT/.bin/ocamlformat | ||||||
|
||||||
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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$ dune pkg lock | ||||||
Solution for dune.lock: | ||||||
- ocaml.0.0.1 | ||||||
|
||||||
Build the OCamlFormat binary dev-tool | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt --preview | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.26.2 | ||||||
File "dune", line 1, characters 0-0: | ||||||
Error: Files _build/default/dune and _build/default/.formatted/dune differ. | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,9 +11,18 @@ Make a fake ocamlformat with a missing ocamlformat.ml file: | |||||
Make dune-project that uses the mocked dev-tool opam-reposiotry. | ||||||
$ make_project_with_dev_tool_lockdir | ||||||
|
||||||
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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$ dune pkg lock | ||||||
Solution for dune.lock: | ||||||
- ocaml.0.0.1 | ||||||
|
||||||
It fails during the build because of missing OCamlFormat module. | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.26.4 | ||||||
File "dev-tools.locks/ocamlformat/ocamlformat.pkg", line 4, characters 6-10: | ||||||
4 | (run dune build -p %{pkg-self:name} @install)) | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,10 +22,19 @@ We consider this version of OCamlFormat as the latest version: | |||||
Make dune-project that uses the mocked dev-tool opam-reposiotry. | ||||||
$ make_project_with_dev_tool_lockdir | ||||||
|
||||||
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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$ dune pkg lock | ||||||
Solution for dune.lock: | ||||||
- ocaml.0.0.1 | ||||||
|
||||||
Without a ".ocamlformat" file, "dune fmt" takes the latest version of | ||||||
OCamlFormat. | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt --preview | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.26.3 | ||||||
File "foo.ml", line 1, characters 0-0: | ||||||
Error: Files _build/default/foo.ml and _build/default/.formatted/foo.ml | ||||||
|
@@ -47,6 +56,7 @@ With a ".ocamlformat" file, "dune fmt" takes the version mentioned inside ".ocam | |||||
file. | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt --preview | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.26.2 | ||||||
File "foo.ml", line 1, characters 0-0: | ||||||
Error: Files _build/default/foo.ml and _build/default/.formatted/foo.ml | ||||||
|
@@ -68,6 +78,7 @@ When "dev-tools.locks" is removed, the solving/lock is renewed | |||||
$ rm -r dev-tools.locks/ocamlformat | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt --preview | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.26.2 | ||||||
File "foo.ml", line 1, characters 0-0: | ||||||
Error: Files _build/default/foo.ml and _build/default/.formatted/foo.ml | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -26,9 +26,18 @@ Check without ".ocamlformat-ignore" file and the feature. | |||||
Create ".ocamlformat-ignore" | ||||||
$ touch .ocamlformat-ignore | ||||||
|
||||||
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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$ dune pkg lock | ||||||
Solution for dune.lock: | ||||||
- ocaml.0.0.1 | ||||||
|
||||||
Check with the feature when ".ocamlformat-ignore" file exists. | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt --preview | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.26.2 | ||||||
File "foo.ml", line 1, characters 0-0: | ||||||
Error: Files _build/default/foo.ml and _build/default/.formatted/foo.ml | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -55,9 +55,18 @@ Make the ocamlformat opam package which uses a patch: | |||||
Make a project that uses the fake ocamlformat: | ||||||
$ make_project_with_dev_tool_lockdir | ||||||
|
||||||
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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$ dune pkg lock | ||||||
Solution for dune.lock: | ||||||
- ocaml.0.0.1 | ||||||
|
||||||
First run of 'dune fmt' | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt 2>&1 | sed -E 's#.*.sandbox/[^/]+#.sandbox/$SANDBOX#g' | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.26.2 | ||||||
Error: | ||||||
.sandbox/$SANDBOX/_private/default/.dev-tool/ocamlformat/ocamlformat/source/patch-for-ocamlformat.patch: | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,10 +25,19 @@ Initial file: | |||||
$ cat foo.ml | ||||||
let () = print_endline "Hello, world" | ||||||
|
||||||
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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$ dune pkg lock | ||||||
Solution for dune.lock: | ||||||
- ocaml.0.0.1 | ||||||
|
||||||
This should choose the 0.24+foo version: | ||||||
$ echo "version=0.24" > .ocamlformat | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.24+foo | ||||||
File "foo.ml", line 1, characters 0-0: | ||||||
Error: Files _build/default/foo.ml and _build/default/.formatted/foo.ml | ||||||
|
@@ -44,6 +53,7 @@ This should choose the 0.24+bar version: | |||||
$ rm -rf dev-tools.locks | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt | ||||||
Solution for dev-tools.locks/ocamlformat: | ||||||
- ocaml.0.0.1 | ||||||
- ocamlformat.0.25+bar | ||||||
File "foo.ml", line 1, characters 0-0: | ||||||
Error: Files _build/default/foo.ml and _build/default/.formatted/foo.ml | ||||||
|
@@ -62,7 +72,7 @@ This should fail as there is no version matching 0.24.1: | |||||
Error: Unable to solve dependencies for the following lock directories: | ||||||
Lock directory dev-tools.locks/ocamlformat: | ||||||
Can't find all required versions. | ||||||
Selected: ocamlformat_dev_tool_wrapper.dev | ||||||
Selected: ocaml.0.0.1 ocamlformat_dev_tool_wrapper.dev | ||||||
- ocamlformat -> (problem) | ||||||
ocamlformat_dev_tool_wrapper dev requires >= 0.24.1 & <= | ||||||
0.24.1___MAX_VERSION | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,12 +12,20 @@ Update ".ocamlformat" file with unknown version of OCamlFormat. | |||||
> version = 0.26.9 | ||||||
> EOF | ||||||
|
||||||
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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$ dune pkg lock | ||||||
Solution for dune.lock: | ||||||
- ocaml.0.0.1 | ||||||
|
||||||
Format, it shows the solving error. | ||||||
$ DUNE_CONFIG__LOCK_DEV_TOOL=enabled dune fmt | ||||||
Error: Unable to solve dependencies for the following lock directories: | ||||||
Lock directory dev-tools.locks/ocamlformat: | ||||||
Can't find all required versions. | ||||||
Selected: ocamlformat_dev_tool_wrapper.dev | ||||||
Selected: ocaml.0.0.1 ocamlformat_dev_tool_wrapper.dev | ||||||
- ocamlformat -> (problem) | ||||||
No known implementations at all | ||||||
[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.